tqlmetrics

package
v0.60.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

README

Metrics Context

The Metrics Context is a Context implementation for pdata Metrics, the collector's internal representation for OTLP metric data. This Context should be used when interacted with OTLP metrics.

Paths

In general, the Metrics Context supports accessing pdata using the field names from the metrics proto. All integers are returned and set via int64. All doubles are returned and set via float64.

The following fields are the exception.

path field accessed type
resource resource of the data point being processed pcommon.Resource
resource.attributes resource attributes of the data point being processed pcommon.Map
resource.attributes[""] the value of the resource attribute of the data point being processed string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil
instrumentation_scope instrumentation scope of the data point being processed pcommon.InstrumentationScope
instrumentation_scope.name name of the instrumentation scope of the data point being processed string
instrumentation_scope.version version of the instrumentation scope of the data point being processed string
instrumentation_scope.attributes instrumentation scope attributes of the data point being processed pcommon.Map
instrumentation_scope.attributes[""] the value of the instrumentation scope attribute of the data point being processed string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil
attributes attributes of the data point being processed pcommon.Map
attributes[""] the value of the attribute of the data point being processed string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil
metric the metric to which the data point being processed belongs pmetric.Metric
metric.name the name of the metric to which the data point being processed belongs string
metric.description the description of the metric to which the data point being processed belongs string
metric.unit the unit of the metric to which the data point being processed belongs string
metric.type the type of the metric to which the data point being processed belongs. See enums below for integer mapping. int64
metric.aggregation_temporality the aggregation temporality of the metric to which the data point being processed belongs int64
metric.is_monotonic the monotonicity of the metric to which the data point being processed belongs bool
positive the positive buckets of the data point being processed pmetric.ExponentialHistogramDataPoint
positive.offset the offset of the positive buckets of the data point being processed int64
positive.bucket_counts the bucket_counts of the positive buckets of the data point being processed uint64
negative the negative buckets of the data point being processed pmetric.ExponentialHistogramDataPoint
negative.offset the offset of the negative buckets of the data point being processed int64
negative.bucket_counts the bucket_counts of the negative buckets of the data point being processed uint64

Enums

The Metrics Context supports the enum names from the metrics proto. In addition, it also supports an enum for metrics data type, with the numeric value being defined by pdata.

Enum Symbol Value
METRIC_DATA_TYPE_NONE 0
METRIC_DATA_TYPE_GAUGE 1
METRIC_DATA_TYPE_SUM 2
METRIC_DATA_TYPE_HISTOGRAM 3
METRIC_DATA_TYPE_EXPONENTIAL_HISTOGRAM 4
METRIC_DATA_TYPE_SUMMARY 5

Documentation

Overview

nolint:gocritic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseEnum

func ParseEnum(val *tql.EnumSymbol) (*tql.Enum, error)

func ParsePath

func ParsePath(val *tql.Path) (tql.GetSetter, error)

Types

type TransformContext added in v0.59.0

type TransformContext struct {
	// contains filtered or unexported fields
}

func NewTransformContext added in v0.59.0

func NewTransformContext(dataPoint interface{}, metric pmetric.Metric, metrics pmetric.MetricSlice, instrumentationScope pcommon.InstrumentationScope, resource pcommon.Resource) TransformContext

func (TransformContext) GetInstrumentationScope added in v0.59.0

func (ctx TransformContext) GetInstrumentationScope() pcommon.InstrumentationScope

func (TransformContext) GetItem added in v0.59.0

func (ctx TransformContext) GetItem() interface{}

func (TransformContext) GetMetric added in v0.59.0

func (ctx TransformContext) GetMetric() pmetric.Metric

func (TransformContext) GetMetrics added in v0.59.0

func (ctx TransformContext) GetMetrics() pmetric.MetricSlice

func (TransformContext) GetResource added in v0.59.0

func (ctx TransformContext) GetResource() pcommon.Resource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL