You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating multiple Float64ObservableGauge with the same name, but different callbacks, it appears like only the first callback is used. This didn't used to be the case I tested in v1.21.0 and in that version both callbacks are called, the behaviour is also different if the callbacks are given as options when creating the gauge vs registering later which is very confusing.
I would like to understand:
Was this an intentional breaking change? I couldn't find anything in the release notes, but maybe I missed it.
Can I rely on the 2nd test behaviour or could that change as well?
Environment
OS: Mac OS
Architecture: ARM
Go Version: 1.21.1
opentelemetry-go version:v1.21.0 and v1.26.0
Steps To Reproduce
I created two tests in v1.21.0 both these test pass, in version v1.23.0 and v1.26.0 the first test fails since only the first callback is registered
Note: it is possible the behaviour changes in v1.22.0, I couldn't get this version using go get for some reason
I would expect both tests to pass. Since the spec says
Every currently registered Callback associated with a set of instruments MUST be evaluated exactly once during collection prior to reading data for that instrument set.
And I don't see anything in the spec as to why the 2nd callback should not be registered just because a gauge with the same name already exists. Did I miss something?
The text was updated successfully, but these errors were encountered:
I'm running into this same issue with Int64ObservableUpDownCounters. I want to link #4884 as being related as it seems to have been introduced at the same time, and was resolved in February. /cc @MrAlias
In my use case I have an instrumentation that wraps different instances of a component. Each instance of my instrumentation creates new meters, and I'd expect the callbacks for each to be called. Instead, only the callbacks of the first instance are called.
Description
When creating multiple
Float64ObservableGauge
with the same name, but different callbacks, it appears like only the first callback is used. This didn't used to be the case I tested inv1.21.0
and in that version both callbacks are called, the behaviour is also different if the callbacks are given as options when creating the gauge vs registering later which is very confusing.I would like to understand:
Environment
v1.21.0
andv1.26.0
Steps To Reproduce
I created two tests in
v1.21.0
both these test pass, in versionv1.23.0
andv1.26.0
the first test fails since only the first callback is registeredNote: it is possible the behaviour changes in
v1.22.0
, I couldn't get this version usinggo get
for some reasonExpected behavior
I would expect both tests to pass. Since the spec says
And I don't see anything in the spec as to why the 2nd callback should not be registered just because a gauge with the same name already exists. Did I miss something?
The text was updated successfully, but these errors were encountered: