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/metricsgeneration] Generate metrics even when the second metric's value is 0 #35537

Merged
merged 4 commits into from
Oct 2, 2024

Conversation

crobert-1
Copy link
Member

Description:

Originally, this processor would not generate a new metric if the value of the metric configured as metric2 was 0. There are valid reasons why this calculation should still be done, and a new metric should be calculated.

Link to tracking Issue:
Resolves #35533

Testing:
Added tests for each calculation type to show expected results when the second metric's value is 0.

@crobert-1 crobert-1 requested a review from a team as a code owner October 1, 2024 23:40
@github-actions github-actions bot added the processor/metricsgeneration Metrics Generation processor label Oct 1, 2024
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider this to be a breaking change as existing collector configurations will now potentially be emitting more metrics than before.

- Reorganize logic to make dropping empty metrics more straight-forward
- Rename variable
- Also renamed a method to a more accurate name as its functionality changed.
@dmitryax dmitryax merged commit 6fe2a2a into open-telemetry:main Oct 2, 2024
156 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 2, 2024
@crobert-1 crobert-1 deleted the metricsgeneration_metric2_0 branch October 2, 2024 23:29
jriguera pushed a commit to springernature/opentelemetry-collector-contrib that referenced this pull request Oct 4, 2024
…etric's value is 0 (open-telemetry#35537)

**Description:**
Originally, this processor would not generate a new metric if the value
of the metric configured as `metric2` was `0`. There are valid reasons
why this calculation should still be done, and a new metric should be
calculated.

**Link to tracking Issue:** Resolves open-telemetry#35533

**Testing:**
Added tests for each calculation type to show expected results when the
second metric's value is 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/metricsgeneration Metrics Generation processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[processor/metricsgeneration] Metrics should be calculated when second metric value is 0
4 participants