Skip to content

Commit

Permalink
Merge branch 'main' into semconv-v1.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias authored May 8, 2023
2 parents 8c8d023 + 476d00a commit 98fd722
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 58 deletions.
40 changes: 25 additions & 15 deletions metric/asyncfloat64.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ type Float64Observable interface {
// assumed the to be the cumulative sum of the count.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// package documentation on API implementation for information on how to set
// default behavior for
// unimplemented methods.
type Float64ObservableCounter interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Float64ObservableCounter

Float64Observable
Expand Down Expand Up @@ -80,8 +83,9 @@ func (c Float64ObservableCounterConfig) Callbacks() []Float64Callback {
}

// Float64ObservableCounterOption applies options to a
// [Float64ObservableCounterConfig]. See [Float64ObservableOption] and [Option]
// for other options that can be used as a Float64ObservableCounterOption.
// [Float64ObservableCounterConfig]. See [Float64ObservableOption] and
// [InstrumentOption] for other options that can be used as a
// Float64ObservableCounterOption.
type Float64ObservableCounterOption interface {
applyFloat64ObservableCounter(Float64ObservableCounterConfig) Float64ObservableCounterConfig
}
Expand All @@ -92,10 +96,12 @@ type Float64ObservableCounterOption interface {
// the to be the cumulative sum of the count.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Float64ObservableUpDownCounter interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Float64ObservableUpDownCounter

Float64Observable
Expand Down Expand Up @@ -136,7 +142,7 @@ func (c Float64ObservableUpDownCounterConfig) Callbacks() []Float64Callback {

// Float64ObservableUpDownCounterOption applies options to a
// [Float64ObservableUpDownCounterConfig]. See [Float64ObservableOption] and
// [Option] for other options that can be used as a
// [InstrumentOption] for other options that can be used as a
// Float64ObservableUpDownCounterOption.
type Float64ObservableUpDownCounterOption interface {
applyFloat64ObservableUpDownCounter(Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig
Expand All @@ -147,10 +153,12 @@ type Float64ObservableUpDownCounterOption interface {
// are only made within a callback for this instrument.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Float64ObservableGauge interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Float64ObservableGauge

Float64Observable
Expand Down Expand Up @@ -191,7 +199,7 @@ func (c Float64ObservableGaugeConfig) Callbacks() []Float64Callback {

// Float64ObservableGaugeOption applies options to a
// [Float64ObservableGaugeConfig]. See [Float64ObservableOption] and
// [Option] for other options that can be used as a
// [InstrumentOption] for other options that can be used as a
// Float64ObservableGaugeOption.
type Float64ObservableGaugeOption interface {
applyFloat64ObservableGauge(Float64ObservableGaugeConfig) Float64ObservableGaugeConfig
Expand All @@ -200,10 +208,12 @@ type Float64ObservableGaugeOption interface {
// Float64Observer is a recorder of float64 measurements.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Float64Observer interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Float64Observer

// Observe records the float64 value.
Expand Down
44 changes: 27 additions & 17 deletions metric/asyncint64.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ type Int64Observable interface {
// assumed the to be the cumulative sum of the count.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Int64ObservableCounter interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Int64ObservableCounter

Int64Observable
Expand Down Expand Up @@ -80,8 +82,9 @@ func (c Int64ObservableCounterConfig) Callbacks() []Int64Callback {
}

// Int64ObservableCounterOption applies options to a
// [Int64ObservableCounterConfig]. See [Int64ObservableOption] and [Option] for
// other options that can be used as an Int64ObservableCounterOption.
// [Int64ObservableCounterConfig]. See [Int64ObservableOption] and
// [InstrumentOption] for other options that can be used as an
// Int64ObservableCounterOption.
type Int64ObservableCounterOption interface {
applyInt64ObservableCounter(Int64ObservableCounterConfig) Int64ObservableCounterConfig
}
Expand All @@ -92,10 +95,12 @@ type Int64ObservableCounterOption interface {
// be the cumulative sum of the count.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Int64ObservableUpDownCounter interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Int64ObservableUpDownCounter

Int64Observable
Expand Down Expand Up @@ -136,7 +141,7 @@ func (c Int64ObservableUpDownCounterConfig) Callbacks() []Int64Callback {

// Int64ObservableUpDownCounterOption applies options to a
// [Int64ObservableUpDownCounterConfig]. See [Int64ObservableOption] and
// [Option] for other options that can be used as an
// [InstrumentOption] for other options that can be used as an
// Int64ObservableUpDownCounterOption.
type Int64ObservableUpDownCounterOption interface {
applyInt64ObservableUpDownCounter(Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig
Expand All @@ -147,10 +152,12 @@ type Int64ObservableUpDownCounterOption interface {
// only made within a callback for this instrument.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Int64ObservableGauge interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Int64ObservableGauge

Int64Observable
Expand Down Expand Up @@ -190,19 +197,22 @@ func (c Int64ObservableGaugeConfig) Callbacks() []Int64Callback {
}

// Int64ObservableGaugeOption applies options to a
// [Int64ObservableGaugeConfig]. See [Int64ObservableOption] and [Option] for
// other options that can be used as an Int64ObservableGaugeOption.
// [Int64ObservableGaugeConfig]. See [Int64ObservableOption] and
// [InstrumentOption] for other options that can be used as an
// Int64ObservableGaugeOption.
type Int64ObservableGaugeOption interface {
applyInt64ObservableGauge(Int64ObservableGaugeConfig) Int64ObservableGaugeConfig
}

// Int64Observer is a recorder of int64 measurements.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Int64Observer interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Int64Observer

// Observe records the int64 value.
Expand Down
12 changes: 12 additions & 0 deletions metric/meter.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import (
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type MeterProvider interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.MeterProvider

// Meter returns a new Meter with the provided name and configuration.
Expand All @@ -47,6 +50,9 @@ type MeterProvider interface {
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Meter interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Meter

// Int64Counter returns a new instrument identified by name and configured
Expand Down Expand Up @@ -137,6 +143,9 @@ type Callback func(context.Context, Observer) error
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Observer interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Observer

// ObserveFloat64 records the float64 value for obsrv.
Expand All @@ -152,6 +161,9 @@ type Observer interface {
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Registration interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Registration

// Unregister removes the callback registration from a Meter.
Expand Down
34 changes: 21 additions & 13 deletions metric/syncfloat64.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import (
// Float64Counter is an instrument that records increasing float64 values.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Float64Counter interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Float64Counter

// Add records a change to the counter.
Expand Down Expand Up @@ -61,7 +63,8 @@ func (c Float64CounterConfig) Unit() string {
}

// Float64CounterOption applies options to a [Float64CounterConfig]. See
// [Option] for other options that can be used as a Float64CounterOption.
// [InstrumentOption] for other options that can be used as a
// Float64CounterOption.
type Float64CounterOption interface {
applyFloat64Counter(Float64CounterConfig) Float64CounterConfig
}
Expand All @@ -70,10 +73,12 @@ type Float64CounterOption interface {
// float64 values.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Float64UpDownCounter interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Float64UpDownCounter

// Add records a change to the counter.
Expand Down Expand Up @@ -108,8 +113,8 @@ func (c Float64UpDownCounterConfig) Unit() string {
}

// Float64UpDownCounterOption applies options to a
// [Float64UpDownCounterConfig]. See [Option] for other options that can be
// used as a Float64UpDownCounterOption.
// [Float64UpDownCounterConfig]. See [InstrumentOption] for other options that
// can be used as a Float64UpDownCounterOption.
type Float64UpDownCounterOption interface {
applyFloat64UpDownCounter(Float64UpDownCounterConfig) Float64UpDownCounterConfig
}
Expand All @@ -118,10 +123,12 @@ type Float64UpDownCounterOption interface {
// values.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Float64Histogram interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Float64Histogram

// Record adds an additional value to the distribution.
Expand Down Expand Up @@ -156,7 +163,8 @@ func (c Float64HistogramConfig) Unit() string {
}

// Float64HistogramOption applies options to a [Float64HistogramConfig]. See
// [Option] for other options that can be used as a Float64HistogramOption.
// [InstrumentOption] for other options that can be used as a
// Float64HistogramOption.
type Float64HistogramOption interface {
applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig
}
34 changes: 21 additions & 13 deletions metric/syncint64.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import (
// Int64Counter is an instrument that records increasing int64 values.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Int64Counter interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Int64Counter

// Add records a change to the counter.
Expand Down Expand Up @@ -60,8 +62,9 @@ func (c Int64CounterConfig) Unit() string {
return c.unit
}

// Int64CounterOption applies options to a [Int64CounterConfig]. See [Option]
// for other options that can be used as an Int64CounterOption.
// Int64CounterOption applies options to a [Int64CounterConfig]. See
// [InstrumentOption] for other options that can be used as an
// Int64CounterOption.
type Int64CounterOption interface {
applyInt64Counter(Int64CounterConfig) Int64CounterConfig
}
Expand All @@ -70,10 +73,12 @@ type Int64CounterOption interface {
// int64 values.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Int64UpDownCounter interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Int64UpDownCounter

// Add records a change to the counter.
Expand Down Expand Up @@ -108,7 +113,7 @@ func (c Int64UpDownCounterConfig) Unit() string {
}

// Int64UpDownCounterOption applies options to a [Int64UpDownCounterConfig].
// See [Option] for other options that can be used as an
// See [InstrumentOption] for other options that can be used as an
// Int64UpDownCounterOption.
type Int64UpDownCounterOption interface {
applyInt64UpDownCounter(Int64UpDownCounterConfig) Int64UpDownCounterConfig
Expand All @@ -118,10 +123,12 @@ type Int64UpDownCounterOption interface {
// values.
//
// Warning: Methods may be added to this interface in minor releases. See
// [go.opentelemetry.io/otel/metric] package documentation on API
// implementation for information on how to set default behavior for
// unimplemented methods.
// package documentation on API implementation for information on how to set
// default behavior for unimplemented methods.
type Int64Histogram interface {
// Users of the interface can ignore this. This embedded type is only used
// by implementations of this interface. See the "API Implementations"
// section of the package documentation for more information.
embedded.Int64Histogram

// Record adds an additional value to the distribution.
Expand Down Expand Up @@ -156,7 +163,8 @@ func (c Int64HistogramConfig) Unit() string {
}

// Int64HistogramOption applies options to a [Int64HistogramConfig]. See
// [Option] for other options that can be used as an Int64HistogramOption.
// [InstrumentOption] for other options that can be used as an
// Int64HistogramOption.
type Int64HistogramOption interface {
applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig
}

0 comments on commit 98fd722

Please sign in to comment.