Skip to content
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/k8sattribute] Optionally add labels and annotations from node as resource attributes in the k8sattributes processor #22620

Closed
jinja2 opened this issue May 22, 2023 · 13 comments · Fixed by #28570
Assignees
Labels
enhancement New feature or request processor/k8sattributes k8s Attributes processor

Comments

@jinja2
Copy link
Contributor

jinja2 commented May 22, 2023

Component(s)

processor/k8sattributes

Is your feature request related to a problem? Please describe.

Some node labels like the topology or arch type of node, might provide useful insight into telemetry from applications. Being able to filter application performance metrics by the zone the pods are running in, can be useful for application developers to identify degradation in an availability zone due to cloud provider outage for e.g.

Describe the solution you'd like

I'd like to be able to add labels and annotations from the node as additional resource attributes on telemetry processed through the k8s attributes processor.

k8sattributes:
  labels:
    - tag_name: availability_zone
      key: topology.kubernetes.io/zone
      from: node

Describe alternatives you've considered

No response

Additional context

No response

@jinja2 jinja2 added enhancement New feature or request needs triage New item requiring triage labels May 22, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@jinja2
Copy link
Contributor Author

jinja2 commented May 22, 2023

/label processor/k8sattributes

@github-actions github-actions bot added the processor/k8sattributes k8s Attributes processor label May 22, 2023
@dmitryax dmitryax added the help wanted Extra attention is needed label May 23, 2023
@swiatekm
Copy link
Contributor

On one hand, this is genuinely useful.

On the other hand, you can make the same argument for attaching labels and annotations from every single resource type connected to the Pod: Deployments, Jobs, etc. The concern I have is whether we're also open to adding those, because in that case we should probably work out both a generic implementation and a generic way of configuring these.

That's not really a vote against implementing this, if someone wants to, just a thought about the future.

@dmitryax
Copy link
Member

dmitryax commented May 23, 2023

I believe this is a valid ask. It'll also allow using a k8s attributes processor for filtering/changing data coming from particular nodes.

This should be implemented in a way that it doesn't introduce any memory overhead if the feature is not being used

On the other hand, you can make the same argument for attaching labels and annotations from every single resource type connected to the Pod: Deployments, Jobs, etc. The concern I have is whether we're also open to adding those, because in that case we should probably work out both a generic implementation and a generic way of configuring these.

It's a valid concern, but I don't think that labels/annotations from job, deployment, daemonset, etc are as useful as node attributes. If there is a need for them, we can consider a generic approach later.

@dmitryax
Copy link
Member

@jinja2, let us know if you can work on this

@dmitryax dmitryax removed the needs triage New item requiring triage label May 23, 2023
@jinja2
Copy link
Contributor Author

jinja2 commented May 24, 2023

Thanks @dmitryax @swiatekm-sumo for the feedback. Users tend to have similar set of metadata on pods and their controllers, so I don't think we need to add similar feature objects like deployments, etc. until requested as Dmitrii mentioned. I can work on adding support for node attributes.

@swiatekm
Copy link
Contributor

In terms of implementation, it's worth noting that labels and annotations can change at any time. So we need to treat attributes from Node labels the same way we do Namespaces.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jul 24, 2023
@dmitryax dmitryax removed the Stale label Jul 24, 2023
@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@jaronoff97
Copy link
Contributor

Wanted to check in and see if anyone was actively working on this?

@jinja2
Copy link
Contributor Author

jinja2 commented Oct 23, 2023

@jaronoff97 haven't gotten to it yet. I should have more capacity in November and can get this in a few weeks. But if you'd like to pick it up, please go ahead!

@jaronoff97
Copy link
Contributor

not positive i have capacity either... I'll check in with my team and see if anyone else does. If not we can wait until november.

@haoqixu
Copy link
Member

haoqixu commented Oct 24, 2023

I'd like to work on this.

@TylerHelmuth TylerHelmuth assigned haoqixu and unassigned jinja2 Oct 24, 2023
@TylerHelmuth TylerHelmuth removed the help wanted Extra attention is needed label Oct 24, 2023
dmitryax pushed a commit that referenced this issue Oct 31, 2023
…ode (#28570)

**Description:**
support adding labels and annotations from the node as additional
resource attributes on telemetry processed through the `k8sattributes`
processor.

**Link to tracking Issue:** Resolve  #22620

---------

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
jmsnll pushed a commit to jmsnll/opentelemetry-collector-contrib that referenced this issue Nov 12, 2023
…ode (open-telemetry#28570)

**Description:**
support adding labels and annotations from the node as additional
resource attributes on telemetry processed through the `k8sattributes`
processor.

**Link to tracking Issue:** Resolve  open-telemetry#22620

---------

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
RoryCrispin pushed a commit to ClickHouse/opentelemetry-collector-contrib that referenced this issue Nov 24, 2023
…ode (open-telemetry#28570)

**Description:**
support adding labels and annotations from the node as additional
resource attributes on telemetry processed through the `k8sattributes`
processor.

**Link to tracking Issue:** Resolve  open-telemetry#22620

---------

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request processor/k8sattributes k8s Attributes processor
Projects
None yet
6 participants