otlptest

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyMetricName  = fmt.Errorf("empty metric name")
	ErrInvalidPointKind = fmt.Errorf("unrecognized data point type")
)

Functions

func DoubleDataPoint

func DoubleDataPoint(labels []*otlpcommon.StringKeyValue, start, end time.Time, value float64) *otlpmetrics.DoubleDataPoint

func DoubleGauge

func DoubleGauge(name, desc, unit string, ddps ...*otlpmetrics.DoubleDataPoint) *otlpmetrics.Metric

func DoubleHistogramCumulative

func DoubleHistogramCumulative(name, desc, unit string, idps ...*otlpmetrics.DoubleHistogramDataPoint) *otlpmetrics.Metric

func DoubleHistogramDataPoint

func DoubleHistogramDataPoint(labels []*otlpcommon.StringKeyValue, start, end time.Time, sum float64, total uint64, buckets ...DoubleHistogramBucketStruct) *otlpmetrics.DoubleHistogramDataPoint

func DoubleSumCumulative

func DoubleSumCumulative(name, desc, unit string, ddps ...*otlpmetrics.DoubleDataPoint) *otlpmetrics.Metric

func DoubleSumCumulativeMonotonic

func DoubleSumCumulativeMonotonic(name, desc, unit string, ddps ...*otlpmetrics.DoubleDataPoint) *otlpmetrics.Metric

func DoubleSummary added in v0.23.0

func DoubleSummary(name, desc, unit string, dps ...*otlpmetrics.DoubleSummaryDataPoint) *otlpmetrics.Metric

func DoubleSummaryDataPoint added in v0.23.0

func DoubleSummaryDataPoint(labels []*otlpcommon.StringKeyValue, start, end time.Time, sum float64, count uint64, quantiles ...DoubleSummaryQuantileValueStruct) *otlpmetrics.DoubleSummaryDataPoint

func InstrumentationLibrary

func InstrumentationLibrary(name, version string) *otlpcommon.InstrumentationLibrary

func IntDataPoint

func IntDataPoint(labels []*otlpcommon.StringKeyValue, start, end time.Time, value int64) *otlpmetrics.IntDataPoint

func IntGauge

func IntGauge(name, desc, unit string, idps ...*otlpmetrics.IntDataPoint) *otlpmetrics.Metric

func IntSumCumulative

func IntSumCumulative(name, desc, unit string, idps ...*otlpmetrics.IntDataPoint) *otlpmetrics.Metric

func IntSumCumulativeMonotonic

func IntSumCumulativeMonotonic(name, desc, unit string, idps ...*otlpmetrics.IntDataPoint) *otlpmetrics.Metric

func KeyValue

func KeyValue(k, v string) *otlpcommon.KeyValue

func Label

func Label(key, value string) *otlpcommon.StringKeyValue

func Resource

func Resource(kvs ...*otlpcommon.KeyValue) *otlpresource.Resource

func ResourceLabels

func ResourceLabels(kvs ...*otlpcommon.KeyValue) []*otlpcommon.KeyValue

Types

type DoubleHistogramBucketStruct

type DoubleHistogramBucketStruct struct {
	Boundary float64
	Count    uint64
}

func DoubleHistogramBucket

func DoubleHistogramBucket(boundary float64, count uint64) DoubleHistogramBucketStruct

type DoubleSummaryQuantileValueStruct added in v0.23.0

type DoubleSummaryQuantileValueStruct struct {
	Quantile float64
	Value    float64
}

func DoubleSummaryQuantileValue added in v0.23.0

func DoubleSummaryQuantileValue(quantile, value float64) DoubleSummaryQuantileValueStruct

type Visitor

type Visitor func(

	resource *otlpresource.Resource,

	metricName string,

	kind config.Kind,

	monotonic bool,

	point interface{},
) error

Visitor is used because it takes around 50 lines of code to traverse an OTLP request, with looping over Resource, Instrumentation Library, the list of Metrics, and six distinct types of data point.

type VisitorState

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

func (*VisitorState) InvalidCount

func (vs *VisitorState) InvalidCount() int

func (*VisitorState) PointCount

func (vs *VisitorState) PointCount() int

func (*VisitorState) Visit

func (vs *VisitorState) Visit(
	ctx context.Context,
	visitor Visitor,
	metrics ...*otlpmetrics.ResourceMetrics,
) error

Jump to

Keyboard shortcuts

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