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

Add resettable DistributionSummary and Timer for Dynatrace registry #3093

Conversation

pirgeo
Copy link
Contributor

@pirgeo pirgeo commented Mar 24, 2022

related to #3007

This PR introduces resettable Timer and DistributionSummary instruments to be used in the Dynatrace v2 exporter to ensure no max-buffering from previous export intervals ends up in the exported lines. These types also add support for tracking the minimum since the last export.

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.

I quickly went through the PR, I think introducing a new Timer and DistributionSummary is the way to solve the original issue. 👍🏼

Copy link
Contributor Author

@pirgeo pirgeo left a comment

Choose a reason for hiding this comment

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

Thanks for the input, @jonatan-ivanov!

I updated the PR with a bunch of changes based on your comments. Originally, I did not base the DynatraceTimer and DynatraceDistributionSummary off of AbstractTimer and AbstractDistributionSummary since those already track a Histogram, which we currently do not need. Since the underlying data structure is rather simple (only min/max/sum/count) we do not necessarily want to track the whole histogram. I must have missed the NoopHistogram in my first pass, thats why I implemented the interfaces directly. By basing our instruments off the Abstract instruments, the implementation actually became simpler. I set the Dynatrace instruments up in a way where the Histogram will always be a NoopHistogram.

I also added a toggle to the DynatraceConfig now that allows for switching back to the original Micrometer-provided instruments, and rebased it on 1.9.0.

@jonatan-ivanov jonatan-ivanov changed the base branch from main to 1.9.x April 8, 2022 17:12
return;
}

synchronized (this) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking if we can get into trouble because of this or using a ReadWriteLock and non concurrent types would be more performant. Since Atomic* and *Adder classes are lock free, I'm not sure.

@jonatan-ivanov jonatan-ivanov added enhancement A general enhancement registry: dynatrace A Dynatrace Registry related issue labels Apr 8, 2022
@jonatan-ivanov jonatan-ivanov added this to the 1.9.0-RC1 milestone Apr 8, 2022
@jonatan-ivanov jonatan-ivanov merged commit 7b6a68f into micrometer-metrics:1.9.x Apr 8, 2022
@jonatan-ivanov
Copy link
Member

@pirgeo Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A general enhancement registry: dynatrace A Dynatrace Registry related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants