-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
make k8sattributesprocessor enrich based on profile's internal attributes #37269
Comments
Hey @ilyamor, thanks for your issue! If your proposal is something that can be done with the current format, I will transfer this to opentelemetry-collector-contrib. However, if it would require changes in the data model, this would need to be changed in opentelemetry-proto. Could you clarify which of the two you are proposing? |
It will be recommended to deploy OTel eBPF profiler as a daemon set. In such a case, ResourceProfiles.resource in the OTel profiling signal holds only general information about the node the daemon set is running on. From a user perspective, it can be interesting to enrich these pod specific information with components like Hope this adds some context to the request. |
My understanding of this issue is that the k8sattributesprocessor only looks for resources when processing profiles (or any other signal). opentelemetry-collector-contrib/processor/k8sattributesprocessor/processor.go Lines 131 to 138 in 0788185
However, at least for profiles, it should also be looking at attributes, as resources are only host-level, and in the case of profiles with a daemonset architecture, some of the resources the processor needs will be available through the profile's attribute table. So yes, I think this issue belongs in collector-contrib. |
Pinging code owners for processor/k8sattributes: @dmitryax @fatsheep9146 @TylerHelmuth @ChrsMark. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label. |
That would be doable. So far the pod association rules only work with Do we have specific, attributes based, association rules that we would like to support? |
Just a follow up thought: opentelemetry-collector-contrib/processor/k8sattributesprocessor/processor.go Lines 189 to 194 in 37c8044
However, the OTel Profiling signal does not use an attribute map, of type Indices for attribute lookup in Shared attribute table in |
Alternatively, since the profile holds data for the entire host, what about having a list of ResourceProfiles.resource per Resource profile instead of one? One way we could model this, is for the profiler to create placeholder ResourceProfiles.resource which contains only the cgroup name as an attribute. Then in each sample, the profiler would add a In that case, on the processor side, the enrichment would only need to iterate on the top level list of ResourceProfiles.resource, get the cgroup name and fill out the rest of attributes (without having to add the information to each individual sample). Edit: We'll likely also need a way to distinguish samples coming from containerized workloads, and samples coming from services running directly on the host. Could likely be solved by having the first element of the |
It would be nice to make pod association based on cgroup work.
And kube client is likely returning something like
or
|
I would avoid changing to slice of resources for profiling signal. Or changing k8sattributes to dig into internal attributes. I think collector assumes the current resource attribute model in too many places, examples:
Maybe instead we could use transform processor with flatten data, similiar to what we have for logs:
This would debatch, move attributes to resource attributes and then batch profiles based on resource attributes |
@povilasv It is unclear to me whether it would be possible to have a transform processor that would allow us to both stay efficient and at the same time be compatible with the I wrote a problem statement: open-telemetry/opentelemetry-proto#628 that should hopefully highlight why (whether we do this transformation at the profiler level, or a processor level). Curious to have your thoughts! 🙇 |
Is your feature request related to a problem? Please describe.
Currently, the k8sattributeprocessor enriches data based on high-level attributes. In the case of profiling data, the relevant attributes come from ResourceProfiles resources, which only represent host-level attributes. Since the OpenTelemetry profiler agent runs as a DaemonSet on a host and generates profile data, we can’t rely on connection-based pod_association. Instead, we must use resource_attribute.
Describe the solution you'd like
Enrich resources based on internal attributes
https://github.com/open-telemetry/opentelemetry-proto/blob/ffade295895a2be5a6e7931eb0cda1c72bc4c0f6/opentelemetry/proto/profiles/v1development/profiles.proto#L207
Describe alternatives you've considered
Maybe change the format and upgrade some attributes to high level?
The text was updated successfully, but these errors were encountered: