Skip to content

[processor/transform] Introduce optional metric name suffix setup for convert summary and extract histogram functions #37238

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

Merged
merged 26 commits into from
Jun 23, 2025

Conversation

odubajDT
Copy link
Contributor

@odubajDT odubajDT commented Jan 15, 2025

Description

Introduce optional metric name suffix setup for the following functions:

  • extract_count_metric
  • extract_sum_metric
  • convert_summary_sum_val_to_sum
  • convert_summary_count_val_to_sum

This PR also introduces a breaking change by adapting the metric suffix according to the latest OTel convention which uses . instead of _

Link to tracking issue

Fixes #33850

Note

Addition of convert_summary_quantile_val_to_gauge(Optional[suffix]) function as described in the linked issue will be added in a separate PR

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 30, 2025
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Feb 13, 2025
@odubajDT
Copy link
Contributor Author

/reopen

@bacherfl bacherfl reopened this Feb 17, 2025
@odubajDT odubajDT force-pushed the transform-name-suffix branch from e4b47d0 to 97c7c24 Compare February 17, 2025 12:05
@github-actions github-actions bot removed the Stale label Feb 18, 2025
odubajDT added 3 commits March 3, 2025 16:54
… convert summary and extract histogram functions

Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
@odubajDT odubajDT force-pushed the transform-name-suffix branch from 7415c34 to cfdb468 Compare March 3, 2025 15:59
Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

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

Sorry for the long delay with a review.

Copy link
Contributor

Choose a reason for hiding this comment

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

@edmocosta @TylerHelmuth Now that the transform processor is beta, I'm wondering how we should handle this change. I can think of a few options, in order of most-abrupt to least.

  1. Since this breaking change can easily be reverted by including an optional prefix with the former name, simply advise users of this in the subtext and continue with the breaking change.
  2. Make the breaking change one version after adding the optional parameter, and announce that we will be making this change as part of the optional parameter changelog entry to give users more time.
  3. Use a feature gate to control rolling this out.

On one hand, I'm okay being more aggressive since there's a clear and straightforward remediation path to retaining the old metric names. On the other hand, this change is "silent" within the Collector and won't go noticed until the user is seeing (or missing) data in their backend.

Copy link
Contributor

Choose a reason for hiding this comment

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

Considering changing the metric names can impact so many things on the user's side (dashboards, alerts, etc), I think I'd go with the more conservative option, giving users some time to adapt, without breaking it.

I like the feature gate idea to control the default suffix separator (_ or .). In addition to that, we could maybe log a message (at function bootstrap) when the suffix.IsEmpty(), warning users that does not read the release notes that the default suffix will be changed. Finally, we could update the functions docs examples to include the suffix args with the dot separator, so people that just copy & paste it during the transition time won't have issues when the new suffix format comes into place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not have the capacity to deal with additional requests here, since the scope of the ticket changed, if somebody is interested please take over the PR, sorry

Copy link
Contributor

Choose a reason for hiding this comment

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

No problem, thank you @odubajDT!

I think we could add the deprecation things later, this PR is around for a while, and releasing it with the suffix support would be a quick win IMO. If @evan-bradley agrees, we could just bringing the default prefix separator back to _ , and tackle the prefix changes/deprecation later.

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds good to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @odubajDT, I've opened an PR against your branch addressing these last requests (odubajDT#125), could you please kindly merge it so we can finish the review using your PR? If you don't have availability for that please let me know so I can open a new one. Thank you again!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

merged, thanks!

Copy link
Contributor

@edmocosta edmocosta left a comment

Choose a reason for hiding this comment

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

LGTM, @evan-bradley please take a look when you get the chance.

@evan-bradley evan-bradley merged commit 9a2ea1c into open-telemetry:main Jun 23, 2025
177 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[processor/transform] Allow specifying metric name suffix when using convert summary functions
6 participants