-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[processor/k8sattributes] Automatic resource attributes - annotation prefix #38825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[processor/k8sattributes] Automatic resource attributes - annotation prefix #38825
Conversation
@dmitryax as discussed, this is the first PR for automatic resource attributes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not an approver unfortunately, but I looked through this PR and it looks good to me
perhaps @andrzej-stencel could take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's agree on the configuration interface before proceeding https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/37114/files#r2025819122
@dmitryax answering here:
will do
will remove
sounds good 😄 |
8de94f4
to
5ec4a2d
Compare
@dmitryax done - the test failures seem unrelated to this PR |
I actually missed that we already have If that sounds good, we should clearly describe it in the changelog and how to disable it. |
I like that 😄 |
@dmitryax on second thought - what about users who do have their own attribute rules? They would have to add a rule with the exact prefix - I would like to avoid that users have to know those details. |
5ec4a2d
to
496c904
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of keeping the extract:otel_annotations
setting different from the extract::annotations
. Changing the behaviour of extract::annotations
now to include the logic of this PR would affect users as a breaking change and disabling this or just overriding the rules would require extra manual work for the users. In addition, it's not a bad design to group this rulings under a specific setting as a shortcut, right?
Based on this I'd lean towards going with the separate one.
key: app.kubernetes.io/component | ||
from: pod | ||
# Apply the operator rules - see https://github.com/open-telemetry/semantic-conventions/blob/main/docs/non-normative/k8s-attributes.md | ||
otel_annotations: true # default is false - use true to enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the addition of this specific one. However, I wonder how this will be combined with the rest of the settings as described at #37114 (comment). Sorry if I miss any context here but that'd help clarifying this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need to have another 2 flag to cover this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we decide on those at a high level before adding this specific one? My preference would be to have alignment on the high level config schema before starting any partial implementations. Would that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need any other config options for other things. See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/37114/files#r2025819122
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the well known labels that are described at https://github.com/open-telemetry/opentelemetry-operator?tab=readme-ov-file#configure-resource-attributes-with-labels and was originally added in https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/37114/files#diff-57b0d6448d516c0c80b326a7f7f95c3256b2b774e496870dc1dd35dcf8bfc256R281?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we just add them as options to the existing extract::metadata
set https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/k8sattributesprocessor/config.go#L156
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, extract::metadata
is a map string array so I'm not sure how we could add extra options without breaking it, right?
Also in this PR we extract the annotation through the extract::otel_annotations
setting so I assume the equivalent would be extract::well_known_labels
, @zeitlinger could you confirm if that's the direction you had in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my perspective I'm coverd with the current state and the future plans. @dmitryax feel free to resolve this comment if we are on agreement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I was thinking of avoiding complicating the configuration interface which is already big and complex, but this is a valid concern. So I agree with keeping another option. |
Co-authored-by: Christos Markou <[email protected]>
952cd90
to
0e8a3c9
Compare
I see, my only concern would be that the I'm going to approve this PR as is since this top level |
…prefix (open-telemetry#38825) This is the first part of open-telemetry#37114 - the ability to use an annotation prefix to define a resource attribute --------- Co-authored-by: Christos Markou <[email protected]>
…prefix (open-telemetry#38825) This is the first part of open-telemetry#37114 - the ability to use an annotation prefix to define a resource attribute --------- Co-authored-by: Christos Markou <[email protected]>
This is the first part of #37114 - the ability to use an annotation prefix to define a resource attribute