Skip to content

Conversation

@jaxxnitt
Copy link

This PR implements the enhancement discussed in #6844.

Summary

Adds a new publishAverage() boolean config option to DatadogConfig (default: true).

Updates DatadogMeterRegistry to conditionally publish .avg metrics for:

Timer

FunctionTimer

DistributionSummary

Ensures metadata for average metrics is also controlled by this flag.

Keeps existing 1.x behavior by default, while allowing users to disable average publishing if desired.

This aligns with the intended direction for 1.x and prepares the way for flipping the default in 2.x as discussed in #6843.

Feel free to suggest changes.

Copy link
Member

@jonatan-ivanov jonatan-ivanov left a comment

Choose a reason for hiding this comment

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

Could you please also add some tests?

checkRequired("uri", DatadogConfig::uri));
}

default boolean publishAverage() {
Copy link
Member

Choose a reason for hiding this comment

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

See #6844 (comment), this should work for all the registries that publish avg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants