-
Notifications
You must be signed in to change notification settings - Fork 250
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
Stats: Timestamps not updated when new measurement is recorded #509
Comments
end_time will always be newer than start_time .
We don't use the timestamp associated with measurements except in |
I don't completely understand why it being aggregated data means the timestamp shouldn't be used. To me the aggregated data represents the data for the interval up to and including the Otherwise maybe What do you think? |
Yes in other languages we do in this way. Even if
There're several reasons that I can think of. One is to avoid overhead when recording. Our expectation is that recording
I kind of agree with your opinion. In other languages In Python unfortunately we didn't make clear separation between the mutable and immutable aggregated data, and |
Gotcha, the Do you think it would make sense to handle this bug first, making view data copies and calling |
Yes I'm working on a quick fix for this issue first. |
A call to
MeasurementMap.record
creates a timestamp and then passes that throughMeasureToViewMap.record
->ViewData.record
->AggregationData.add_sample
but is never persisted anywhere.This means that the timestamp of when the view is registered is used whenever measurements are exported. For stackdriver this means that the first time the time series are sent from a particular instance it succeeds, but any subsequent call fails because the timestamp is too close to the prior timestamp or if the instance has been up for more than a day it fails as the timestamp is too old.
I would expect the
_end_time
ofViewData
to be updated when a new measurement is recorded, which would fix this problem for cumulative metrics. Depending on how_start_time
and_end_time
are used when exporting, this may be the correct solution for gauges as well.The text was updated successfully, but these errors were encountered: