mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-01 13:13:32 -06:00
[bugfix] Downstep otel to fix freebsd compile issue (#1773)
https://github.com/open-telemetry/opentelemetry-go/issues/4076
This commit is contained in:
parent
ec325fee14
commit
b47661f033
70 changed files with 1097 additions and 3138 deletions
130
vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64.go
generated
vendored
Normal file
130
vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64.go
generated
vendored
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package instrument // import "go.opentelemetry.io/otel/metric/instrument"
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
)
|
||||
|
||||
// Float64Observable describes a set of instruments used asynchronously to
|
||||
// record float64 measurements once per collection cycle. Observations of
|
||||
// these instruments are only made within a callback.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Float64Observable interface {
|
||||
Asynchronous
|
||||
|
||||
float64Observable()
|
||||
}
|
||||
|
||||
// Float64ObservableCounter is an instrument used to asynchronously record
|
||||
// increasing float64 measurements once per collection cycle. Observations are
|
||||
// only made within a callback for this instrument. The value observed is
|
||||
// assumed the to be the cumulative sum of the count.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Float64ObservableCounter interface{ Float64Observable }
|
||||
|
||||
// Float64ObservableUpDownCounter is an instrument used to asynchronously
|
||||
// record float64 measurements once per collection cycle. Observations are only
|
||||
// made within a callback for this instrument. The value observed is assumed
|
||||
// the to be the cumulative sum of the count.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Float64ObservableUpDownCounter interface{ Float64Observable }
|
||||
|
||||
// Float64ObservableGauge is an instrument used to asynchronously record
|
||||
// instantaneous float64 measurements once per collection cycle. Observations
|
||||
// are only made within a callback for this instrument.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Float64ObservableGauge interface{ Float64Observable }
|
||||
|
||||
// Float64Observer is a recorder of float64 measurements.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Float64Observer interface {
|
||||
Observe(value float64, attributes ...attribute.KeyValue)
|
||||
}
|
||||
|
||||
// Float64Callback is a function registered with a Meter that makes
|
||||
// observations for a Float64Observerable instrument it is registered with.
|
||||
// Calls to the Float64Observer record measurement values for the
|
||||
// Float64Observable.
|
||||
//
|
||||
// The function needs to complete in a finite amount of time and the deadline
|
||||
// of the passed context is expected to be honored.
|
||||
//
|
||||
// The function needs to make unique observations across all registered
|
||||
// Float64Callbacks. Meaning, it should not report measurements with the same
|
||||
// attributes as another Float64Callbacks also registered for the same
|
||||
// instrument.
|
||||
//
|
||||
// The function needs to be concurrent safe.
|
||||
type Float64Callback func(context.Context, Float64Observer) error
|
||||
|
||||
// Float64ObserverConfig contains options for Asynchronous instruments that
|
||||
// observe float64 values.
|
||||
type Float64ObserverConfig struct {
|
||||
description string
|
||||
unit string
|
||||
callbacks []Float64Callback
|
||||
}
|
||||
|
||||
// NewFloat64ObserverConfig returns a new Float64ObserverConfig with all opts
|
||||
// applied.
|
||||
func NewFloat64ObserverConfig(opts ...Float64ObserverOption) Float64ObserverConfig {
|
||||
var config Float64ObserverConfig
|
||||
for _, o := range opts {
|
||||
config = o.applyFloat64Observer(config)
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
// Description returns the Config description.
|
||||
func (c Float64ObserverConfig) Description() string {
|
||||
return c.description
|
||||
}
|
||||
|
||||
// Unit returns the Config unit.
|
||||
func (c Float64ObserverConfig) Unit() string {
|
||||
return c.unit
|
||||
}
|
||||
|
||||
// Callbacks returns the Config callbacks.
|
||||
func (c Float64ObserverConfig) Callbacks() []Float64Callback {
|
||||
return c.callbacks
|
||||
}
|
||||
|
||||
// Float64ObserverOption applies options to float64 Observer instruments.
|
||||
type Float64ObserverOption interface {
|
||||
applyFloat64Observer(Float64ObserverConfig) Float64ObserverConfig
|
||||
}
|
||||
|
||||
type float64ObserverOptionFunc func(Float64ObserverConfig) Float64ObserverConfig
|
||||
|
||||
func (fn float64ObserverOptionFunc) applyFloat64Observer(cfg Float64ObserverConfig) Float64ObserverConfig {
|
||||
return fn(cfg)
|
||||
}
|
||||
|
||||
// WithFloat64Callback adds callback to be called for an instrument.
|
||||
func WithFloat64Callback(callback Float64Callback) Float64ObserverOption {
|
||||
return float64ObserverOptionFunc(func(cfg Float64ObserverConfig) Float64ObserverConfig {
|
||||
cfg.callbacks = append(cfg.callbacks, callback)
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
130
vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64.go
generated
vendored
Normal file
130
vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64.go
generated
vendored
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package instrument // import "go.opentelemetry.io/otel/metric/instrument"
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
)
|
||||
|
||||
// Int64Observable describes a set of instruments used asynchronously to record
|
||||
// int64 measurements once per collection cycle. Observations of these
|
||||
// instruments are only made within a callback.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Int64Observable interface {
|
||||
Asynchronous
|
||||
|
||||
int64Observable()
|
||||
}
|
||||
|
||||
// Int64ObservableCounter is an instrument used to asynchronously record
|
||||
// increasing int64 measurements once per collection cycle. Observations are
|
||||
// only made within a callback for this instrument. The value observed is
|
||||
// assumed the to be the cumulative sum of the count.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Int64ObservableCounter interface{ Int64Observable }
|
||||
|
||||
// Int64ObservableUpDownCounter is an instrument used to asynchronously record
|
||||
// int64 measurements once per collection cycle. Observations are only made
|
||||
// within a callback for this instrument. The value observed is assumed the to
|
||||
// be the cumulative sum of the count.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Int64ObservableUpDownCounter interface{ Int64Observable }
|
||||
|
||||
// Int64ObservableGauge is an instrument used to asynchronously record
|
||||
// instantaneous int64 measurements once per collection cycle. Observations are
|
||||
// only made within a callback for this instrument.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Int64ObservableGauge interface{ Int64Observable }
|
||||
|
||||
// Int64Observer is a recorder of int64 measurements.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Int64Observer interface {
|
||||
Observe(value int64, attributes ...attribute.KeyValue)
|
||||
}
|
||||
|
||||
// Int64Callback is a function registered with a Meter that makes
|
||||
// observations for a Int64Observerable instrument it is registered with.
|
||||
// Calls to the Int64Observer record measurement values for the
|
||||
// Int64Observable.
|
||||
//
|
||||
// The function needs to complete in a finite amount of time and the deadline
|
||||
// of the passed context is expected to be honored.
|
||||
//
|
||||
// The function needs to make unique observations across all registered
|
||||
// Int64Callback. Meaning, it should not report measurements with the same
|
||||
// attributes as another Int64Callbacks also registered for the same
|
||||
// instrument.
|
||||
//
|
||||
// The function needs to be concurrent safe.
|
||||
type Int64Callback func(context.Context, Int64Observer) error
|
||||
|
||||
// Int64ObserverConfig contains options for Asynchronous instruments that
|
||||
// observe int64 values.
|
||||
type Int64ObserverConfig struct {
|
||||
description string
|
||||
unit string
|
||||
callbacks []Int64Callback
|
||||
}
|
||||
|
||||
// NewInt64ObserverConfig returns a new Int64ObserverConfig with all opts
|
||||
// applied.
|
||||
func NewInt64ObserverConfig(opts ...Int64ObserverOption) Int64ObserverConfig {
|
||||
var config Int64ObserverConfig
|
||||
for _, o := range opts {
|
||||
config = o.applyInt64Observer(config)
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
// Description returns the Config description.
|
||||
func (c Int64ObserverConfig) Description() string {
|
||||
return c.description
|
||||
}
|
||||
|
||||
// Unit returns the Config unit.
|
||||
func (c Int64ObserverConfig) Unit() string {
|
||||
return c.unit
|
||||
}
|
||||
|
||||
// Callbacks returns the Config callbacks.
|
||||
func (c Int64ObserverConfig) Callbacks() []Int64Callback {
|
||||
return c.callbacks
|
||||
}
|
||||
|
||||
// Int64ObserverOption applies options to int64 Observer instruments.
|
||||
type Int64ObserverOption interface {
|
||||
applyInt64Observer(Int64ObserverConfig) Int64ObserverConfig
|
||||
}
|
||||
|
||||
type int64ObserverOptionFunc func(Int64ObserverConfig) Int64ObserverConfig
|
||||
|
||||
func (fn int64ObserverOptionFunc) applyInt64Observer(cfg Int64ObserverConfig) Int64ObserverConfig {
|
||||
return fn(cfg)
|
||||
}
|
||||
|
||||
// WithInt64Callback adds callback to be called for an instrument.
|
||||
func WithInt64Callback(callback Int64Callback) Int64ObserverOption {
|
||||
return int64ObserverOptionFunc(func(cfg Int64ObserverConfig) Int64ObserverConfig {
|
||||
cfg.callbacks = append(cfg.callbacks, callback)
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
452
vendor/go.opentelemetry.io/otel/metric/instrument/deprecation.go
generated
vendored
452
vendor/go.opentelemetry.io/otel/metric/instrument/deprecation.go
generated
vendored
|
|
@ -1,452 +0,0 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package instrument provides the OpenTelemetry API instruments used to make
|
||||
// measurements.
|
||||
//
|
||||
// Deprecated: Use go.opentelemetry.io/otel/metric instead.
|
||||
package instrument // import "go.opentelemetry.io/otel/metric/instrument"
|
||||
|
||||
import (
|
||||
"go.opentelemetry.io/otel/metric"
|
||||
)
|
||||
|
||||
// Float64Observable is an alias for [metric.Float64Observable].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64Observable] instead.
|
||||
type Float64Observable metric.Float64Observable
|
||||
|
||||
// Float64ObservableCounter is an alias for [metric.Float64ObservableCounter].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableCounter] instead.
|
||||
type Float64ObservableCounter metric.Float64ObservableCounter
|
||||
|
||||
// Float64ObservableCounterConfig is an alias for
|
||||
// [metric.Float64ObservableCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableCounterConfig] instead.
|
||||
type Float64ObservableCounterConfig metric.Float64ObservableCounterConfig
|
||||
|
||||
// NewFloat64ObservableCounterConfig wraps
|
||||
// [metric.NewFloat64ObservableCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewFloat64ObservableCounterConfig] instead.
|
||||
func NewFloat64ObservableCounterConfig(opts ...Float64ObservableCounterOption) Float64ObservableCounterConfig {
|
||||
o := make([]metric.Float64ObservableCounterOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Float64ObservableCounterOption(opts[i])
|
||||
}
|
||||
c := metric.NewFloat64ObservableCounterConfig(o...)
|
||||
return Float64ObservableCounterConfig(c)
|
||||
}
|
||||
|
||||
// Float64ObservableCounterOption is an alias for
|
||||
// [metric.Float64ObservableCounterOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableCounterOption] instead.
|
||||
type Float64ObservableCounterOption metric.Float64ObservableCounterOption
|
||||
|
||||
// Float64ObservableUpDownCounter is an alias for
|
||||
// [metric.Float64ObservableUpDownCounter].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableUpDownCounter] instead.
|
||||
type Float64ObservableUpDownCounter metric.Float64ObservableUpDownCounter
|
||||
|
||||
// Float64ObservableUpDownCounterConfig is an alias for
|
||||
// [metric.Float64ObservableUpDownCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableUpDownCounterConfig] instead.
|
||||
type Float64ObservableUpDownCounterConfig metric.Float64ObservableUpDownCounterConfig
|
||||
|
||||
// NewFloat64ObservableUpDownCounterConfig wraps
|
||||
// [metric.NewFloat64ObservableUpDownCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewFloat64ObservableUpDownCounterConfig] instead.
|
||||
func NewFloat64ObservableUpDownCounterConfig(opts ...Float64ObservableUpDownCounterOption) Float64ObservableUpDownCounterConfig {
|
||||
o := make([]metric.Float64ObservableUpDownCounterOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Float64ObservableUpDownCounterOption(opts[i])
|
||||
}
|
||||
c := metric.NewFloat64ObservableUpDownCounterConfig(o...)
|
||||
return Float64ObservableUpDownCounterConfig(c)
|
||||
}
|
||||
|
||||
// Float64ObservableUpDownCounterOption is an alias for
|
||||
// [metric.Float64ObservableUpDownCounterOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableUpDownCounterOption] instead.
|
||||
type Float64ObservableUpDownCounterOption metric.Float64ObservableUpDownCounterOption
|
||||
|
||||
// Float64ObservableGauge is an alias for [metric.Float64ObservableGauge].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableGauge] instead.
|
||||
type Float64ObservableGauge metric.Float64ObservableGauge
|
||||
|
||||
// Float64ObservableGaugeConfig is an alias for
|
||||
// [metric.Float64ObservableGaugeConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableGaugeConfig] instead.
|
||||
type Float64ObservableGaugeConfig metric.Float64ObservableGaugeConfig
|
||||
|
||||
// NewFloat64ObservableGaugeConfig wraps
|
||||
// [metric.NewFloat64ObservableGaugeConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewFloat64ObservableGaugeConfig] instead.
|
||||
func NewFloat64ObservableGaugeConfig(opts ...Float64ObservableGaugeOption) Float64ObservableGaugeConfig {
|
||||
o := make([]metric.Float64ObservableGaugeOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Float64ObservableGaugeOption(opts[i])
|
||||
}
|
||||
c := metric.NewFloat64ObservableGaugeConfig(o...)
|
||||
return Float64ObservableGaugeConfig(c)
|
||||
}
|
||||
|
||||
// Float64ObservableGaugeOption is an alias for
|
||||
// [metric.Float64ObservableGaugeOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableGaugeOption] instead.
|
||||
type Float64ObservableGaugeOption metric.Float64ObservableGaugeOption
|
||||
|
||||
// Float64Observer is an alias for [metric.Float64Observer].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64Observer] instead.
|
||||
type Float64Observer metric.Float64Observer
|
||||
|
||||
// Float64Callback is an alias for [metric.Float64Callback].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64Callback] instead.
|
||||
type Float64Callback metric.Float64Callback
|
||||
|
||||
// Float64ObservableOption is an alias for [metric.Float64ObservableOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64ObservableOption] instead.
|
||||
type Float64ObservableOption metric.Float64ObservableOption
|
||||
|
||||
// WithFloat64Callback wraps [metric.WithFloat64Callback].
|
||||
//
|
||||
// Deprecated: Use [metric.WithFloat64Callback] instead.
|
||||
func WithFloat64Callback(callback Float64Callback) Float64ObservableOption {
|
||||
cback := metric.Float64Callback(callback)
|
||||
opt := metric.WithFloat64Callback(cback)
|
||||
return Float64ObservableOption(opt)
|
||||
}
|
||||
|
||||
// Int64Observable is an alias for [metric.Int64Observable].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64Observable] instead.
|
||||
type Int64Observable metric.Int64Observable
|
||||
|
||||
// Int64ObservableCounter is an alias for [metric.Int64ObservableCounter].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableCounter] instead.
|
||||
type Int64ObservableCounter metric.Int64ObservableCounter
|
||||
|
||||
// Int64ObservableCounterConfig is an alias for
|
||||
// [metric.Int64ObservableCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableCounterConfig] instead.
|
||||
type Int64ObservableCounterConfig metric.Int64ObservableCounterConfig
|
||||
|
||||
// NewInt64ObservableCounterConfig wraps
|
||||
// [metric.NewInt64ObservableCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewInt64ObservableCounterConfig] instead.
|
||||
func NewInt64ObservableCounterConfig(opts ...Int64ObservableCounterOption) Int64ObservableCounterConfig {
|
||||
o := make([]metric.Int64ObservableCounterOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Int64ObservableCounterOption(opts[i])
|
||||
}
|
||||
c := metric.NewInt64ObservableCounterConfig(o...)
|
||||
return Int64ObservableCounterConfig(c)
|
||||
}
|
||||
|
||||
// Int64ObservableCounterOption is an alias for
|
||||
// [metric.Int64ObservableCounterOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableCounterOption] instead.
|
||||
type Int64ObservableCounterOption metric.Int64ObservableCounterOption
|
||||
|
||||
// Int64ObservableUpDownCounter is an alias for
|
||||
// [metric.Int64ObservableUpDownCounter].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableUpDownCounter] instead.
|
||||
type Int64ObservableUpDownCounter metric.Int64ObservableUpDownCounter
|
||||
|
||||
// Int64ObservableUpDownCounterConfig is an alias for
|
||||
// [metric.Int64ObservableUpDownCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableUpDownCounterConfig] instead.
|
||||
type Int64ObservableUpDownCounterConfig metric.Int64ObservableUpDownCounterConfig
|
||||
|
||||
// NewInt64ObservableUpDownCounterConfig wraps
|
||||
// [metric.NewInt64ObservableUpDownCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewInt64ObservableUpDownCounterConfig] instead.
|
||||
func NewInt64ObservableUpDownCounterConfig(opts ...Int64ObservableUpDownCounterOption) Int64ObservableUpDownCounterConfig {
|
||||
o := make([]metric.Int64ObservableUpDownCounterOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Int64ObservableUpDownCounterOption(opts[i])
|
||||
}
|
||||
c := metric.NewInt64ObservableUpDownCounterConfig(o...)
|
||||
return Int64ObservableUpDownCounterConfig(c)
|
||||
}
|
||||
|
||||
// Int64ObservableUpDownCounterOption is an alias for
|
||||
// [metric.Int64ObservableUpDownCounterOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableUpDownCounterOption] instead.
|
||||
type Int64ObservableUpDownCounterOption metric.Int64ObservableUpDownCounterOption
|
||||
|
||||
// Int64ObservableGauge is an alias for [metric.Int64ObservableGauge].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableGauge] instead.
|
||||
type Int64ObservableGauge metric.Int64ObservableGauge
|
||||
|
||||
// Int64ObservableGaugeConfig is an alias for
|
||||
// [metric.Int64ObservableGaugeConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableGaugeConfig] instead.
|
||||
type Int64ObservableGaugeConfig metric.Int64ObservableGaugeConfig
|
||||
|
||||
// NewInt64ObservableGaugeConfig wraps [metric.NewInt64ObservableGaugeConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewInt64ObservableGaugeConfig] instead.
|
||||
func NewInt64ObservableGaugeConfig(opts ...Int64ObservableGaugeOption) Int64ObservableGaugeConfig {
|
||||
o := make([]metric.Int64ObservableGaugeOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Int64ObservableGaugeOption(opts[i])
|
||||
}
|
||||
c := metric.NewInt64ObservableGaugeConfig(o...)
|
||||
return Int64ObservableGaugeConfig(c)
|
||||
}
|
||||
|
||||
// Int64ObservableGaugeOption is an alias for
|
||||
// [metric.Int64ObservableGaugeOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableGaugeOption] instead.
|
||||
type Int64ObservableGaugeOption metric.Int64ObservableGaugeOption
|
||||
|
||||
// Int64Observer is an alias for [metric.Int64Observer].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64Observer] instead.
|
||||
type Int64Observer metric.Int64Observer
|
||||
|
||||
// Int64Callback is an alias for [metric.Int64Callback].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64Callback] instead.
|
||||
type Int64Callback metric.Int64Callback
|
||||
|
||||
// Int64ObservableOption is an alias for [metric.Int64ObservableOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64ObservableOption] instead.
|
||||
type Int64ObservableOption metric.Int64ObservableOption
|
||||
|
||||
// WithInt64Callback wraps [metric.WithInt64Callback].
|
||||
//
|
||||
// Deprecated: Use [metric.WithInt64Callback] instead.
|
||||
func WithInt64Callback(callback Int64Callback) Int64ObservableOption {
|
||||
cback := metric.Int64Callback(callback)
|
||||
opt := metric.WithInt64Callback(cback)
|
||||
return Int64ObservableOption(opt)
|
||||
}
|
||||
|
||||
// Float64Counter is an alias for [metric.Float64Counter].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64Counter] instead.
|
||||
type Float64Counter metric.Float64Counter
|
||||
|
||||
// Float64CounterConfig is an alias for [metric.Float64CounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64CounterConfig] instead.
|
||||
type Float64CounterConfig metric.Float64CounterConfig
|
||||
|
||||
// NewFloat64CounterConfig wraps [metric.NewFloat64CounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewFloat64CounterConfig] instead.
|
||||
func NewFloat64CounterConfig(opts ...Float64CounterOption) Float64CounterConfig {
|
||||
o := make([]metric.Float64CounterOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Float64CounterOption(opts[i])
|
||||
}
|
||||
c := metric.NewFloat64CounterConfig(o...)
|
||||
return Float64CounterConfig(c)
|
||||
}
|
||||
|
||||
// Float64CounterOption is an alias for [metric.Float64CounterOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64CounterOption] instead.
|
||||
type Float64CounterOption metric.Float64CounterOption
|
||||
|
||||
// Float64UpDownCounter is an alias for [metric.Float64UpDownCounter].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64UpDownCounter] instead.
|
||||
type Float64UpDownCounter metric.Float64UpDownCounter
|
||||
|
||||
// Float64UpDownCounterConfig is an alias for
|
||||
// [metric.Float64UpDownCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64UpDownCounterConfig] instead.
|
||||
type Float64UpDownCounterConfig metric.Float64UpDownCounterConfig
|
||||
|
||||
// NewFloat64UpDownCounterConfig wraps [metric.NewFloat64UpDownCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewFloat64UpDownCounterConfig] instead.
|
||||
func NewFloat64UpDownCounterConfig(opts ...Float64UpDownCounterOption) Float64UpDownCounterConfig {
|
||||
o := make([]metric.Float64UpDownCounterOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Float64UpDownCounterOption(opts[i])
|
||||
}
|
||||
c := metric.NewFloat64UpDownCounterConfig(o...)
|
||||
return Float64UpDownCounterConfig(c)
|
||||
}
|
||||
|
||||
// Float64UpDownCounterOption is an alias for
|
||||
// [metric.Float64UpDownCounterOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64UpDownCounterOption] instead.
|
||||
type Float64UpDownCounterOption metric.Float64UpDownCounterOption
|
||||
|
||||
// Float64Histogram is an alias for [metric.Float64Histogram].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64Histogram] instead.
|
||||
type Float64Histogram metric.Float64Histogram
|
||||
|
||||
// Float64HistogramConfig is an alias for [metric.Float64HistogramConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64HistogramConfig] instead.
|
||||
type Float64HistogramConfig metric.Float64HistogramConfig
|
||||
|
||||
// NewFloat64HistogramConfig wraps [metric.NewFloat64HistogramConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewFloat64HistogramConfig] instead.
|
||||
func NewFloat64HistogramConfig(opts ...Float64HistogramOption) Float64HistogramConfig {
|
||||
o := make([]metric.Float64HistogramOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Float64HistogramOption(opts[i])
|
||||
}
|
||||
c := metric.NewFloat64HistogramConfig(o...)
|
||||
return Float64HistogramConfig(c)
|
||||
}
|
||||
|
||||
// Float64HistogramOption is an alias for [metric.Float64HistogramOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Float64HistogramOption] instead.
|
||||
type Float64HistogramOption metric.Float64HistogramOption
|
||||
|
||||
// Int64Counter is an alias for [metric.Int64Counter].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64Counter] instead.
|
||||
type Int64Counter metric.Int64Counter
|
||||
|
||||
// Int64CounterConfig is an alias for [metric.Int64CounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64CounterConfig] instead.
|
||||
type Int64CounterConfig metric.Int64CounterConfig
|
||||
|
||||
// NewInt64CounterConfig wraps [metric.NewInt64CounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewInt64CounterConfig] instead.
|
||||
func NewInt64CounterConfig(opts ...Int64CounterOption) Int64CounterConfig {
|
||||
o := make([]metric.Int64CounterOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Int64CounterOption(opts[i])
|
||||
}
|
||||
c := metric.NewInt64CounterConfig(o...)
|
||||
return Int64CounterConfig(c)
|
||||
}
|
||||
|
||||
// Int64CounterOption is an alias for [metric.Int64CounterOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64CounterOption] instead.
|
||||
type Int64CounterOption metric.Int64CounterOption
|
||||
|
||||
// Int64UpDownCounter is an alias for [metric.Int64UpDownCounter].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64UpDownCounter] instead.
|
||||
type Int64UpDownCounter metric.Int64UpDownCounter
|
||||
|
||||
// Int64UpDownCounterConfig is an alias for [metric.Int64UpDownCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64UpDownCounterConfig] instead.
|
||||
type Int64UpDownCounterConfig metric.Int64UpDownCounterConfig
|
||||
|
||||
// NewInt64UpDownCounterConfig wraps [metric.NewInt64UpDownCounterConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewInt64UpDownCounterConfig] instead.
|
||||
func NewInt64UpDownCounterConfig(opts ...Int64UpDownCounterOption) Int64UpDownCounterConfig {
|
||||
o := make([]metric.Int64UpDownCounterOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Int64UpDownCounterOption(opts[i])
|
||||
}
|
||||
c := metric.NewInt64UpDownCounterConfig(o...)
|
||||
return Int64UpDownCounterConfig(c)
|
||||
}
|
||||
|
||||
// Int64UpDownCounterOption is an alias for [metric.Int64UpDownCounterOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64UpDownCounterOption] instead.
|
||||
type Int64UpDownCounterOption metric.Int64UpDownCounterOption
|
||||
|
||||
// Int64Histogram is an alias for [metric.Int64Histogram].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64Histogram] instead.
|
||||
type Int64Histogram metric.Int64Histogram
|
||||
|
||||
// Int64HistogramConfig is an alias for [metric.Int64HistogramConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64HistogramConfig] instead.
|
||||
type Int64HistogramConfig metric.Int64HistogramConfig
|
||||
|
||||
// NewInt64HistogramConfig wraps [metric.NewInt64HistogramConfig].
|
||||
//
|
||||
// Deprecated: Use [metric.NewInt64HistogramConfig] instead.
|
||||
func NewInt64HistogramConfig(opts ...Int64HistogramOption) Int64HistogramConfig {
|
||||
o := make([]metric.Int64HistogramOption, len(opts))
|
||||
for i := range opts {
|
||||
o[i] = metric.Int64HistogramOption(opts[i])
|
||||
}
|
||||
c := metric.NewInt64HistogramConfig(o...)
|
||||
return Int64HistogramConfig(c)
|
||||
}
|
||||
|
||||
// Int64HistogramOption is an alias for [metric.Int64HistogramOption].
|
||||
//
|
||||
// Deprecated: Use [metric.Int64HistogramOption] instead.
|
||||
type Int64HistogramOption metric.Int64HistogramOption
|
||||
|
||||
// Observable is an alias for [metric.Observable].
|
||||
//
|
||||
// Deprecated: Use [metric.Observable] instead.
|
||||
type Observable metric.Observable
|
||||
|
||||
// Option is an alias for [metric.InstrumentOption].
|
||||
//
|
||||
// Deprecated: Use [metric.InstrumentOption] instead.
|
||||
type Option metric.InstrumentOption
|
||||
|
||||
// WithDescription is an alias for [metric.WithDescription].
|
||||
//
|
||||
// Deprecated: Use [metric.WithDescription] instead.
|
||||
func WithDescription(desc string) Option {
|
||||
o := metric.WithDescription(desc)
|
||||
return Option(o)
|
||||
}
|
||||
|
||||
// WithUnit is an alias for [metric.WithUnit].
|
||||
//
|
||||
// Deprecated: Use [metric.WithUnit] instead.
|
||||
func WithUnit(u string) Option {
|
||||
o := metric.WithUnit(u)
|
||||
return Option(o)
|
||||
}
|
||||
88
vendor/go.opentelemetry.io/otel/metric/instrument/instrument.go
generated
vendored
Normal file
88
vendor/go.opentelemetry.io/otel/metric/instrument/instrument.go
generated
vendored
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package instrument // import "go.opentelemetry.io/otel/metric/instrument"
|
||||
|
||||
// Asynchronous instruments are instruments that are updated within a Callback.
|
||||
// If an instrument is observed outside of it's callback it should be an error.
|
||||
//
|
||||
// This interface is used as a grouping mechanism.
|
||||
type Asynchronous interface {
|
||||
asynchronous()
|
||||
}
|
||||
|
||||
// Synchronous instruments are updated in line with application code.
|
||||
//
|
||||
// This interface is used as a grouping mechanism.
|
||||
type Synchronous interface {
|
||||
synchronous()
|
||||
}
|
||||
|
||||
// Option applies options to all instruments.
|
||||
type Option interface {
|
||||
Float64ObserverOption
|
||||
Int64ObserverOption
|
||||
Float64Option
|
||||
Int64Option
|
||||
}
|
||||
|
||||
type descOpt string
|
||||
|
||||
func (o descOpt) applyFloat64(c Float64Config) Float64Config {
|
||||
c.description = string(o)
|
||||
return c
|
||||
}
|
||||
|
||||
func (o descOpt) applyInt64(c Int64Config) Int64Config {
|
||||
c.description = string(o)
|
||||
return c
|
||||
}
|
||||
|
||||
func (o descOpt) applyFloat64Observer(c Float64ObserverConfig) Float64ObserverConfig {
|
||||
c.description = string(o)
|
||||
return c
|
||||
}
|
||||
|
||||
func (o descOpt) applyInt64Observer(c Int64ObserverConfig) Int64ObserverConfig {
|
||||
c.description = string(o)
|
||||
return c
|
||||
}
|
||||
|
||||
// WithDescription sets the instrument description.
|
||||
func WithDescription(desc string) Option { return descOpt(desc) }
|
||||
|
||||
type unitOpt string
|
||||
|
||||
func (o unitOpt) applyFloat64(c Float64Config) Float64Config {
|
||||
c.unit = string(o)
|
||||
return c
|
||||
}
|
||||
|
||||
func (o unitOpt) applyInt64(c Int64Config) Int64Config {
|
||||
c.unit = string(o)
|
||||
return c
|
||||
}
|
||||
|
||||
func (o unitOpt) applyFloat64Observer(c Float64ObserverConfig) Float64ObserverConfig {
|
||||
c.unit = string(o)
|
||||
return c
|
||||
}
|
||||
|
||||
func (o unitOpt) applyInt64Observer(c Int64ObserverConfig) Int64ObserverConfig {
|
||||
c.unit = string(o)
|
||||
return c
|
||||
}
|
||||
|
||||
// WithUnit sets the instrument unit.
|
||||
func WithUnit(u string) Option { return unitOpt(u) }
|
||||
85
vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64.go
generated
vendored
Normal file
85
vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64.go
generated
vendored
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package instrument // import "go.opentelemetry.io/otel/metric/instrument"
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
)
|
||||
|
||||
// Float64Counter is an instrument that records increasing float64 values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Float64Counter interface {
|
||||
// Add records a change to the counter.
|
||||
Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
|
||||
|
||||
Synchronous
|
||||
}
|
||||
|
||||
// Float64UpDownCounter is an instrument that records increasing or decreasing
|
||||
// float64 values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Float64UpDownCounter interface {
|
||||
// Add records a change to the counter.
|
||||
Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
|
||||
|
||||
Synchronous
|
||||
}
|
||||
|
||||
// Float64Histogram is an instrument that records a distribution of float64
|
||||
// values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Float64Histogram interface {
|
||||
// Record adds an additional value to the distribution.
|
||||
Record(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
|
||||
|
||||
Synchronous
|
||||
}
|
||||
|
||||
// Float64Config contains options for Asynchronous instruments that
|
||||
// observe float64 values.
|
||||
type Float64Config struct {
|
||||
description string
|
||||
unit string
|
||||
}
|
||||
|
||||
// Float64Config contains options for Synchronous instruments that record
|
||||
// float64 values.
|
||||
func NewFloat64Config(opts ...Float64Option) Float64Config {
|
||||
var config Float64Config
|
||||
for _, o := range opts {
|
||||
config = o.applyFloat64(config)
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
// Description returns the Config description.
|
||||
func (c Float64Config) Description() string {
|
||||
return c.description
|
||||
}
|
||||
|
||||
// Unit returns the Config unit.
|
||||
func (c Float64Config) Unit() string {
|
||||
return c.unit
|
||||
}
|
||||
|
||||
// Float64Option applies options to synchronous float64 instruments.
|
||||
type Float64Option interface {
|
||||
applyFloat64(Float64Config) Float64Config
|
||||
}
|
||||
85
vendor/go.opentelemetry.io/otel/metric/instrument/syncint64.go
generated
vendored
Normal file
85
vendor/go.opentelemetry.io/otel/metric/instrument/syncint64.go
generated
vendored
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package instrument // import "go.opentelemetry.io/otel/metric/instrument"
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
)
|
||||
|
||||
// Int64Counter is an instrument that records increasing int64 values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Int64Counter interface {
|
||||
// Add records a change to the counter.
|
||||
Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
|
||||
|
||||
Synchronous
|
||||
}
|
||||
|
||||
// Int64UpDownCounter is an instrument that records increasing or decreasing
|
||||
// int64 values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Int64UpDownCounter interface {
|
||||
// Add records a change to the counter.
|
||||
Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
|
||||
|
||||
Synchronous
|
||||
}
|
||||
|
||||
// Int64Histogram is an instrument that records a distribution of int64
|
||||
// values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Int64Histogram interface {
|
||||
// Record adds an additional value to the distribution.
|
||||
Record(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
|
||||
|
||||
Synchronous
|
||||
}
|
||||
|
||||
// Int64Config contains options for Synchronous instruments that record int64
|
||||
// values.
|
||||
type Int64Config struct {
|
||||
description string
|
||||
unit string
|
||||
}
|
||||
|
||||
// NewInt64Config returns a new Int64Config with all opts
|
||||
// applied.
|
||||
func NewInt64Config(opts ...Int64Option) Int64Config {
|
||||
var config Int64Config
|
||||
for _, o := range opts {
|
||||
config = o.applyInt64(config)
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
// Description returns the Config description.
|
||||
func (c Int64Config) Description() string {
|
||||
return c.description
|
||||
}
|
||||
|
||||
// Unit returns the Config unit.
|
||||
func (c Int64Config) Unit() string {
|
||||
return c.unit
|
||||
}
|
||||
|
||||
// Int64Option applies options to synchronous int64 instruments.
|
||||
type Int64Option interface {
|
||||
applyInt64(Int64Config) Int64Config
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue