1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-30 04:40:41 +02:00

Document how to pass attributes for all record methods (#4058)

* Document how to pass attributes for all record methods

* Update based on feedback
This commit is contained in:
Tyler Yahn 2023-05-09 08:07:39 -07:00 committed by GitHub
parent 6f045478c9
commit 02c0001307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 8 deletions

View File

@ -217,7 +217,10 @@ type Float64Observer interface {
embedded.Float64Observer
// Observe records the float64 value.
Observe(value float64, opts ...ObserveOption)
//
// Use the WithAttributeSet (or, if performance is not a concern,
// the WithAttributes) option to include measurement attributes.
Observe(value float64, options ...ObserveOption)
}
// Float64Callback is a function registered with a Meter that makes

View File

@ -216,7 +216,10 @@ type Int64Observer interface {
embedded.Int64Observer
// Observe records the int64 value.
Observe(value int64, opts ...ObserveOption)
//
// Use the WithAttributeSet (or, if performance is not a concern,
// the WithAttributes) option to include measurement attributes.
Observe(value int64, options ...ObserveOption)
}
// Int64Callback is a function registered with a Meter that makes observations

View File

@ -32,7 +32,10 @@ type Float64Counter interface {
embedded.Float64Counter
// Add records a change to the counter.
Add(ctx context.Context, incr float64, opts ...AddOption)
//
// Use the WithAttributeSet (or, if performance is not a concern,
// the WithAttributes) option to include measurement attributes.
Add(ctx context.Context, incr float64, options ...AddOption)
}
// Float64CounterConfig contains options for synchronous counter instruments that
@ -82,7 +85,10 @@ type Float64UpDownCounter interface {
embedded.Float64UpDownCounter
// Add records a change to the counter.
Add(ctx context.Context, incr float64, opts ...AddOption)
//
// Use the WithAttributeSet (or, if performance is not a concern,
// the WithAttributes) option to include measurement attributes.
Add(ctx context.Context, incr float64, options ...AddOption)
}
// Float64UpDownCounterConfig contains options for synchronous counter
@ -132,7 +138,10 @@ type Float64Histogram interface {
embedded.Float64Histogram
// Record adds an additional value to the distribution.
Record(ctx context.Context, incr float64, opts ...RecordOption)
//
// Use the WithAttributeSet (or, if performance is not a concern,
// the WithAttributes) option to include measurement attributes.
Record(ctx context.Context, incr float64, options ...RecordOption)
}
// Float64HistogramConfig contains options for synchronous counter instruments

View File

@ -32,7 +32,10 @@ type Int64Counter interface {
embedded.Int64Counter
// Add records a change to the counter.
Add(ctx context.Context, incr int64, opts ...AddOption)
//
// Use the WithAttributeSet (or, if performance is not a concern,
// the WithAttributes) option to include measurement attributes.
Add(ctx context.Context, incr int64, options ...AddOption)
}
// Int64CounterConfig contains options for synchronous counter instruments that
@ -82,7 +85,10 @@ type Int64UpDownCounter interface {
embedded.Int64UpDownCounter
// Add records a change to the counter.
Add(ctx context.Context, incr int64, opts ...AddOption)
//
// Use the WithAttributeSet (or, if performance is not a concern,
// the WithAttributes) option to include measurement attributes.
Add(ctx context.Context, incr int64, options ...AddOption)
}
// Int64UpDownCounterConfig contains options for synchronous counter
@ -132,7 +138,10 @@ type Int64Histogram interface {
embedded.Int64Histogram
// Record adds an additional value to the distribution.
Record(ctx context.Context, incr int64, opts ...RecordOption)
//
// Use the WithAttributeSet (or, if performance is not a concern,
// the WithAttributes) option to include measurement attributes.
Record(ctx context.Context, incr int64, options ...RecordOption)
}
// Int64HistogramConfig contains options for synchronous counter instruments