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

Log when duplicate async instruments are registered #4005

Closed
jack-berg opened this issue Dec 16, 2021 · 0 comments · Fixed by #4020
Closed

Log when duplicate async instruments are registered #4005

jack-berg opened this issue Dec 16, 2021 · 0 comments · Fixed by #4020
Labels
Bug Something isn't working metrics

Comments

@jack-berg
Copy link
Member

If I use the API to register two async instruments with the same name, but different callback behavior, the first one registered wins. The callback of the second is never invoked, and there are no logs to tell me that.

For example:

    AtomicLong countUp = new AtomicLong(0);
    AtomicLong countDown = new AtomicLong(100);
    meter.gaugeBuilder("foo").buildWithCallback(observe -> observe.record(countUp.incrementAndGet()));
    meter.gaugeBuilder("foo").buildWithCallback(observe -> observe.record(countDown.decrementAndGet()));

We should provide useful log messages when conflicts like this happen since unlike synchronous instruments, we can't just return the same instrument that was previously registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working metrics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant