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/transform] use default unit in extract_count_metric() #31636

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Mar 7, 2024

Description:

The transformprocessor offers a function extract_count_metric(). Currently this function copies over the unit from the original metric to a new count metric. However, this unit is not applicable as the value is a count of how many values were recorded in a Explicit Bucket/Exponential Histogram or Summary.

Therefore this PR changes that function so that it adds the default unit (1) to the extracted count metric instead.

Link to tracking Issue: #31575

Testing: Unit tests (updated)

Documentation: Added a changelog entry as the change is user-facing (the unit of the emitted telemetry is changed)

@pichlermarc pichlermarc marked this pull request as ready for review March 8, 2024 15:56
@pichlermarc pichlermarc requested a review from a team as a code owner March 8, 2024 15:56
@TylerHelmuth TylerHelmuth added the ready to merge Code review completed; ready to merge by maintainers label Mar 11, 2024
@TylerHelmuth TylerHelmuth merged commit c999301 into open-telemetry:main Mar 12, 2024
146 of 147 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 12, 2024
@pichlermarc pichlermarc deleted the fix/extract-count-default-unit branch March 13, 2024 08:27
DougManton pushed a commit to DougManton/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
…n-telemetry#31636)

**Description:** 

The `transformprocessor` offers a function `extract_count_metric()`.
Currently this function copies over the `unit` from the original metric
to a new `count` metric. However, this unit is not applicable as the
value is a count of how many values were recorded in a Explicit
Bucket/Exponential Histogram or Summary.

Therefore this PR changes that function so that it adds the default unit
(`1`) to the extracted count metric instead.

**Link to tracking Issue:** open-telemetry#31575 

**Testing:** Unit tests (updated)

**Documentation:** Added a changelog entry as the change is user-facing
(the unit of the emitted telemetry is changed)

---------

Co-authored-by: Tyler Helmuth <[email protected]>
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
…n-telemetry#31636)

**Description:** 

The `transformprocessor` offers a function `extract_count_metric()`.
Currently this function copies over the `unit` from the original metric
to a new `count` metric. However, this unit is not applicable as the
value is a count of how many values were recorded in a Explicit
Bucket/Exponential Histogram or Summary.

Therefore this PR changes that function so that it adds the default unit
(`1`) to the extracted count metric instead.

**Link to tracking Issue:** open-telemetry#31575 

**Testing:** Unit tests (updated)

**Documentation:** Added a changelog entry as the change is user-facing
(the unit of the emitted telemetry is changed)

---------

Co-authored-by: Tyler Helmuth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/transform Transform processor ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants