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
// Int64Option applies options to synchronous int64 instruments.
typeInt64Optioninterface {
applyInt64(Int64Config) Int64Config
}
There is no way to specify an option for a single instrument kind. There are changes to the OTel specification that are proposing such specificity may be needed: open-telemetry/opentelemetry-specification#3216
Proposal
Add options for each instrument.
This comes with the trade-off that the package API will have 12 additional option interfaces added to it and become cluttered.
Prior art
We decided to provide a span start and end options for similar reasons in the trace API.
The text was updated successfully, but these errors were encountered:
MrAlias
changed the title
Do instrument creation functions in metric API need their own options
Do instrument creation functions in metric API need their own options?
Mar 14, 2023
Currently the options for instrument creation are defined as ...
opentelemetry-go/metric/instrument/instrument.go
Lines 32 to 38 in 9b398a6
float64
Observer
sopentelemetry-go/metric/instrument/asyncfloat64.go
Lines 113 to 116 in 9b398a6
int64
Observer
sopentelemetry-go/metric/instrument/asyncint64.go
Lines 113 to 116 in 9b398a6
float64
synchronous instrumentsopentelemetry-go/metric/instrument/syncfloat64.go
Lines 82 to 85 in 9b398a6
in64
synchronous instrumentsopentelemetry-go/metric/instrument/syncint64.go
Lines 82 to 85 in 9b398a6
There is no way to specify an option for a single instrument kind. There are changes to the OTel specification that are proposing such specificity may be needed: open-telemetry/opentelemetry-specification#3216
Proposal
Add options for each instrument.
This comes with the trade-off that the package API will have 12 additional option interfaces added to it and become cluttered.
Prior art
We decided to provide a span start and end options for similar reasons in the trace API.
The text was updated successfully, but these errors were encountered: