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

Verify compliant metric API specification implementation: Compatibility #3381

Closed
2 tasks done
Tracked by #3383
MrAlias opened this issue Oct 20, 2022 · 3 comments
Closed
2 tasks done
Tracked by #3383
Assignees
Labels
area:metrics Part of OpenTelemetry Metrics pkg:API Related to an API package

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Oct 20, 2022

  • Identify all the normative requirements, recommendations, and options the specification defines as comments to this issue
  • Ensure the current metric API implementation is compliant with these normative requirements, recommendations, and options in those comments.
@MrAlias MrAlias added area:metrics Part of OpenTelemetry Metrics pkg:API Related to an API package labels Oct 20, 2022
@MrAlias MrAlias self-assigned this Jan 7, 2023
@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 9, 2023

All the metrics components SHOULD allow new APIs to be added to existing components without introducing breaking changes.

The term components is under-specified. I'm guessing this means that new method need to be able to be added to exported interfaces. This is something which we have documented as being a possibility1 and therefore we comply with this suggestion.

Footnotes

  1. https://github.com/open-telemetry/opentelemetry-go/pull/3441

@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 9, 2023

All the metrics APIs SHOULD allow optional parameter(s) to be added to existing APIs without introducing breaking changes, if possible.

Our methods use variadic option parameters to support this.

Meter(instrumentationName string, opts ...MeterOption) Meter

Int64Counter(name string, options ...instrument.Int64Option) (syncint64.Counter, error)
// Int64UpDownCounter returns a new instrument identified by name and
// configured with options. The instrument is used to synchronously record
// int64 measurements during a computational operation.
Int64UpDownCounter(name string, options ...instrument.Int64Option) (syncint64.UpDownCounter, error)
// Int64Histogram returns a new instrument identified by name and
// configured with options. The instrument is used to synchronously record
// the distribution of int64 measurements during a computational operation.
Int64Histogram(name string, options ...instrument.Int64Option) (syncint64.Histogram, error)
// Int64ObservableCounter returns a new instrument identified by name and
// configured with options. The instrument is used to asynchronously record
// increasing int64 measurements once per a measurement collection cycle.
Int64ObservableCounter(name string, options ...instrument.Int64ObserverOption) (asyncint64.Counter, error)
// Int64ObservableUpDownCounter returns a new instrument identified by name
// and configured with options. The instrument is used to asynchronously
// record int64 measurements once per a measurement collection cycle.
Int64ObservableUpDownCounter(name string, options ...instrument.Int64ObserverOption) (asyncint64.UpDownCounter, error)
// Int64ObservableGauge returns a new instrument identified by name and
// configured with options. The instrument is used to asynchronously record
// instantaneous int64 measurements once per a measurement collection
// cycle.
Int64ObservableGauge(name string, options ...instrument.Int64ObserverOption) (asyncint64.Gauge, error)
// Float64Counter returns a new instrument identified by name and
// configured with options. The instrument is used to synchronously record
// increasing float64 measurements during a computational operation.
Float64Counter(name string, options ...instrument.Float64Option) (syncfloat64.Counter, error)
// Float64UpDownCounter returns a new instrument identified by name and
// configured with options. The instrument is used to synchronously record
// float64 measurements during a computational operation.
Float64UpDownCounter(name string, options ...instrument.Float64Option) (syncfloat64.UpDownCounter, error)
// Float64Histogram returns a new instrument identified by name and
// configured with options. The instrument is used to synchronously record
// the distribution of float64 measurements during a computational
// operation.
Float64Histogram(name string, options ...instrument.Float64Option) (syncfloat64.Histogram, error)
// Float64ObservableCounter returns a new instrument identified by name and
// configured with options. The instrument is used to asynchronously record
// increasing float64 measurements once per a measurement collection cycle.
Float64ObservableCounter(name string, options ...instrument.Float64ObserverOption) (asyncfloat64.Counter, error)
// Float64ObservableUpDownCounter returns a new instrument identified by
// name and configured with options. The instrument is used to
// asynchronously record float64 measurements once per a measurement
// collection cycle.
Float64ObservableUpDownCounter(name string, options ...instrument.Float64ObserverOption) (asyncfloat64.UpDownCounter, error)
// Float64ObservableGauge returns a new instrument identified by name and
// configured with options. The instrument is used to asynchronously record
// instantaneous float64 measurements once per a measurement collection
// cycle.
Float64ObservableGauge(name string, options ...instrument.Float64ObserverOption) (asyncfloat64.Gauge, error)

@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 9, 2023

Every normative clause from this section of the v1.16.0 specification has been identified and our API has been validated that it complies. Closing.

@MrAlias MrAlias closed this as completed Jan 9, 2023
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 pkg:API Related to an API package
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant