-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Ensure LongTaskTimer and FunctionTimer produce consistent data #3985
Ensure LongTaskTimer and FunctionTimer produce consistent data #3985
Conversation
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
@jonatan-ivanov Should I open an issue for this one or is it enough to keep the PR here? |
If there is an open PR, there is usually no need for a separate issue, GitHub (and we too) handle them quite similarly. |
f781ce3
to
278d9d5
Compare
Rebased on the latest 1.9.x branch |
LongTaskTimer
and FunctionTimer
produce consistent data
Thank you for the PR! |
Ah, I must have forgotten to turn |
In the past, there were problems with the
LongTaskTimer
: In cases where only one value was exported, the max and total duration were read sequentially while the clock continued to tick in the background. Since the Dynatrace API checks this data strictly, data, where the sum and max were not exactly the same when the count was 1, were rejected. The discrepancy is caused by the non-atomicity of retrieving max and sum. As soon as there is more than one observation, this problem disappears since the Dynatrace API checks for min <= mean <= max, and that should always be the case when there is more than 1 value. If it is not the case, the underlying data collection is really broken and the data should be rejected.We saw this issue with the metric
http.server.requests.active
when there was exactly one request in-flight. The retrieval of max and total are not synchronized, so the clock continues to tick and results in two different values (e.g., max=0.764418,sum=0.700539,count=1, which is invalid according to the Dynatrace specification).Additionally, Since there is no way to retrieve (or even set) data for the
FunctionTimer
atomically, a similar problem might arise there. I added some guarding code to ensure only valid data should be exported.I consider this a bugfix, since it leads to problems in various deployments. I think by targeting the 1.9.x branch, this change should be merged forward to all newer branches, right?