mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
Follows #12812 This PR adds the `size` metrics defined in the [Pipeline Component Telemetry RFC](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/rfcs/component-universal-telemetry.md).
27 lines
553 B
Go
27 lines
553 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package obsconsumer_test
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.opentelemetry.io/otel/metric"
|
|
)
|
|
|
|
type disabledCounter struct {
|
|
metric.Int64Counter
|
|
}
|
|
|
|
func newDisabledCounter(embedded metric.Int64Counter) *disabledCounter {
|
|
return &disabledCounter{Int64Counter: embedded}
|
|
}
|
|
|
|
func (m *disabledCounter) Enabled(context.Context) bool {
|
|
return false
|
|
}
|
|
|
|
func (m *disabledCounter) Add(ctx context.Context, value int64, opts ...metric.AddOption) {
|
|
m.Int64Counter.Add(ctx, value, opts...)
|
|
}
|