Skip to content

Commit

Permalink
docs(metric): document public interfaces with versioning policy (#3441)
Browse files Browse the repository at this point in the history
* docs(metric): document public interfaces with versioning policy

* docs(metric): remove versioning policy warning from interfaces without public method(s)
  • Loading branch information
wisdommatt committed Nov 6, 2022
1 parent 6dccc07 commit 7707ce3
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions metric/instrument/asyncfloat64/asyncfloat64.go
Expand Up @@ -22,6 +22,8 @@ import (
)

// InstrumentProvider provides access to individual instruments.
//
// Warning: methods may be added to this interface in minor releases.
type InstrumentProvider interface {
// Counter creates an instrument for recording increasing values.
Counter(name string, opts ...instrument.Option) (Counter, error)
Expand All @@ -34,6 +36,8 @@ type InstrumentProvider interface {
}

// Counter is an instrument that records increasing values.
//
// Warning: methods may be added to this interface in minor releases.
type Counter interface {
// Observe records the state of the instrument to be x. Implementations
// will assume x to be the cumulative sum of the count.
Expand All @@ -47,6 +51,8 @@ type Counter interface {
}

// UpDownCounter is an instrument that records increasing or decreasing values.
//
// Warning: methods may be added to this interface in minor releases.
type UpDownCounter interface {
// Observe records the state of the instrument to be x. Implementations
// will assume x to be the cumulative sum of the count.
Expand All @@ -60,6 +66,8 @@ type UpDownCounter interface {
}

// Gauge is an instrument that records independent readings.
//
// Warning: methods may be added to this interface in minor releases.
type Gauge interface {
// Observe records the state of the instrument to be x.
//
Expand Down
8 changes: 8 additions & 0 deletions metric/instrument/asyncint64/asyncint64.go
Expand Up @@ -22,6 +22,8 @@ import (
)

// InstrumentProvider provides access to individual instruments.
//
// Warning: methods may be added to this interface in minor releases.
type InstrumentProvider interface {
// Counter creates an instrument for recording increasing values.
Counter(name string, opts ...instrument.Option) (Counter, error)
Expand All @@ -34,6 +36,8 @@ type InstrumentProvider interface {
}

// Counter is an instrument that records increasing values.
//
// Warning: methods may be added to this interface in minor releases.
type Counter interface {
// Observe records the state of the instrument to be x. Implementations
// will assume x to be the cumulative sum of the count.
Expand All @@ -47,6 +51,8 @@ type Counter interface {
}

// UpDownCounter is an instrument that records increasing or decreasing values.
//
// Warning: methods may be added to this interface in minor releases.
type UpDownCounter interface {
// Observe records the state of the instrument to be x. Implementations
// will assume x to be the cumulative sum of the count.
Expand All @@ -60,6 +66,8 @@ type UpDownCounter interface {
}

// Gauge is an instrument that records independent readings.
//
// Warning: methods may be added to this interface in minor releases.
type Gauge interface {
// Observe records the state of the instrument to be x.
//
Expand Down
8 changes: 8 additions & 0 deletions metric/instrument/syncfloat64/syncfloat64.go
Expand Up @@ -22,6 +22,8 @@ import (
)

// InstrumentProvider provides access to individual instruments.
//
// Warning: methods may be added to this interface in minor releases.
type InstrumentProvider interface {
// Counter creates an instrument for recording increasing values.
Counter(name string, opts ...instrument.Option) (Counter, error)
Expand All @@ -32,6 +34,8 @@ type InstrumentProvider interface {
}

// Counter is an instrument that records increasing values.
//
// Warning: methods may be added to this interface in minor releases.
type Counter interface {
// Add records a change to the counter.
Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
Expand All @@ -40,6 +44,8 @@ type Counter interface {
}

// UpDownCounter is an instrument that records increasing or decreasing values.
//
// Warning: methods may be added to this interface in minor releases.
type UpDownCounter interface {
// Add records a change to the counter.
Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
Expand All @@ -48,6 +54,8 @@ type UpDownCounter interface {
}

// Histogram is an instrument that records a distribution of values.
//
// Warning: methods may be added to this interface in minor releases.
type Histogram interface {
// Record adds an additional value to the distribution.
Record(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
Expand Down
8 changes: 8 additions & 0 deletions metric/instrument/syncint64/syncint64.go
Expand Up @@ -22,6 +22,8 @@ import (
)

// InstrumentProvider provides access to individual instruments.
//
// Warning: methods may be added to this interface in minor releases.
type InstrumentProvider interface {
// Counter creates an instrument for recording increasing values.
Counter(name string, opts ...instrument.Option) (Counter, error)
Expand All @@ -32,6 +34,8 @@ type InstrumentProvider interface {
}

// Counter is an instrument that records increasing values.
//
// Warning: methods may be added to this interface in minor releases.
type Counter interface {
// Add records a change to the counter.
Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
Expand All @@ -40,6 +44,8 @@ type Counter interface {
}

// UpDownCounter is an instrument that records increasing or decreasing values.
//
// Warning: methods may be added to this interface in minor releases.
type UpDownCounter interface {
// Add records a change to the counter.
Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
Expand All @@ -48,6 +54,8 @@ type UpDownCounter interface {
}

// Histogram is an instrument that records a distribution of values.
//
// Warning: methods may be added to this interface in minor releases.
type Histogram interface {
// Record adds an additional value to the distribution.
Record(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
Expand Down
4 changes: 4 additions & 0 deletions metric/meter.go
Expand Up @@ -26,6 +26,8 @@ import (

// MeterProvider provides access to named Meter instances, for instrumenting
// an application or library.
//
// Warning: methods may be added to this interface in minor releases.
type MeterProvider interface {
// Meter creates an instance of a `Meter` interface. The instrumentationName
// must be the name of the library providing instrumentation. This name may
Expand All @@ -36,6 +38,8 @@ type MeterProvider interface {
}

// Meter provides access to instrument instances for recording metrics.
//
// Warning: methods may be added to this interface in minor releases.
type Meter interface {
// AsyncInt64 is the namespace for the Asynchronous Integer instruments.
//
Expand Down

0 comments on commit 7707ce3

Please sign in to comment.