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

Create a new recorder rather than reuse when multiple observations in same epoch #610

Merged
merged 3 commits into from
Apr 2, 2020

Conversation

evantorrie
Copy link
Contributor

Fixes #564

@jmacd Is this approach acceptable for addressing the last observer value wins? I know you previously mentioned we should wait until OTEP 88 is merged, but this seems to be a very simple (possibly too simple?) way to address this.

@evantorrie
Copy link
Contributor Author

@lizthegrey Do you know why the PRs I open never seem to build automatically? Is there something I need to configure on my side?

if lrec.modifiedEpoch == a.meter.currentEpoch {
// last value wins for Observers, so if we see the same labels
// in the current epoch, we replace the old recorder
lrec.recorder = a.meter.batcher.AggregatorFor(&a.descriptor)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I like this approach because it uses no extra memory unless the caller produces multiple observations.

Copy link
Contributor

Choose a reason for hiding this comment

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

(Not sure why I typed "I think" above. I like this approach.)

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

👍

@rghetia rghetia merged commit 367635b into open-telemetry:master Apr 2, 2020
@MrAlias MrAlias added this to the Implement v0.4.0 Specification milestone Jun 3, 2020
@evantorrie evantorrie deleted the last-value-observer branch June 14, 2020 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Last-value-wins for Observer results
4 participants