Skip to content

[receiver/k8scluster] Associate hpa metrics with the scale target #38768

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

Closed
atoulme opened this issue Mar 18, 2025 · 2 comments · Fixed by #40063
Closed

[receiver/k8scluster] Associate hpa metrics with the scale target #38768

atoulme opened this issue Mar 18, 2025 · 2 comments · Fixed by #40063
Labels

Comments

@atoulme
Copy link
Contributor

atoulme commented Mar 18, 2025

Component(s)

No response

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

HPA objects are associated with a scale target typically expressed with an expression:

  scaleTargetRef:
    apiVersion: apps/v1
    kind: StatefulSet
    name: sample-app

This is not currently present on the hpa metrics and therefore it is difficult to understand which hpa metrics are associated with which target.

Describe the solution you'd like

Add additional dimensions to hpa metrics identifying the metric with the target in a way that allows disambiguation.

Describe alternatives you've considered

No response

Additional context

No response

@atoulme atoulme added enhancement New feature or request needs triage New item requiring triage receiver/k8scluster labels Mar 18, 2025
Copy link
Contributor

Pinging code owners for receiver/k8sclusterreceiver: @dmitryax @TylerHelmuth @povilasv @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.

@atoulme
Copy link
Contributor Author

atoulme commented Mar 19, 2025

open-telemetry/semantic-conventions#2008 is open as a companion task for semantic conventions.

@iblancasa iblancasa removed the needs triage New item requiring triage label May 6, 2025
atoulme pushed a commit that referenced this issue May 14, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adds new resource attributes to `k8s.hpa`. These attributes track the
target resource a given HPA is configured to scale. The attributes are -
`k8s.hpa.scaletargetref.kind`, `k8s.hpa.scaletargetref.name`, and
`k8s.hpa.scaletargetref.apiversion`. These attributes are disabled by
default.

PR for semantic-conventions is available
[here](open-telemetry/semantic-conventions#2180).

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes #38768

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests
Tested manually in a k8s cluster

<!--Describe the documentation added.-->
#### Documentation
Documentation updated with new attribute names

<!--Please delete paragraphs that you did not use before submitting.-->
seongpil0948 pushed a commit to seongpil0948/opentelemetry-collector-contrib that referenced this issue May 16, 2025
)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adds new resource attributes to `k8s.hpa`. These attributes track the
target resource a given HPA is configured to scale. The attributes are -
`k8s.hpa.scaletargetref.kind`, `k8s.hpa.scaletargetref.name`, and
`k8s.hpa.scaletargetref.apiversion`. These attributes are disabled by
default.

PR for semantic-conventions is available
[here](open-telemetry/semantic-conventions#2180).

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#38768

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests
Tested manually in a k8s cluster

<!--Describe the documentation added.-->
#### Documentation
Documentation updated with new attribute names

<!--Please delete paragraphs that you did not use before submitting.-->
johnleslie pushed a commit to johnleslie/opentelemetry-collector-contrib that referenced this issue May 23, 2025
)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adds new resource attributes to `k8s.hpa`. These attributes track the
target resource a given HPA is configured to scale. The attributes are -
`k8s.hpa.scaletargetref.kind`, `k8s.hpa.scaletargetref.name`, and
`k8s.hpa.scaletargetref.apiversion`. These attributes are disabled by
default.

PR for semantic-conventions is available
[here](open-telemetry/semantic-conventions#2180).

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#38768

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests
Tested manually in a k8s cluster

<!--Describe the documentation added.-->
#### Documentation
Documentation updated with new attribute names

<!--Please delete paragraphs that you did not use before submitting.-->
johnleslie pushed a commit to johnleslie/opentelemetry-collector-contrib that referenced this issue May 23, 2025
)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adds new resource attributes to `k8s.hpa`. These attributes track the
target resource a given HPA is configured to scale. The attributes are -
`k8s.hpa.scaletargetref.kind`, `k8s.hpa.scaletargetref.name`, and
`k8s.hpa.scaletargetref.apiversion`. These attributes are disabled by
default.

PR for semantic-conventions is available
[here](open-telemetry/semantic-conventions#2180).

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#38768

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests
Tested manually in a k8s cluster

<!--Describe the documentation added.-->
#### Documentation
Documentation updated with new attribute names

<!--Please delete paragraphs that you did not use before submitting.-->
dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this issue May 23, 2025
)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adds new resource attributes to `k8s.hpa`. These attributes track the
target resource a given HPA is configured to scale. The attributes are -
`k8s.hpa.scaletargetref.kind`, `k8s.hpa.scaletargetref.name`, and
`k8s.hpa.scaletargetref.apiversion`. These attributes are disabled by
default.

PR for semantic-conventions is available
[here](open-telemetry/semantic-conventions#2180).

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#38768

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests
Tested manually in a k8s cluster

<!--Describe the documentation added.-->
#### Documentation
Documentation updated with new attribute names

<!--Please delete paragraphs that you did not use before submitting.-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants