Documentation ¶
Index ¶
- Constants
- Variables
- type Buckets
- type Exemplar
- type ExemplarSlice
- type ExemplarValueType
- type ExponentialHistogram
- type ExponentialHistogramDataPoint
- type ExponentialHistogramDataPointSlice
- type Gauge
- type Histogram
- type HistogramDataPoint
- type HistogramDataPointSlice
- type Marshaler
- type Metric
- type MetricAggregationTemporality
- type MetricDataPointFlag
- type MetricDataPointFlags
- type MetricDataPointFlagsStruct
- type MetricDataType
- type MetricSlice
- type Metrics
- type NumberDataPoint
- type NumberDataPointSlice
- type NumberDataPointValueType
- type ResourceMetrics
- type ResourceMetricsSlice
- type ScopeMetrics
- type ScopeMetricsSlice
- type Sizer
- type Sum
- type Summary
- type SummaryDataPoint
- type SummaryDataPointSlice
- type Unmarshaler
- type ValueAtQuantile
- type ValueAtQuantileSlice
Constants ¶
const ( MetricDataTypeNone = internal.MetricDataTypeNone MetricDataTypeGauge = internal.MetricDataTypeGauge MetricDataTypeSum = internal.MetricDataTypeSum MetricDataTypeHistogram = internal.MetricDataTypeHistogram MetricDataTypeExponentialHistogram = internal.MetricDataTypeExponentialHistogram MetricDataTypeSummary = internal.MetricDataTypeSummary )
const ( // MetricAggregationTemporalityUnspecified is the default MetricAggregationTemporality, it MUST NOT be used. MetricAggregationTemporalityUnspecified = internal.MetricAggregationTemporalityUnspecified // MetricAggregationTemporalityDelta is a MetricAggregationTemporality for a metric aggregator which reports changes since last report time. MetricAggregationTemporalityDelta = internal.MetricAggregationTemporalityDelta // MetricAggregationTemporalityCumulative is a MetricAggregationTemporality for a metric aggregator which reports changes since a fixed start time. MetricAggregationTemporalityCumulative = internal.MetricAggregationTemporalityCumulative )
const ( NumberDataPointValueTypeNone = internal.NumberDataPointValueTypeNone NumberDataPointValueTypeInt = internal.NumberDataPointValueTypeInt NumberDataPointValueTypeDouble = internal.NumberDataPointValueTypeDouble )
const ( ExemplarValueTypeNone = internal.ExemplarValueTypeNone ExemplarValueTypeInt = internal.ExemplarValueTypeInt ExemplarValueTypeDouble = internal.ExemplarValueTypeDouble )
const ( // MetricDataPointFlagNoRecordedValue is flag for a metric aggregator which reports changes since last report time. // Deprecated: [v0.57.0] Use MetricDataPointFlagsStruct.NoRecordedValue instead. MetricDataPointFlagNoRecordedValue = internal.MetricDataPointFlagNoRecordedValue )
const ( // MetricDataPointFlagsNone is the default MetricDataPointFlags. // Deprecated: [v0.57.0] Use MetricDataPointFlagsStruct.NoRecordedValue instead. MetricDataPointFlagsNone = internal.MetricDataPointFlagsNone )
Variables ¶
var NewBuckets = internal.NewBuckets
NewBuckets is an alias for a function to create a new empty Buckets.
var NewExemplar = internal.NewExemplar
NewExemplar is an alias for a function to create a new empty Exemplar.
var NewExemplarSlice = internal.NewExemplarSlice
NewExemplarSlice creates a ExemplarSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
var NewExponentialHistogram = internal.NewExponentialHistogram
NewExponentialHistogram is an alias for a function to create a new empty ExponentialHistogram.
var NewExponentialHistogramDataPoint = internal.NewExponentialHistogramDataPoint
NewExponentialHistogramDataPoint is an alias for a function to create a new empty ExponentialHistogramDataPoint.
var NewExponentialHistogramDataPointSlice = internal.NewExponentialHistogramDataPointSlice
NewExponentialHistogramDataPointSlice creates a ExponentialHistogramDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
var NewGauge = internal.NewGauge
NewGauge is an alias for a function to create a new empty Gauge.
var NewHistogram = internal.NewHistogram
NewHistogram is an alias for a function to create a new empty Histogram.
var NewHistogramDataPoint = internal.NewHistogramDataPoint
NewHistogramDataPoint is an alias for a function to create a new empty HistogramDataPoint.
var NewHistogramDataPointSlice = internal.NewHistogramDataPointSlice
NewHistogramDataPointSlice creates a HistogramDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
var NewMetric = internal.NewMetric
NewMetric is an alias for a function to create a new empty Metric.
var NewMetricDataPointFlags = internal.NewMetricDataPointFlags
NewMetricDataPointFlags returns a new MetricDataPointFlags combining the flags passed in as parameters. Deprecated: [v0.57.0] Use NewMetricDataPointFlagsStruct and MetricDataPointFlagsStruct.SetNoRecordedValue instead.
var NewMetricDataPointFlagsStruct = internal.NewMetricDataPointFlagsStruct
NewMetricDataPointFlagsStruct returns a new empty MetricDataPointFlagsStruct.
var NewMetricSlice = internal.NewMetricSlice
NewMetricSlice creates a MetricSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
var NewMetrics = internal.NewMetrics
NewMetrics creates a new Metrics struct.
var NewNumberDataPoint = internal.NewNumberDataPoint
NewNumberDataPoint is an alias for a function to create a new empty NumberDataPoint.
var NewNumberDataPointSlice = internal.NewNumberDataPointSlice
NewNumberDataPointSlice creates a NumberDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
var NewResourceMetrics = internal.NewResourceMetrics
NewResourceMetrics is an alias for a function to create a new empty ResourceMetrics.
var NewResourceMetricsSlice = internal.NewResourceMetricsSlice
NewResourceMetricsSlice creates a ResourceMetricsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
var NewScopeMetrics = internal.NewScopeMetrics
NewScopeMetrics is an alias for a function to create a new empty ScopeMetrics.
var NewScopeMetricsSlice = internal.NewScopeMetricsSlice
NewScopeMetricsSlice creates a ScopeMetricsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
var NewSum = internal.NewSum
NewSum is an alias for a function to create a new empty Sum.
var NewSummary = internal.NewSummary
NewSummary is an alias for a function to create a new empty Summary.
var NewSummaryDataPoint = internal.NewSummaryDataPoint
NewSummaryDataPoint is an alias for a function to create a new empty SummaryDataPoint.
var NewSummaryDataPointSlice = internal.NewSummaryDataPointSlice
NewSummaryDataPointSlice creates a SummaryDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
var NewValueAtQuantile = internal.NewValueAtQuantile
NewValueAtQuantile is an alias for a function to create a new empty ValueAtQuantile.
var NewValueAtQuantileSlice = internal.NewValueAtQuantileSlice
NewValueAtQuantileSlice creates a ValueAtQuantileSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.
Functions ¶
This section is empty.
Types ¶
type Buckets ¶
Buckets are a set of bucket counts, encoded in a contiguous array of counts.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewBuckets function to create new instances. Important: zero-initialized instance is not valid for use.
type Exemplar ¶
Exemplar is a sample input double measurement.
Exemplars also hold information about the environment when the measurement was recorded, for example the span and trace ID of the active span when the exemplar was recorded.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewExemplar function to create new instances. Important: zero-initialized instance is not valid for use.
type ExemplarSlice ¶
type ExemplarSlice = internal.ExemplarSlice
ExemplarSlice logically represents a slice of Exemplar.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewExemplarSlice function to create new instances. Important: zero-initialized instance is not valid for use.
type ExemplarValueType ¶ added in v0.50.0
type ExemplarValueType = internal.ExemplarValueType
ExemplarValueType specifies the type of Exemplar measurement value.
type ExponentialHistogram ¶
type ExponentialHistogram = internal.ExponentialHistogram
ExponentialHistogram represents the type of a metric that is calculated by aggregating as a ExponentialHistogram of all reported double measurements over a time interval.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewExponentialHistogram function to create new instances. Important: zero-initialized instance is not valid for use.
type ExponentialHistogramDataPoint ¶
type ExponentialHistogramDataPoint = internal.ExponentialHistogramDataPoint
ExponentialHistogramDataPoint is a single data point in a timeseries that describes the time-varying values of a ExponentialHistogram of double values. A ExponentialHistogram contains summary statistics for a population of values, it may optionally contain the distribution of those values across a set of buckets.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewExponentialHistogramDataPoint function to create new instances. Important: zero-initialized instance is not valid for use.
type ExponentialHistogramDataPointSlice ¶
type ExponentialHistogramDataPointSlice = internal.ExponentialHistogramDataPointSlice
ExponentialHistogramDataPointSlice logically represents a slice of ExponentialHistogramDataPoint.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewExponentialHistogramDataPointSlice function to create new instances. Important: zero-initialized instance is not valid for use.
type Gauge ¶
Gauge represents the type of a numeric metric that always exports the "current value" for every data point.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewGauge function to create new instances. Important: zero-initialized instance is not valid for use.
type Histogram ¶
Histogram represents the type of a metric that is calculated by aggregating as a Histogram of all reported measurements over a time interval.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewHistogram function to create new instances. Important: zero-initialized instance is not valid for use.
type HistogramDataPoint ¶
type HistogramDataPoint = internal.HistogramDataPoint
HistogramDataPoint is a single data point in a timeseries that describes the time-varying values of a Histogram of values.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewHistogramDataPoint function to create new instances. Important: zero-initialized instance is not valid for use.
type HistogramDataPointSlice ¶
type HistogramDataPointSlice = internal.HistogramDataPointSlice
HistogramDataPointSlice logically represents a slice of HistogramDataPoint.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewHistogramDataPointSlice function to create new instances. Important: zero-initialized instance is not valid for use.
type Marshaler ¶
type Marshaler interface { // MarshalMetrics the given pmetric.Metrics into bytes. // If the error is not nil, the returned bytes slice cannot be used. MarshalMetrics(md Metrics) ([]byte, error) }
Marshaler marshals pmetric.Metrics into bytes.
func NewJSONMarshaler ¶
func NewJSONMarshaler() Marshaler
NewJSONMarshaler returns a model.Marshaler. Marshals to OTLP json bytes.
func NewProtoMarshaler ¶
func NewProtoMarshaler() Marshaler
NewProtoMarshaler returns a Marshaler. Marshals to OTLP binary protobuf bytes.
type Metric ¶
Metric represents one metric as a collection of datapoints. See Metric definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/metrics/v1/metrics.proto
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewMetric function to create new instances. Important: zero-initialized instance is not valid for use.
type MetricAggregationTemporality ¶
type MetricAggregationTemporality = internal.MetricAggregationTemporality
MetricAggregationTemporality defines how a metric aggregator reports aggregated values. It describes how those values relate to the time interval over which they are aggregated.
type MetricDataPointFlag ¶
type MetricDataPointFlag = internal.MetricDataPointFlag
MetricDataPointFlag allow users to configure DataPointFlags. This is achieved via NewMetricDataPointFlags. The separation between MetricDataPointFlags and MetricDataPointFlag exists to prevent users accidentally comparing the value of individual flags with MetricDataPointFlags. Instead, users must use the HasFlag method. Deprecated: [v0.57.0] Use MetricDataPointFlagsStruct instead.
type MetricDataPointFlags ¶
type MetricDataPointFlags = internal.MetricDataPointFlags
MetricDataPointFlags defines how a metric aggregator reports aggregated values. It describes how those values relate to the time interval over which they are aggregated. Deprecated: [v0.57.0] Use MetricDataPointFlagsStruct instead.
type MetricDataPointFlagsStruct ¶ added in v0.57.1
type MetricDataPointFlagsStruct = internal.MetricDataPointFlagsStruct
MetricDataPointFlagsStruct defines how a metric aggregator reports aggregated values. It describes how those values relate to the time interval over which they are aggregated.
type MetricDataType ¶
type MetricDataType = internal.MetricDataType
MetricDataType specifies the type of data in a Metric.
type MetricSlice ¶
type MetricSlice = internal.MetricSlice
MetricSlice logically represents a slice of Metric.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewMetricSlice function to create new instances. Important: zero-initialized instance is not valid for use.
type Metrics ¶
Metrics is the top-level struct that is propagated through the metrics pipeline. Use NewMetrics to create new instance, zero-initialized instance is not valid for use.
type NumberDataPoint ¶
type NumberDataPoint = internal.NumberDataPoint
NumberDataPoint is a single data point in a timeseries that describes the time-varying value of a number metric.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewNumberDataPoint function to create new instances. Important: zero-initialized instance is not valid for use.
type NumberDataPointSlice ¶
type NumberDataPointSlice = internal.NumberDataPointSlice
NumberDataPointSlice logically represents a slice of NumberDataPoint.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewNumberDataPointSlice function to create new instances. Important: zero-initialized instance is not valid for use.
type NumberDataPointValueType ¶ added in v0.50.0
type NumberDataPointValueType = internal.NumberDataPointValueType
NumberDataPointValueType specifies the type of NumberDataPoint value.
type ResourceMetrics ¶
type ResourceMetrics = internal.ResourceMetrics
ResourceMetrics is a collection of metrics from a Resource.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewResourceMetrics function to create new instances. Important: zero-initialized instance is not valid for use.
type ResourceMetricsSlice ¶
type ResourceMetricsSlice = internal.ResourceMetricsSlice
ResourceMetricsSlice logically represents a slice of ResourceMetrics.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewResourceMetricsSlice function to create new instances. Important: zero-initialized instance is not valid for use.
type ScopeMetrics ¶
type ScopeMetrics = internal.ScopeMetrics
ScopeMetrics is a collection of metrics from a LibraryInstrumentation.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewScopeMetrics function to create new instances. Important: zero-initialized instance is not valid for use.
type ScopeMetricsSlice ¶
type ScopeMetricsSlice = internal.ScopeMetricsSlice
ScopeMetricsSlice logically represents a slice of ScopeMetrics.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewScopeMetricsSlice function to create new instances. Important: zero-initialized instance is not valid for use.
type Sizer ¶
type Sizer interface { // MetricsSize returns the size in bytes of a marshaled Metrics. MetricsSize(md Metrics) int }
Sizer is an optional interface implemented by the Marshaler, that calculates the size of a marshaled Metrics.
type Sum ¶
Sum represents the type of a numeric metric that is calculated as a sum of all reported measurements over a time interval.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewSum function to create new instances. Important: zero-initialized instance is not valid for use.
type Summary ¶
Summary represents the type of a metric that is calculated by aggregating as a Summary of all reported double measurements over a time interval.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewSummary function to create new instances. Important: zero-initialized instance is not valid for use.
type SummaryDataPoint ¶
type SummaryDataPoint = internal.SummaryDataPoint
SummaryDataPoint is a single data point in a timeseries that describes the time-varying values of a Summary of double values.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewSummaryDataPoint function to create new instances. Important: zero-initialized instance is not valid for use.
type SummaryDataPointSlice ¶
type SummaryDataPointSlice = internal.SummaryDataPointSlice
SummaryDataPointSlice logically represents a slice of SummaryDataPoint.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewSummaryDataPointSlice function to create new instances. Important: zero-initialized instance is not valid for use.
type Unmarshaler ¶
type Unmarshaler interface { // UnmarshalMetrics the given bytes into pmetric.Metrics. // If the error is not nil, the returned pmetric.Metrics cannot be used. UnmarshalMetrics(buf []byte) (Metrics, error) }
Unmarshaler unmarshalls bytes into pmetric.Metrics.
func NewJSONUnmarshaler ¶
func NewJSONUnmarshaler() Unmarshaler
NewJSONUnmarshaler returns a model.Unmarshaler. Unmarshals from OTLP json bytes.
func NewProtoUnmarshaler ¶
func NewProtoUnmarshaler() Unmarshaler
NewProtoUnmarshaler returns a model.Unmarshaler. Unmarshals from OTLP binary protobuf bytes.
type ValueAtQuantile ¶
type ValueAtQuantile = internal.ValueAtQuantile
ValueAtQuantile is a quantile value within a Summary data point.
This is a reference type, if passed by value and callee modifies it the caller will see the modification.
Must use NewValueAtQuantile function to create new instances. Important: zero-initialized instance is not valid for use.
type ValueAtQuantileSlice ¶
type ValueAtQuantileSlice = internal.ValueAtQuantileSlice
ValueAtQuantileSlice logically represents a slice of ValueAtQuantile.
This is a reference type. If passed by value and callee modifies it, the caller will see the modification.
Must use NewValueAtQuantileSlice function to create new instances. Important: zero-initialized instance is not valid for use.