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

Multiple-instrument Callbacks must only be associated with instruments from the same Meter #3583

Closed
MrAlias opened this issue Jan 11, 2023 · 1 comment · Fixed by #3584
Closed
Assignees
Labels
area:metrics Part of OpenTelemetry Metrics bug Something isn't working pkg:SDK Related to an SDK package

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Jan 11, 2023

The metric specification states:

Multiple-instrument Callbacks MUST be associated at the time of registration with a declared set of asynchronous instruments from the same Meter instance.

Currently, our SDK implementation does not conform to this. In fact we test that it violates this requirement currently:

m2 := mp.Meter("scope2")
ctr2, err := m2.Int64ObservableCounter("ctr2")
assert.NoError(t, err)
_, err = m1.RegisterCallback([]instrument.Asynchronous{ctr2}, func(ctx context.Context) error {
ctr2.Observe(ctx, 7)
return nil
})
assert.NoError(t, err)

@MrAlias MrAlias added bug Something isn't working pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics labels Jan 11, 2023
@MrAlias MrAlias changed the title Multiple-instrument Callbacks must only be associated with instruments from the same Meter instance Multiple-instrument Callbacks must only be associated with instruments from the same Meter Jan 11, 2023
@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 11, 2023

I have a proposal to solve #3519 that I am working on. It should also resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics bug Something isn't working pkg:SDK Related to an SDK package
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant