opencensus-java icon indicating copy to clipboard operation
opencensus-java copied to clipboard

Timeseries.setPoint should also set the startTime

Open bogdandrutu opened this issue 7 years ago • 2 comments

https://github.com/bogdandrutu/opencensus-java/blob/master/api/src/main/java/io/opencensus/metrics/export/TimeSeries.java#L96

bogdandrutu avatar Mar 06 '19 19:03 bogdandrutu

I think only cumulative metrics have start time, and per proto definition:

  // Must be present for cumulative metrics. The time when the cumulative value
  // was reset to zero. Exclusive. The cumulative value is over the time interval
  // (start_timestamp, timestamp]. If not specified, the backend can use the
  // previous recorded value.
  google.protobuf.Timestamp start_timestamp = 1;

It seems start time is the time when aggregation begins. So you're suggesting Timeseries.setPoint resets the cumulative metrics?

songy23 avatar Mar 06 '19 22:03 songy23

"SetPoint" is a helper function to skip validation of the label values. If the initial Timeseries had a startTime that should be preserved.

bogdandrutu avatar May 04 '19 00:05 bogdandrutu