You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on a Spring Framework instrumentation problem, I have noticed that my instrumentation could in some cases call observation.stop() twice. This is not an intended usage and is considered as a bug in the instrumentation.
In production, calling stop() multiple times on an observation will result in calling observation handlers multiple times. In case of metrics, this will create duplicate records for the same observation (it will be counted twice). I have tried to replicate this case and test against it in my test suite, but failed to do that. Right now "micrometer-observation-test" allows to check whether an observation has been closed. In case of multiple stop() calls, I couldn't find a way to detect this case with the TestObservationRegistry.
I understand that introducing additional state checks in observations would likely create a performance degradation - testing this case would help instrumentations.
The text was updated successfully, but these errors were encountered:
shakuzen
changed the title
Test duplicate stops on observations
Validate expected Observation API call ordering on TestObservationRegistry
Aug 13, 2024
While working on a Spring Framework instrumentation problem, I have noticed that my instrumentation could in some cases call
observation.stop()
twice. This is not an intended usage and is considered as a bug in the instrumentation.In production, calling
stop()
multiple times on an observation will result in calling observation handlers multiple times. In case of metrics, this will create duplicate records for the same observation (it will be counted twice). I have tried to replicate this case and test against it in my test suite, but failed to do that. Right now "micrometer-observation-test" allows to check whether an observation has been closed. In case of multiplestop()
calls, I couldn't find a way to detect this case with theTestObservationRegistry
.I understand that introducing additional state checks in observations would likely create a performance degradation - testing this case would help instrumentations.
The text was updated successfully, but these errors were encountered: