internal

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeverityNumberUNDEFINED = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED)
	SeverityNumberTRACE     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE)
	SeverityNumberTRACE2    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE2)
	SeverityNumberTRACE3    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE3)
	SeverityNumberTRACE4    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE4)
	SeverityNumberDEBUG     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG)
	SeverityNumberDEBUG2    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG2)
	SeverityNumberDEBUG3    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG3)
	SeverityNumberDEBUG4    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG4)
	SeverityNumberINFO      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO)
	SeverityNumberINFO2     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO2)
	SeverityNumberINFO3     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO3)
	SeverityNumberINFO4     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO4)
	SeverityNumberWARN      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN)
	SeverityNumberWARN2     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN2)
	SeverityNumberWARN3     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN3)
	SeverityNumberWARN4     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN4)
	SeverityNumberERROR     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR)
	SeverityNumberERROR2    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR2)
	SeverityNumberERROR3    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR3)
	SeverityNumberERROR4    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR4)
	SeverityNumberFATAL     = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL)
	SeverityNumberFATAL2    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL2)
	SeverityNumberFATAL3    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL3)
	SeverityNumberFATAL4    = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL4)
)
View Source
const (
	// MetricAggregationTemporalityUnspecified is the default MetricAggregationTemporality, it MUST NOT be used.
	MetricAggregationTemporalityUnspecified = MetricAggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED)
	// MetricAggregationTemporalityDelta is a MetricAggregationTemporality for a metric aggregator which reports changes since last report time.
	MetricAggregationTemporalityDelta = MetricAggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA)
	// MetricAggregationTemporalityCumulative is a MetricAggregationTemporality for a metric aggregator which reports changes since a fixed start time.
	MetricAggregationTemporalityCumulative = MetricAggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE)
)
View Source
const (
	// SpanKindUnspecified represents that the SpanKind is unspecified, it MUST NOT be used.
	SpanKindUnspecified = SpanKind(otlptrace.Span_SPAN_KIND_UNSPECIFIED)
	// SpanKindInternal indicates that the span represents an internal operation within an application,
	// as opposed to an operation happening at the boundaries. Default value.
	SpanKindInternal = SpanKind(otlptrace.Span_SPAN_KIND_INTERNAL)
	// SpanKindServer indicates that the span covers server-side handling of an RPC or other
	// remote network request.
	SpanKindServer = SpanKind(otlptrace.Span_SPAN_KIND_SERVER)
	// SpanKindClient indicates that the span describes a request to some remote service.
	SpanKindClient = SpanKind(otlptrace.Span_SPAN_KIND_CLIENT)
	// SpanKindProducer indicates that the span describes a producer sending a message to a broker.
	// Unlike CLIENT and SERVER, there is often no direct critical path latency relationship
	// between producer and consumer spans.
	// A PRODUCER span ends when the message was accepted by the broker while the logical processing of
	// the message might span a much longer time.
	SpanKindProducer = SpanKind(otlptrace.Span_SPAN_KIND_PRODUCER)
	// SpanKindConsumer indicates that the span describes consumer receiving a message from a broker.
	// Like the PRODUCER kind, there is often no direct critical path latency relationship between
	// producer and consumer spans.
	SpanKindConsumer = SpanKind(otlptrace.Span_SPAN_KIND_CONSUMER)
)
View Source
const (
	// MetricDataPointFlagNoRecordedValue is flag for a metric aggregator which reports changes since last report time.
	MetricDataPointFlagNoRecordedValue = MetricDataPointFlag(otlpmetrics.DataPointFlags_FLAG_NO_RECORDED_VALUE)
)
View Source
const (
	// MetricDataPointFlagsNone is the default MetricDataPointFlags.
	MetricDataPointFlagsNone = MetricDataPointFlags(otlpmetrics.DataPointFlags_FLAG_NONE)
)

Variables

This section is empty.

Functions

func LogsToOtlp

LogsToOtlp internal helper to convert Logs to otlp request representation.

func LogsToProto added in v0.50.0

func LogsToProto(l Logs) otlplogs.LogsData

LogsToProto internal helper to convert Logs to protobuf representation.

func MetricsToOtlp

MetricsToOtlp internal helper to convert Metrics to otlp request representation.

func MetricsToProto added in v0.50.0

func MetricsToProto(l Metrics) otlpmetrics.MetricsData

MetricsToProto internal helper to convert Metrics to protobuf representation.

func TracesToOtlp

TracesToOtlp internal helper to convert Traces to otlp request representation.

func TracesToProto added in v0.50.0

func TracesToProto(mw Traces) otlptrace.TracesData

TracesToProto internal helper to convert Traces to protobuf representation.

Types

type Buckets

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

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.

func NewBuckets

func NewBuckets() Buckets

NewBuckets creates a new empty Buckets.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (Buckets) CopyTo

func (ms Buckets) CopyTo(dest Buckets)

CopyTo copies all properties from the current struct to the dest.

func (Buckets) MBucketCounts added in v0.51.0

func (ms Buckets) MBucketCounts() []uint64

MBucketCounts returns the mbucketcounts associated with this Buckets.

func (Buckets) MoveTo

func (ms Buckets) MoveTo(dest Buckets)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (Buckets) Offset

func (ms Buckets) Offset() int32

Offset returns the offset associated with this Buckets.

func (Buckets) SetMBucketCounts added in v0.51.0

func (ms Buckets) SetMBucketCounts(v []uint64)

SetMBucketCounts replaces the mbucketcounts associated with this Buckets.

func (Buckets) SetOffset

func (ms Buckets) SetOffset(v int32)

SetOffset replaces the offset associated with this Buckets.

type Exemplar

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

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.

func NewExemplar

func NewExemplar() Exemplar

NewExemplar creates a new empty Exemplar.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (Exemplar) CopyTo

func (ms Exemplar) CopyTo(dest Exemplar)

CopyTo copies all properties from the current struct to the dest.

func (Exemplar) DoubleVal

func (ms Exemplar) DoubleVal() float64

DoubleVal returns the doubleval associated with this Exemplar.

func (Exemplar) FilteredAttributes

func (ms Exemplar) FilteredAttributes() Map

FilteredAttributes returns the FilteredAttributes associated with this Exemplar.

func (Exemplar) IntVal

func (ms Exemplar) IntVal() int64

IntVal returns the intval associated with this Exemplar.

func (Exemplar) MoveTo

func (ms Exemplar) MoveTo(dest Exemplar)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (Exemplar) SetDoubleVal

func (ms Exemplar) SetDoubleVal(v float64)

SetDoubleVal replaces the doubleval associated with this Exemplar.

func (Exemplar) SetIntVal

func (ms Exemplar) SetIntVal(v int64)

SetIntVal replaces the intval associated with this Exemplar.

func (Exemplar) SetSpanID

func (ms Exemplar) SetSpanID(v SpanID)

SetSpanID replaces the spanid associated with this Exemplar.

func (Exemplar) SetTimestamp

func (ms Exemplar) SetTimestamp(v Timestamp)

SetTimestamp replaces the timestamp associated with this Exemplar.

func (Exemplar) SetTraceID

func (ms Exemplar) SetTraceID(v TraceID)

SetTraceID replaces the traceid associated with this Exemplar.

func (Exemplar) SpanID

func (ms Exemplar) SpanID() SpanID

SpanID returns the spanid associated with this Exemplar.

func (Exemplar) Timestamp

func (ms Exemplar) Timestamp() Timestamp

Timestamp returns the timestamp associated with this Exemplar.

func (Exemplar) TraceID

func (ms Exemplar) TraceID() TraceID

TraceID returns the traceid associated with this Exemplar.

func (Exemplar) ValueType

func (ms Exemplar) ValueType() ExemplarValueType

ValueType returns the type of the value for this Exemplar. Calling this function on zero-initialized Exemplar will cause a panic.

type ExemplarSlice

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

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.

func NewExemplarSlice

func NewExemplarSlice() ExemplarSlice

NewExemplarSlice creates a ExemplarSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ExemplarSlice) AppendEmpty

func (es ExemplarSlice) AppendEmpty() Exemplar

AppendEmpty will append to the end of the slice an empty Exemplar. It returns the newly added Exemplar.

func (ExemplarSlice) At

func (es ExemplarSlice) At(ix int) Exemplar

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ExemplarSlice) CopyTo

func (es ExemplarSlice) CopyTo(dest ExemplarSlice)

CopyTo copies all elements from the current slice to the dest.

func (ExemplarSlice) EnsureCapacity

func (es ExemplarSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ExemplarSlice can be initialized:

es := NewExemplarSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ExemplarSlice) Len

func (es ExemplarSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewExemplarSlice()".

func (ExemplarSlice) MoveAndAppendTo

func (es ExemplarSlice) MoveAndAppendTo(dest ExemplarSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ExemplarSlice) RemoveIf

func (es ExemplarSlice) RemoveIf(f func(Exemplar) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

type ExemplarValueType added in v0.50.0

type ExemplarValueType int32

ExemplarValueType specifies the type of Exemplar measurement value.

const (
	ExemplarValueTypeNone ExemplarValueType = iota
	ExemplarValueTypeInt
	ExemplarValueTypeDouble
)

func (ExemplarValueType) String added in v0.50.0

func (nt ExemplarValueType) String() string

String returns the string representation of the ExemplarValueType.

type ExponentialHistogram

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

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.

func NewExponentialHistogram

func NewExponentialHistogram() ExponentialHistogram

NewExponentialHistogram creates a new empty ExponentialHistogram.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ExponentialHistogram) AggregationTemporality

func (ms ExponentialHistogram) AggregationTemporality() MetricAggregationTemporality

AggregationTemporality returns the aggregationtemporality associated with this ExponentialHistogram.

func (ExponentialHistogram) CopyTo

CopyTo copies all properties from the current struct to the dest.

func (ExponentialHistogram) DataPoints

DataPoints returns the DataPoints associated with this ExponentialHistogram.

func (ExponentialHistogram) MoveTo

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (ExponentialHistogram) SetAggregationTemporality

func (ms ExponentialHistogram) SetAggregationTemporality(v MetricAggregationTemporality)

SetAggregationTemporality replaces the aggregationtemporality associated with this ExponentialHistogram.

type ExponentialHistogramDataPoint

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

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.

func NewExponentialHistogramDataPoint

func NewExponentialHistogramDataPoint() ExponentialHistogramDataPoint

NewExponentialHistogramDataPoint creates a new empty ExponentialHistogramDataPoint.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ExponentialHistogramDataPoint) Attributes

func (ms ExponentialHistogramDataPoint) Attributes() Map

Attributes returns the Attributes associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) CopyTo

CopyTo copies all properties from the current struct to the dest.

func (ExponentialHistogramDataPoint) Count

Count returns the count associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) Exemplars

Exemplars returns the Exemplars associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) Flags

Flags returns the flags associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) HasMax added in v0.52.0

func (ms ExponentialHistogramDataPoint) HasMax() bool

HasMax returns true if the ExponentialHistogramDataPoint contains a Max value, false otherwise.

func (ExponentialHistogramDataPoint) HasMin added in v0.52.0

func (ms ExponentialHistogramDataPoint) HasMin() bool

HasMin returns true if the ExponentialHistogramDataPoint contains a Min value, false otherwise.

func (ExponentialHistogramDataPoint) Max added in v0.52.0

Max returns the max associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) Min added in v0.52.0

Min returns the min associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) MoveTo

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (ExponentialHistogramDataPoint) Negative

func (ms ExponentialHistogramDataPoint) Negative() Buckets

Negative returns the negative associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) Positive

func (ms ExponentialHistogramDataPoint) Positive() Buckets

Positive returns the positive associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) Scale

Scale returns the scale associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) SetCount

func (ms ExponentialHistogramDataPoint) SetCount(v uint64)

SetCount replaces the count associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) SetFlags

SetFlags replaces the flags associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) SetMax added in v0.52.0

SetMax replaces the max associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) SetMin added in v0.52.0

SetMin replaces the min associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) SetScale

func (ms ExponentialHistogramDataPoint) SetScale(v int32)

SetScale replaces the scale associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) SetStartTimestamp

func (ms ExponentialHistogramDataPoint) SetStartTimestamp(v Timestamp)

SetStartTimestamp replaces the starttimestamp associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) SetSum

SetSum replaces the sum associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) SetTimestamp

func (ms ExponentialHistogramDataPoint) SetTimestamp(v Timestamp)

SetTimestamp replaces the timestamp associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) SetZeroCount

func (ms ExponentialHistogramDataPoint) SetZeroCount(v uint64)

SetZeroCount replaces the zerocount associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) StartTimestamp

func (ms ExponentialHistogramDataPoint) StartTimestamp() Timestamp

StartTimestamp returns the starttimestamp associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) Sum

Sum returns the sum associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) Timestamp

Timestamp returns the timestamp associated with this ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPoint) ZeroCount

func (ms ExponentialHistogramDataPoint) ZeroCount() uint64

ZeroCount returns the zerocount associated with this ExponentialHistogramDataPoint.

type ExponentialHistogramDataPointSlice

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

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.

func NewExponentialHistogramDataPointSlice

func NewExponentialHistogramDataPointSlice() ExponentialHistogramDataPointSlice

NewExponentialHistogramDataPointSlice creates a ExponentialHistogramDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ExponentialHistogramDataPointSlice) AppendEmpty

AppendEmpty will append to the end of the slice an empty ExponentialHistogramDataPoint. It returns the newly added ExponentialHistogramDataPoint.

func (ExponentialHistogramDataPointSlice) At

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ExponentialHistogramDataPointSlice) CopyTo

CopyTo copies all elements from the current slice to the dest.

func (ExponentialHistogramDataPointSlice) EnsureCapacity

func (es ExponentialHistogramDataPointSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ExponentialHistogramDataPointSlice can be initialized:

es := NewExponentialHistogramDataPointSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ExponentialHistogramDataPointSlice) Len

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewExponentialHistogramDataPointSlice()".

func (ExponentialHistogramDataPointSlice) MoveAndAppendTo

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ExponentialHistogramDataPointSlice) RemoveIf

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ExponentialHistogramDataPointSlice) Sort

Sort sorts the ExponentialHistogramDataPoint elements within ExponentialHistogramDataPointSlice given the provided less function so that two instances of ExponentialHistogramDataPointSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b ExponentialHistogramDataPoint) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type Gauge

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

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.

func NewGauge

func NewGauge() Gauge

NewGauge creates a new empty Gauge.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (Gauge) CopyTo

func (ms Gauge) CopyTo(dest Gauge)

CopyTo copies all properties from the current struct to the dest.

func (Gauge) DataPoints

func (ms Gauge) DataPoints() NumberDataPointSlice

DataPoints returns the DataPoints associated with this Gauge.

func (Gauge) MoveTo

func (ms Gauge) MoveTo(dest Gauge)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

type Histogram

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

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.

func NewHistogram

func NewHistogram() Histogram

NewHistogram creates a new empty Histogram.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (Histogram) AggregationTemporality

func (ms Histogram) AggregationTemporality() MetricAggregationTemporality

AggregationTemporality returns the aggregationtemporality associated with this Histogram.

func (Histogram) CopyTo

func (ms Histogram) CopyTo(dest Histogram)

CopyTo copies all properties from the current struct to the dest.

func (Histogram) DataPoints

func (ms Histogram) DataPoints() HistogramDataPointSlice

DataPoints returns the DataPoints associated with this Histogram.

func (Histogram) MoveTo

func (ms Histogram) MoveTo(dest Histogram)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (Histogram) SetAggregationTemporality

func (ms Histogram) SetAggregationTemporality(v MetricAggregationTemporality)

SetAggregationTemporality replaces the aggregationtemporality associated with this Histogram.

type HistogramDataPoint

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

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.

func NewHistogramDataPoint

func NewHistogramDataPoint() HistogramDataPoint

NewHistogramDataPoint creates a new empty HistogramDataPoint.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (HistogramDataPoint) Attributes

func (ms HistogramDataPoint) Attributes() Map

Attributes returns the Attributes associated with this HistogramDataPoint.

func (HistogramDataPoint) CopyTo

func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint)

CopyTo copies all properties from the current struct to the dest.

func (HistogramDataPoint) Count

func (ms HistogramDataPoint) Count() uint64

Count returns the count associated with this HistogramDataPoint.

func (HistogramDataPoint) Exemplars

func (ms HistogramDataPoint) Exemplars() ExemplarSlice

Exemplars returns the Exemplars associated with this HistogramDataPoint.

func (HistogramDataPoint) Flags

Flags returns the flags associated with this HistogramDataPoint.

func (HistogramDataPoint) HasMax added in v0.52.0

func (ms HistogramDataPoint) HasMax() bool

HasMax returns true if the HistogramDataPoint contains a Max value, false otherwise.

func (HistogramDataPoint) HasMin added in v0.52.0

func (ms HistogramDataPoint) HasMin() bool

HasMin returns true if the HistogramDataPoint contains a Min value, false otherwise.

func (HistogramDataPoint) HasSum

func (ms HistogramDataPoint) HasSum() bool

HasSum returns true if the HistogramDataPoint contains a Sum value, false otherwise.

func (HistogramDataPoint) MBucketCounts added in v0.51.0

func (ms HistogramDataPoint) MBucketCounts() []uint64

MBucketCounts returns the mbucketcounts associated with this HistogramDataPoint.

func (HistogramDataPoint) MExplicitBounds added in v0.51.0

func (ms HistogramDataPoint) MExplicitBounds() []float64

MExplicitBounds returns the mexplicitbounds associated with this HistogramDataPoint.

func (HistogramDataPoint) Max added in v0.52.0

func (ms HistogramDataPoint) Max() float64

Max returns the max associated with this HistogramDataPoint.

func (HistogramDataPoint) Min added in v0.52.0

func (ms HistogramDataPoint) Min() float64

Min returns the min associated with this HistogramDataPoint.

func (HistogramDataPoint) MoveTo

func (ms HistogramDataPoint) MoveTo(dest HistogramDataPoint)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (HistogramDataPoint) SetCount

func (ms HistogramDataPoint) SetCount(v uint64)

SetCount replaces the count associated with this HistogramDataPoint.

func (HistogramDataPoint) SetFlags

SetFlags replaces the flags associated with this HistogramDataPoint.

func (HistogramDataPoint) SetMBucketCounts added in v0.51.0

func (ms HistogramDataPoint) SetMBucketCounts(v []uint64)

SetMBucketCounts replaces the mbucketcounts associated with this HistogramDataPoint.

func (HistogramDataPoint) SetMExplicitBounds added in v0.51.0

func (ms HistogramDataPoint) SetMExplicitBounds(v []float64)

SetMExplicitBounds replaces the mexplicitbounds associated with this HistogramDataPoint.

func (HistogramDataPoint) SetMax added in v0.52.0

func (ms HistogramDataPoint) SetMax(v float64)

SetMax replaces the max associated with this HistogramDataPoint.

func (HistogramDataPoint) SetMin added in v0.52.0

func (ms HistogramDataPoint) SetMin(v float64)

SetMin replaces the min associated with this HistogramDataPoint.

func (HistogramDataPoint) SetStartTimestamp

func (ms HistogramDataPoint) SetStartTimestamp(v Timestamp)

SetStartTimestamp replaces the starttimestamp associated with this HistogramDataPoint.

func (HistogramDataPoint) SetSum

func (ms HistogramDataPoint) SetSum(v float64)

SetSum replaces the sum associated with this HistogramDataPoint.

func (HistogramDataPoint) SetTimestamp

func (ms HistogramDataPoint) SetTimestamp(v Timestamp)

SetTimestamp replaces the timestamp associated with this HistogramDataPoint.

func (HistogramDataPoint) StartTimestamp

func (ms HistogramDataPoint) StartTimestamp() Timestamp

StartTimestamp returns the starttimestamp associated with this HistogramDataPoint.

func (HistogramDataPoint) Sum

func (ms HistogramDataPoint) Sum() float64

Sum returns the sum associated with this HistogramDataPoint.

func (HistogramDataPoint) Timestamp

func (ms HistogramDataPoint) Timestamp() Timestamp

Timestamp returns the timestamp associated with this HistogramDataPoint.

type HistogramDataPointSlice

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

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.

func NewHistogramDataPointSlice

func NewHistogramDataPointSlice() HistogramDataPointSlice

NewHistogramDataPointSlice creates a HistogramDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (HistogramDataPointSlice) AppendEmpty

AppendEmpty will append to the end of the slice an empty HistogramDataPoint. It returns the newly added HistogramDataPoint.

func (HistogramDataPointSlice) At

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (HistogramDataPointSlice) CopyTo

CopyTo copies all elements from the current slice to the dest.

func (HistogramDataPointSlice) EnsureCapacity

func (es HistogramDataPointSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new HistogramDataPointSlice can be initialized:

es := NewHistogramDataPointSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (HistogramDataPointSlice) Len

func (es HistogramDataPointSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewHistogramDataPointSlice()".

func (HistogramDataPointSlice) MoveAndAppendTo

func (es HistogramDataPointSlice) MoveAndAppendTo(dest HistogramDataPointSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (HistogramDataPointSlice) RemoveIf

func (es HistogramDataPointSlice) RemoveIf(f func(HistogramDataPoint) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (HistogramDataPointSlice) Sort

Sort sorts the HistogramDataPoint elements within HistogramDataPointSlice given the provided less function so that two instances of HistogramDataPointSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b HistogramDataPoint) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type InstrumentationScope

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

InstrumentationScope is a message representing the instrumentation scope information.

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewInstrumentationScope function to create new instances. Important: zero-initialized instance is not valid for use.

func NewInstrumentationScope

func NewInstrumentationScope() InstrumentationScope

NewInstrumentationScope creates a new empty InstrumentationScope.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (InstrumentationScope) CopyTo

CopyTo copies all properties from the current struct to the dest.

func (InstrumentationScope) MoveTo

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (InstrumentationScope) Name

func (ms InstrumentationScope) Name() string

Name returns the name associated with this InstrumentationScope.

func (InstrumentationScope) SetName

func (ms InstrumentationScope) SetName(v string)

SetName replaces the name associated with this InstrumentationScope.

func (InstrumentationScope) SetVersion

func (ms InstrumentationScope) SetVersion(v string)

SetVersion replaces the version associated with this InstrumentationScope.

func (InstrumentationScope) Version

func (ms InstrumentationScope) Version() string

Version returns the version associated with this InstrumentationScope.

type LogRecord

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

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewLogRecord function to create new instances. Important: zero-initialized instance is not valid for use.

func NewLogRecord

func NewLogRecord() LogRecord

NewLogRecord creates a new empty LogRecord.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (LogRecord) Attributes

func (ms LogRecord) Attributes() Map

Attributes returns the Attributes associated with this LogRecord.

func (LogRecord) Body

func (ms LogRecord) Body() Value

Body returns the body associated with this LogRecord.

func (LogRecord) CopyTo

func (ms LogRecord) CopyTo(dest LogRecord)

CopyTo copies all properties from the current struct to the dest.

func (LogRecord) DroppedAttributesCount

func (ms LogRecord) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this LogRecord.

func (LogRecord) Flags

func (ms LogRecord) Flags() uint32

Flags returns the flags associated with this LogRecord.

func (LogRecord) MoveTo

func (ms LogRecord) MoveTo(dest LogRecord)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (LogRecord) ObservedTimestamp

func (ms LogRecord) ObservedTimestamp() Timestamp

ObservedTimestamp returns the observedtimestamp associated with this LogRecord.

func (LogRecord) SetDroppedAttributesCount

func (ms LogRecord) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this LogRecord.

func (LogRecord) SetFlags

func (ms LogRecord) SetFlags(v uint32)

SetFlags replaces the flags associated with this LogRecord.

func (LogRecord) SetObservedTimestamp

func (ms LogRecord) SetObservedTimestamp(v Timestamp)

SetObservedTimestamp replaces the observedtimestamp associated with this LogRecord.

func (LogRecord) SetSeverityNumber

func (ms LogRecord) SetSeverityNumber(v SeverityNumber)

SetSeverityNumber replaces the severitynumber associated with this LogRecord.

func (LogRecord) SetSeverityText

func (ms LogRecord) SetSeverityText(v string)

SetSeverityText replaces the severitytext associated with this LogRecord.

func (LogRecord) SetSpanID

func (ms LogRecord) SetSpanID(v SpanID)

SetSpanID replaces the spanid associated with this LogRecord.

func (LogRecord) SetTimestamp

func (ms LogRecord) SetTimestamp(v Timestamp)

SetTimestamp replaces the timestamp associated with this LogRecord.

func (LogRecord) SetTraceID

func (ms LogRecord) SetTraceID(v TraceID)

SetTraceID replaces the traceid associated with this LogRecord.

func (LogRecord) SeverityNumber

func (ms LogRecord) SeverityNumber() SeverityNumber

SeverityNumber returns the severitynumber associated with this LogRecord.

func (LogRecord) SeverityText

func (ms LogRecord) SeverityText() string

SeverityText returns the severitytext associated with this LogRecord.

func (LogRecord) SpanID

func (ms LogRecord) SpanID() SpanID

SpanID returns the spanid associated with this LogRecord.

func (LogRecord) Timestamp

func (ms LogRecord) Timestamp() Timestamp

Timestamp returns the timestamp associated with this LogRecord.

func (LogRecord) TraceID

func (ms LogRecord) TraceID() TraceID

TraceID returns the traceid associated with this LogRecord.

type LogRecordSlice

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

LogRecordSlice logically represents a slice of LogRecord.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewLogRecordSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewLogRecordSlice

func NewLogRecordSlice() LogRecordSlice

NewLogRecordSlice creates a LogRecordSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (LogRecordSlice) AppendEmpty

func (es LogRecordSlice) AppendEmpty() LogRecord

AppendEmpty will append to the end of the slice an empty LogRecord. It returns the newly added LogRecord.

func (LogRecordSlice) At

func (es LogRecordSlice) At(ix int) LogRecord

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (LogRecordSlice) CopyTo

func (es LogRecordSlice) CopyTo(dest LogRecordSlice)

CopyTo copies all elements from the current slice to the dest.

func (LogRecordSlice) EnsureCapacity

func (es LogRecordSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new LogRecordSlice can be initialized:

es := NewLogRecordSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (LogRecordSlice) Len

func (es LogRecordSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewLogRecordSlice()".

func (LogRecordSlice) MoveAndAppendTo

func (es LogRecordSlice) MoveAndAppendTo(dest LogRecordSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (LogRecordSlice) RemoveIf

func (es LogRecordSlice) RemoveIf(f func(LogRecord) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (LogRecordSlice) Sort

func (es LogRecordSlice) Sort(less func(a, b LogRecord) bool) LogRecordSlice

Sort sorts the LogRecord elements within LogRecordSlice given the provided less function so that two instances of LogRecordSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b LogRecord) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type Logs

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

Logs is the top-level struct that is propagated through the logs pipeline. Use NewLogs to create new instance, zero-initialized instance is not valid for use.

func LogsFromOtlp

LogsFromOtlp internal helper to convert otlp request representation to Logs.

func LogsFromProto added in v0.50.0

func LogsFromProto(orig otlplogs.LogsData) Logs

LogsFromProto internal helper to convert protobuf representation to Logs.

func NewLogs

func NewLogs() Logs

NewLogs creates a new Logs struct.

func (Logs) Clone

func (ld Logs) Clone() Logs

Clone returns a copy of Logs.

func (Logs) LogRecordCount

func (ld Logs) LogRecordCount() int

LogRecordCount calculates the total number of log records.

func (Logs) MoveTo

func (ld Logs) MoveTo(dest Logs)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value.

func (Logs) ResourceLogs

func (ld Logs) ResourceLogs() ResourceLogsSlice

ResourceLogs returns the ResourceLogsSlice associated with this Logs.

type Map

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

Map stores a map of string keys to elements of Value type.

func NewMap

func NewMap() Map

NewMap creates a Map with 0 elements.

func NewMapFromRaw

func NewMapFromRaw(rawMap map[string]interface{}) Map

NewMapFromRaw creates a Map with values from the given map[string]interface{}.

func (Map) AsRaw

func (m Map) AsRaw() map[string]interface{}

AsRaw converts an OTLP Map to a standard go map

func (Map) Clear

func (m Map) Clear()

Clear erases any existing entries in this Map instance.

func (Map) CopyTo

func (m Map) CopyTo(dest Map)

CopyTo copies all elements from the current map to the dest.

func (Map) EnsureCapacity

func (m Map) EnsureCapacity(capacity int)

EnsureCapacity increases the capacity of this Map instance, if necessary, to ensure that it can hold at least the number of elements specified by the capacity argument.

func (Map) Get

func (m Map) Get(key string) (Value, bool)

Get returns the Value associated with the key and true. Returned Value is not a copy, it is a reference to the value stored in this map. It is allowed to modify the returned value using Value.Set* functions. Such modification will be applied to the value stored in this map.

If the key does not exist returns an invalid instance of the KeyValue and false. Calling any functions on the returned invalid instance will cause a panic.

func (Map) Insert

func (m Map) Insert(k string, v Value)

Insert adds the Value to the map when the key does not exist. No action is applied to the map where the key already exists.

Calling this function with a zero-initialized Value struct will cause a panic.

Important: this function should not be used if the caller has access to the raw value to avoid an extra allocation.

func (Map) InsertBool

func (m Map) InsertBool(k string, v bool)

InsertBool adds the bool Value to the map when the key does not exist. No action is applied to the map where the key already exists.

func (Map) InsertDouble

func (m Map) InsertDouble(k string, v float64)

InsertDouble adds the double Value to the map when the key does not exist. No action is applied to the map where the key already exists.

func (Map) InsertInt

func (m Map) InsertInt(k string, v int64)

InsertInt adds the int Value to the map when the key does not exist. No action is applied to the map where the key already exists.

func (Map) InsertMBytes added in v0.51.0

func (m Map) InsertMBytes(k string, v []byte)

InsertMBytes adds the []byte Value to the map when the key does not exist. No action is applied to the map where the key already exists. The caller must ensure the []byte passed in is not modified after the call is made, sharing the data across multiple attributes is forbidden.

func (Map) InsertNull

func (m Map) InsertNull(k string)

InsertNull adds a null Value to the map when the key does not exist. No action is applied to the map where the key already exists.

func (Map) InsertString

func (m Map) InsertString(k string, v string)

InsertString adds the string Value to the map when the key does not exist. No action is applied to the map where the key already exists.

func (Map) Len

func (m Map) Len() int

Len returns the length of this map.

Because the Map is represented internally by a slice of pointers, and the data are comping from the wire, it is possible that when iterating using "Range" to get access to fewer elements because nil elements are skipped.

func (Map) Range

func (m Map) Range(f func(k string, v Value) bool)

Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.

Example:

sm.Range(func(k string, v Value) bool {
    ...
})

func (Map) Remove

func (m Map) Remove(key string) bool

Remove removes the entry associated with the key and returns true if the key was present in the map, otherwise returns false.

func (Map) RemoveIf

func (m Map) RemoveIf(f func(string, Value) bool)

RemoveIf removes the entries for which the function in question returns true

func (Map) Sort

func (m Map) Sort() Map

Sort sorts the entries in the Map so two instances can be compared. Returns the same instance to allow nicer code like:

assert.EqualValues(t, expected.Sort(), actual.Sort())

func (Map) Update

func (m Map) Update(k string, v Value)

Update updates an existing Value with a value. No action is applied to the map where the key does not exist.

Calling this function with a zero-initialized Value struct will cause a panic.

Important: this function should not be used if the caller has access to the raw value to avoid an extra allocation.

func (Map) UpdateBool

func (m Map) UpdateBool(k string, v bool)

UpdateBool updates an existing bool Value with a value. No action is applied to the map where the key does not exist.

func (Map) UpdateDouble

func (m Map) UpdateDouble(k string, v float64)

UpdateDouble updates an existing double Value with a value. No action is applied to the map where the key does not exist.

func (Map) UpdateInt

func (m Map) UpdateInt(k string, v int64)

UpdateInt updates an existing int Value with a value. No action is applied to the map where the key does not exist.

func (Map) UpdateMBytes added in v0.51.0

func (m Map) UpdateMBytes(k string, v []byte)

UpdateMBytes updates an existing []byte Value with a value. No action is applied to the map where the key does not exist. The caller must ensure the []byte passed in is not modified after the call is made, sharing the data across multiple attributes is forbidden.

func (Map) UpdateString

func (m Map) UpdateString(k string, v string)

UpdateString updates an existing string Value with a value. No action is applied to the map where the key does not exist.

func (Map) Upsert

func (m Map) Upsert(k string, v Value)

Upsert performs the Insert or Update action. The Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed.

Calling this function with a zero-initialized Value struct will cause a panic.

Important: this function should not be used if the caller has access to the raw value to avoid an extra allocation.

func (Map) UpsertBool

func (m Map) UpsertBool(k string, v bool)

UpsertBool performs the Insert or Update action. The bool Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed.

func (Map) UpsertDouble

func (m Map) UpsertDouble(k string, v float64)

UpsertDouble performs the Insert or Update action. The double Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed.

func (Map) UpsertInt

func (m Map) UpsertInt(k string, v int64)

UpsertInt performs the Insert or Update action. The int Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed.

func (Map) UpsertMBytes added in v0.51.0

func (m Map) UpsertMBytes(k string, v []byte)

UpsertMBytes performs the Insert or Update action. The []byte Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed. The caller must ensure the []byte passed in is not modified after the call is made, sharing the data across multiple attributes is forbidden.

func (Map) UpsertString

func (m Map) UpsertString(k string, v string)

UpsertString performs the Insert or Update action. The Value is inserted to the map that did not originally have the key. The key/value is updated to the map where the key already existed.

type Metric

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

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.

func NewMetric

func NewMetric() Metric

NewMetric creates a new empty Metric.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (Metric) CopyTo

func (ms Metric) CopyTo(dest Metric)

CopyTo copies all properties from the current struct to the dest.

func (Metric) DataType

func (ms Metric) DataType() MetricDataType

DataType returns the type of the data for this Metric. Calling this function on zero-initialized Metric will cause a panic.

func (Metric) Description

func (ms Metric) Description() string

Description returns the description associated with this Metric.

func (Metric) ExponentialHistogram

func (ms Metric) ExponentialHistogram() ExponentialHistogram

ExponentialHistogram returns the exponentialhistogram associated with this Metric.

Calling this function when DataType() != MetricDataTypeExponentialHistogram returns an invalid zero-initialized instance of ExponentialHistogram. Note that using such ExponentialHistogram instance can cause panic.

Calling this function on zero-initialized Metric will cause a panic.

func (Metric) Gauge

func (ms Metric) Gauge() Gauge

Gauge returns the gauge associated with this Metric.

Calling this function when DataType() != MetricDataTypeGauge returns an invalid zero-initialized instance of Gauge. Note that using such Gauge instance can cause panic.

Calling this function on zero-initialized Metric will cause a panic.

func (Metric) Histogram

func (ms Metric) Histogram() Histogram

Histogram returns the histogram associated with this Metric.

Calling this function when DataType() != MetricDataTypeHistogram returns an invalid zero-initialized instance of Histogram. Note that using such Histogram instance can cause panic.

Calling this function on zero-initialized Metric will cause a panic.

func (Metric) MoveTo

func (ms Metric) MoveTo(dest Metric)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (Metric) Name

func (ms Metric) Name() string

Name returns the name associated with this Metric.

func (Metric) SetDataType

func (ms Metric) SetDataType(ty MetricDataType)

SetDataType clears any existing data and initialize it with an empty data of the given type. Calling this function on zero-initialized Metric will cause a panic.

func (Metric) SetDescription

func (ms Metric) SetDescription(v string)

SetDescription replaces the description associated with this Metric.

func (Metric) SetName

func (ms Metric) SetName(v string)

SetName replaces the name associated with this Metric.

func (Metric) SetUnit

func (ms Metric) SetUnit(v string)

SetUnit replaces the unit associated with this Metric.

func (Metric) Sum

func (ms Metric) Sum() Sum

Sum returns the sum associated with this Metric.

Calling this function when DataType() != MetricDataTypeSum returns an invalid zero-initialized instance of Sum. Note that using such Sum instance can cause panic.

Calling this function on zero-initialized Metric will cause a panic.

func (Metric) Summary

func (ms Metric) Summary() Summary

Summary returns the summary associated with this Metric.

Calling this function when DataType() != MetricDataTypeSummary returns an invalid zero-initialized instance of Summary. Note that using such Summary instance can cause panic.

Calling this function on zero-initialized Metric will cause a panic.

func (Metric) Unit

func (ms Metric) Unit() string

Unit returns the unit associated with this Metric.

type MetricAggregationTemporality

type MetricAggregationTemporality int32

MetricAggregationTemporality defines how a metric aggregator reports aggregated values. It describes how those values relate to the time interval over which they are aggregated.

func (MetricAggregationTemporality) String

String returns the string representation of the MetricAggregationTemporality.

type MetricDataPointFlag

type MetricDataPointFlag uint32

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.

type MetricDataPointFlags

type MetricDataPointFlags uint32

MetricDataPointFlags defines how a metric aggregator reports aggregated values. It describes how those values relate to the time interval over which they are aggregated.

func NewMetricDataPointFlags

func NewMetricDataPointFlags(flags ...MetricDataPointFlag) MetricDataPointFlags

NewMetricDataPointFlags returns a new MetricDataPointFlags combining the flags passed in as parameters.

func (MetricDataPointFlags) HasFlag

HasFlag returns true if the MetricDataPointFlags contains the specified flag

func (MetricDataPointFlags) String

func (d MetricDataPointFlags) String() string

String returns the string representation of the MetricDataPointFlags.

type MetricDataType

type MetricDataType int32

MetricDataType specifies the type of data in a Metric.

const (
	MetricDataTypeNone MetricDataType = iota
	MetricDataTypeGauge
	MetricDataTypeSum
	MetricDataTypeHistogram
	MetricDataTypeExponentialHistogram
	MetricDataTypeSummary
)

func (MetricDataType) String

func (mdt MetricDataType) String() string

String returns the string representation of the MetricDataType.

type MetricSlice

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

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.

func NewMetricSlice

func NewMetricSlice() MetricSlice

NewMetricSlice creates a MetricSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (MetricSlice) AppendEmpty

func (es MetricSlice) AppendEmpty() Metric

AppendEmpty will append to the end of the slice an empty Metric. It returns the newly added Metric.

func (MetricSlice) At

func (es MetricSlice) At(ix int) Metric

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (MetricSlice) CopyTo

func (es MetricSlice) CopyTo(dest MetricSlice)

CopyTo copies all elements from the current slice to the dest.

func (MetricSlice) EnsureCapacity

func (es MetricSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new MetricSlice can be initialized:

es := NewMetricSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (MetricSlice) Len

func (es MetricSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewMetricSlice()".

func (MetricSlice) MoveAndAppendTo

func (es MetricSlice) MoveAndAppendTo(dest MetricSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (MetricSlice) RemoveIf

func (es MetricSlice) RemoveIf(f func(Metric) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (MetricSlice) Sort

func (es MetricSlice) Sort(less func(a, b Metric) bool) MetricSlice

Sort sorts the Metric elements within MetricSlice given the provided less function so that two instances of MetricSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b Metric) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type Metrics

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

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.

func MetricsFromOtlp

MetricsFromOtlp internal helper to convert otlp request representation to Metrics.

func MetricsFromProto added in v0.50.0

func MetricsFromProto(orig otlpmetrics.MetricsData) Metrics

MetricsFromProto internal helper to convert protobuf representation to Metrics.

func NewMetrics

func NewMetrics() Metrics

NewMetrics creates a new Metrics struct.

func (Metrics) Clone

func (md Metrics) Clone() Metrics

Clone returns a copy of MetricData.

func (Metrics) DataPointCount

func (md Metrics) DataPointCount() (dataPointCount int)

DataPointCount calculates the total number of data points.

func (Metrics) MetricCount

func (md Metrics) MetricCount() int

MetricCount calculates the total number of metrics.

func (Metrics) MoveTo

func (md Metrics) MoveTo(dest Metrics)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value.

func (Metrics) ResourceMetrics

func (md Metrics) ResourceMetrics() ResourceMetricsSlice

ResourceMetrics returns the ResourceMetricsSlice associated with this Metrics.

type NumberDataPoint

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

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.

func NewNumberDataPoint

func NewNumberDataPoint() NumberDataPoint

NewNumberDataPoint creates a new empty NumberDataPoint.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (NumberDataPoint) Attributes

func (ms NumberDataPoint) Attributes() Map

Attributes returns the Attributes associated with this NumberDataPoint.

func (NumberDataPoint) CopyTo

func (ms NumberDataPoint) CopyTo(dest NumberDataPoint)

CopyTo copies all properties from the current struct to the dest.

func (NumberDataPoint) DoubleVal

func (ms NumberDataPoint) DoubleVal() float64

DoubleVal returns the doubleval associated with this NumberDataPoint.

func (NumberDataPoint) Exemplars

func (ms NumberDataPoint) Exemplars() ExemplarSlice

Exemplars returns the Exemplars associated with this NumberDataPoint.

func (NumberDataPoint) Flags

Flags returns the flags associated with this NumberDataPoint.

func (NumberDataPoint) IntVal

func (ms NumberDataPoint) IntVal() int64

IntVal returns the intval associated with this NumberDataPoint.

func (NumberDataPoint) MoveTo

func (ms NumberDataPoint) MoveTo(dest NumberDataPoint)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (NumberDataPoint) SetDoubleVal

func (ms NumberDataPoint) SetDoubleVal(v float64)

SetDoubleVal replaces the doubleval associated with this NumberDataPoint.

func (NumberDataPoint) SetFlags

func (ms NumberDataPoint) SetFlags(v MetricDataPointFlags)

SetFlags replaces the flags associated with this NumberDataPoint.

func (NumberDataPoint) SetIntVal

func (ms NumberDataPoint) SetIntVal(v int64)

SetIntVal replaces the intval associated with this NumberDataPoint.

func (NumberDataPoint) SetStartTimestamp

func (ms NumberDataPoint) SetStartTimestamp(v Timestamp)

SetStartTimestamp replaces the starttimestamp associated with this NumberDataPoint.

func (NumberDataPoint) SetTimestamp

func (ms NumberDataPoint) SetTimestamp(v Timestamp)

SetTimestamp replaces the timestamp associated with this NumberDataPoint.

func (NumberDataPoint) StartTimestamp

func (ms NumberDataPoint) StartTimestamp() Timestamp

StartTimestamp returns the starttimestamp associated with this NumberDataPoint.

func (NumberDataPoint) Timestamp

func (ms NumberDataPoint) Timestamp() Timestamp

Timestamp returns the timestamp associated with this NumberDataPoint.

func (NumberDataPoint) ValueType

ValueType returns the type of the value for this NumberDataPoint. Calling this function on zero-initialized NumberDataPoint will cause a panic.

type NumberDataPointSlice

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

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.

func NewNumberDataPointSlice

func NewNumberDataPointSlice() NumberDataPointSlice

NewNumberDataPointSlice creates a NumberDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (NumberDataPointSlice) AppendEmpty

func (es NumberDataPointSlice) AppendEmpty() NumberDataPoint

AppendEmpty will append to the end of the slice an empty NumberDataPoint. It returns the newly added NumberDataPoint.

func (NumberDataPointSlice) At

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (NumberDataPointSlice) CopyTo

CopyTo copies all elements from the current slice to the dest.

func (NumberDataPointSlice) EnsureCapacity

func (es NumberDataPointSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new NumberDataPointSlice can be initialized:

es := NewNumberDataPointSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (NumberDataPointSlice) Len

func (es NumberDataPointSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewNumberDataPointSlice()".

func (NumberDataPointSlice) MoveAndAppendTo

func (es NumberDataPointSlice) MoveAndAppendTo(dest NumberDataPointSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (NumberDataPointSlice) RemoveIf

func (es NumberDataPointSlice) RemoveIf(f func(NumberDataPoint) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (NumberDataPointSlice) Sort

Sort sorts the NumberDataPoint elements within NumberDataPointSlice given the provided less function so that two instances of NumberDataPointSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b NumberDataPoint) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type NumberDataPointValueType added in v0.50.0

type NumberDataPointValueType int32

NumberDataPointValueType specifies the type of NumberDataPoint value.

const (
	NumberDataPointValueTypeNone NumberDataPointValueType = iota
	NumberDataPointValueTypeInt
	NumberDataPointValueTypeDouble
)

func (NumberDataPointValueType) String added in v0.50.0

func (nt NumberDataPointValueType) String() string

String returns the string representation of the NumberDataPointValueType.

type OptionalType

type OptionalType int32

OptionalType wraps optional fields into oneof fields

const (
	OptionalTypeNone OptionalType = iota
	OptionalTypeDouble
)

func (OptionalType) String

func (ot OptionalType) String() string

String returns the string representation of the OptionalType.

type Resource

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

Resource is a message representing the resource information.

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewResource function to create new instances. Important: zero-initialized instance is not valid for use.

func NewResource

func NewResource() Resource

NewResource creates a new empty Resource.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (Resource) Attributes

func (ms Resource) Attributes() Map

Attributes returns the Attributes associated with this Resource.

func (Resource) CopyTo

func (ms Resource) CopyTo(dest Resource)

CopyTo copies all properties from the current struct to the dest.

func (Resource) DroppedAttributesCount

func (ms Resource) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this Resource.

func (Resource) MoveTo

func (ms Resource) MoveTo(dest Resource)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (Resource) SetDroppedAttributesCount

func (ms Resource) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this Resource.

type ResourceLogs

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

ResourceLogs is a collection of logs from a Resource.

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewResourceLogs function to create new instances. Important: zero-initialized instance is not valid for use.

func NewResourceLogs

func NewResourceLogs() ResourceLogs

NewResourceLogs creates a new empty ResourceLogs.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ResourceLogs) CopyTo

func (ms ResourceLogs) CopyTo(dest ResourceLogs)

CopyTo copies all properties from the current struct to the dest.

func (ResourceLogs) MoveTo

func (ms ResourceLogs) MoveTo(dest ResourceLogs)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (ResourceLogs) Resource

func (ms ResourceLogs) Resource() Resource

Resource returns the resource associated with this ResourceLogs.

func (ResourceLogs) SchemaUrl

func (ms ResourceLogs) SchemaUrl() string

SchemaUrl returns the schemaurl associated with this ResourceLogs.

func (ResourceLogs) ScopeLogs

func (ms ResourceLogs) ScopeLogs() ScopeLogsSlice

ScopeLogs returns the ScopeLogs associated with this ResourceLogs.

func (ResourceLogs) SetSchemaUrl

func (ms ResourceLogs) SetSchemaUrl(v string)

SetSchemaUrl replaces the schemaurl associated with this ResourceLogs.

type ResourceLogsSlice

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

ResourceLogsSlice logically represents a slice of ResourceLogs.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewResourceLogsSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewResourceLogsSlice

func NewResourceLogsSlice() ResourceLogsSlice

NewResourceLogsSlice creates a ResourceLogsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ResourceLogsSlice) AppendEmpty

func (es ResourceLogsSlice) AppendEmpty() ResourceLogs

AppendEmpty will append to the end of the slice an empty ResourceLogs. It returns the newly added ResourceLogs.

func (ResourceLogsSlice) At

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ResourceLogsSlice) CopyTo

func (es ResourceLogsSlice) CopyTo(dest ResourceLogsSlice)

CopyTo copies all elements from the current slice to the dest.

func (ResourceLogsSlice) EnsureCapacity

func (es ResourceLogsSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ResourceLogsSlice can be initialized:

es := NewResourceLogsSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ResourceLogsSlice) Len

func (es ResourceLogsSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewResourceLogsSlice()".

func (ResourceLogsSlice) MoveAndAppendTo

func (es ResourceLogsSlice) MoveAndAppendTo(dest ResourceLogsSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ResourceLogsSlice) RemoveIf

func (es ResourceLogsSlice) RemoveIf(f func(ResourceLogs) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ResourceLogsSlice) Sort

func (es ResourceLogsSlice) Sort(less func(a, b ResourceLogs) bool) ResourceLogsSlice

Sort sorts the ResourceLogs elements within ResourceLogsSlice given the provided less function so that two instances of ResourceLogsSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b ResourceLogs) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type ResourceMetrics

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

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.

func NewResourceMetrics

func NewResourceMetrics() ResourceMetrics

NewResourceMetrics creates a new empty ResourceMetrics.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ResourceMetrics) CopyTo

func (ms ResourceMetrics) CopyTo(dest ResourceMetrics)

CopyTo copies all properties from the current struct to the dest.

func (ResourceMetrics) MoveTo

func (ms ResourceMetrics) MoveTo(dest ResourceMetrics)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (ResourceMetrics) Resource

func (ms ResourceMetrics) Resource() Resource

Resource returns the resource associated with this ResourceMetrics.

func (ResourceMetrics) SchemaUrl

func (ms ResourceMetrics) SchemaUrl() string

SchemaUrl returns the schemaurl associated with this ResourceMetrics.

func (ResourceMetrics) ScopeMetrics

func (ms ResourceMetrics) ScopeMetrics() ScopeMetricsSlice

ScopeMetrics returns the ScopeMetrics associated with this ResourceMetrics.

func (ResourceMetrics) SetSchemaUrl

func (ms ResourceMetrics) SetSchemaUrl(v string)

SetSchemaUrl replaces the schemaurl associated with this ResourceMetrics.

type ResourceMetricsSlice

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

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.

func NewResourceMetricsSlice

func NewResourceMetricsSlice() ResourceMetricsSlice

NewResourceMetricsSlice creates a ResourceMetricsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ResourceMetricsSlice) AppendEmpty

func (es ResourceMetricsSlice) AppendEmpty() ResourceMetrics

AppendEmpty will append to the end of the slice an empty ResourceMetrics. It returns the newly added ResourceMetrics.

func (ResourceMetricsSlice) At

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ResourceMetricsSlice) CopyTo

CopyTo copies all elements from the current slice to the dest.

func (ResourceMetricsSlice) EnsureCapacity

func (es ResourceMetricsSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ResourceMetricsSlice can be initialized:

es := NewResourceMetricsSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ResourceMetricsSlice) Len

func (es ResourceMetricsSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewResourceMetricsSlice()".

func (ResourceMetricsSlice) MoveAndAppendTo

func (es ResourceMetricsSlice) MoveAndAppendTo(dest ResourceMetricsSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ResourceMetricsSlice) RemoveIf

func (es ResourceMetricsSlice) RemoveIf(f func(ResourceMetrics) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ResourceMetricsSlice) Sort

Sort sorts the ResourceMetrics elements within ResourceMetricsSlice given the provided less function so that two instances of ResourceMetricsSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b ResourceMetrics) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type ResourceSpans

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

ResourceSpans is a collection of spans from a Resource.

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewResourceSpans function to create new instances. Important: zero-initialized instance is not valid for use.

func NewResourceSpans

func NewResourceSpans() ResourceSpans

NewResourceSpans creates a new empty ResourceSpans.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ResourceSpans) CopyTo

func (ms ResourceSpans) CopyTo(dest ResourceSpans)

CopyTo copies all properties from the current struct to the dest.

func (ResourceSpans) MoveTo

func (ms ResourceSpans) MoveTo(dest ResourceSpans)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (ResourceSpans) Resource

func (ms ResourceSpans) Resource() Resource

Resource returns the resource associated with this ResourceSpans.

func (ResourceSpans) SchemaUrl

func (ms ResourceSpans) SchemaUrl() string

SchemaUrl returns the schemaurl associated with this ResourceSpans.

func (ResourceSpans) ScopeSpans

func (ms ResourceSpans) ScopeSpans() ScopeSpansSlice

ScopeSpans returns the ScopeSpans associated with this ResourceSpans.

func (ResourceSpans) SetSchemaUrl

func (ms ResourceSpans) SetSchemaUrl(v string)

SetSchemaUrl replaces the schemaurl associated with this ResourceSpans.

type ResourceSpansSlice

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

ResourceSpansSlice logically represents a slice of ResourceSpans.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewResourceSpansSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewResourceSpansSlice

func NewResourceSpansSlice() ResourceSpansSlice

NewResourceSpansSlice creates a ResourceSpansSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ResourceSpansSlice) AppendEmpty

func (es ResourceSpansSlice) AppendEmpty() ResourceSpans

AppendEmpty will append to the end of the slice an empty ResourceSpans. It returns the newly added ResourceSpans.

func (ResourceSpansSlice) At

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ResourceSpansSlice) CopyTo

func (es ResourceSpansSlice) CopyTo(dest ResourceSpansSlice)

CopyTo copies all elements from the current slice to the dest.

func (ResourceSpansSlice) EnsureCapacity

func (es ResourceSpansSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ResourceSpansSlice can be initialized:

es := NewResourceSpansSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ResourceSpansSlice) Len

func (es ResourceSpansSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewResourceSpansSlice()".

func (ResourceSpansSlice) MoveAndAppendTo

func (es ResourceSpansSlice) MoveAndAppendTo(dest ResourceSpansSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ResourceSpansSlice) RemoveIf

func (es ResourceSpansSlice) RemoveIf(f func(ResourceSpans) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ResourceSpansSlice) Sort

func (es ResourceSpansSlice) Sort(less func(a, b ResourceSpans) bool) ResourceSpansSlice

Sort sorts the ResourceSpans elements within ResourceSpansSlice given the provided less function so that two instances of ResourceSpansSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b ResourceSpans) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type ScopeLogs

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

ScopeLogs is a collection of logs from a LibraryInstrumentation.

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewScopeLogs function to create new instances. Important: zero-initialized instance is not valid for use.

func NewScopeLogs

func NewScopeLogs() ScopeLogs

NewScopeLogs creates a new empty ScopeLogs.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ScopeLogs) CopyTo

func (ms ScopeLogs) CopyTo(dest ScopeLogs)

CopyTo copies all properties from the current struct to the dest.

func (ScopeLogs) LogRecords

func (ms ScopeLogs) LogRecords() LogRecordSlice

LogRecords returns the LogRecords associated with this ScopeLogs.

func (ScopeLogs) MoveTo

func (ms ScopeLogs) MoveTo(dest ScopeLogs)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (ScopeLogs) SchemaUrl

func (ms ScopeLogs) SchemaUrl() string

SchemaUrl returns the schemaurl associated with this ScopeLogs.

func (ScopeLogs) Scope

func (ms ScopeLogs) Scope() InstrumentationScope

Scope returns the scope associated with this ScopeLogs.

func (ScopeLogs) SetSchemaUrl

func (ms ScopeLogs) SetSchemaUrl(v string)

SetSchemaUrl replaces the schemaurl associated with this ScopeLogs.

type ScopeLogsSlice

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

ScopeLogsSlice logically represents a slice of ScopeLogs.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewScopeLogsSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewScopeLogsSlice

func NewScopeLogsSlice() ScopeLogsSlice

NewScopeLogsSlice creates a ScopeLogsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ScopeLogsSlice) AppendEmpty

func (es ScopeLogsSlice) AppendEmpty() ScopeLogs

AppendEmpty will append to the end of the slice an empty ScopeLogs. It returns the newly added ScopeLogs.

func (ScopeLogsSlice) At

func (es ScopeLogsSlice) At(ix int) ScopeLogs

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ScopeLogsSlice) CopyTo

func (es ScopeLogsSlice) CopyTo(dest ScopeLogsSlice)

CopyTo copies all elements from the current slice to the dest.

func (ScopeLogsSlice) EnsureCapacity

func (es ScopeLogsSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ScopeLogsSlice can be initialized:

es := NewScopeLogsSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ScopeLogsSlice) Len

func (es ScopeLogsSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewScopeLogsSlice()".

func (ScopeLogsSlice) MoveAndAppendTo

func (es ScopeLogsSlice) MoveAndAppendTo(dest ScopeLogsSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ScopeLogsSlice) RemoveIf

func (es ScopeLogsSlice) RemoveIf(f func(ScopeLogs) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ScopeLogsSlice) Sort

func (es ScopeLogsSlice) Sort(less func(a, b ScopeLogs) bool) ScopeLogsSlice

Sort sorts the ScopeLogs elements within ScopeLogsSlice given the provided less function so that two instances of ScopeLogsSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b ScopeLogs) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type ScopeMetrics

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

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.

func NewScopeMetrics

func NewScopeMetrics() ScopeMetrics

NewScopeMetrics creates a new empty ScopeMetrics.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ScopeMetrics) CopyTo

func (ms ScopeMetrics) CopyTo(dest ScopeMetrics)

CopyTo copies all properties from the current struct to the dest.

func (ScopeMetrics) Metrics

func (ms ScopeMetrics) Metrics() MetricSlice

Metrics returns the Metrics associated with this ScopeMetrics.

func (ScopeMetrics) MoveTo

func (ms ScopeMetrics) MoveTo(dest ScopeMetrics)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (ScopeMetrics) SchemaUrl

func (ms ScopeMetrics) SchemaUrl() string

SchemaUrl returns the schemaurl associated with this ScopeMetrics.

func (ScopeMetrics) Scope

Scope returns the scope associated with this ScopeMetrics.

func (ScopeMetrics) SetSchemaUrl

func (ms ScopeMetrics) SetSchemaUrl(v string)

SetSchemaUrl replaces the schemaurl associated with this ScopeMetrics.

type ScopeMetricsSlice

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

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.

func NewScopeMetricsSlice

func NewScopeMetricsSlice() ScopeMetricsSlice

NewScopeMetricsSlice creates a ScopeMetricsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ScopeMetricsSlice) AppendEmpty

func (es ScopeMetricsSlice) AppendEmpty() ScopeMetrics

AppendEmpty will append to the end of the slice an empty ScopeMetrics. It returns the newly added ScopeMetrics.

func (ScopeMetricsSlice) At

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ScopeMetricsSlice) CopyTo

func (es ScopeMetricsSlice) CopyTo(dest ScopeMetricsSlice)

CopyTo copies all elements from the current slice to the dest.

func (ScopeMetricsSlice) EnsureCapacity

func (es ScopeMetricsSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ScopeMetricsSlice can be initialized:

es := NewScopeMetricsSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ScopeMetricsSlice) Len

func (es ScopeMetricsSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewScopeMetricsSlice()".

func (ScopeMetricsSlice) MoveAndAppendTo

func (es ScopeMetricsSlice) MoveAndAppendTo(dest ScopeMetricsSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ScopeMetricsSlice) RemoveIf

func (es ScopeMetricsSlice) RemoveIf(f func(ScopeMetrics) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ScopeMetricsSlice) Sort

func (es ScopeMetricsSlice) Sort(less func(a, b ScopeMetrics) bool) ScopeMetricsSlice

Sort sorts the ScopeMetrics elements within ScopeMetricsSlice given the provided less function so that two instances of ScopeMetricsSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b ScopeMetrics) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type ScopeSpans

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

ScopeSpans is a collection of spans from a LibraryInstrumentation.

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewScopeSpans function to create new instances. Important: zero-initialized instance is not valid for use.

func NewScopeSpans

func NewScopeSpans() ScopeSpans

NewScopeSpans creates a new empty ScopeSpans.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ScopeSpans) CopyTo

func (ms ScopeSpans) CopyTo(dest ScopeSpans)

CopyTo copies all properties from the current struct to the dest.

func (ScopeSpans) MoveTo

func (ms ScopeSpans) MoveTo(dest ScopeSpans)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (ScopeSpans) SchemaUrl

func (ms ScopeSpans) SchemaUrl() string

SchemaUrl returns the schemaurl associated with this ScopeSpans.

func (ScopeSpans) Scope

func (ms ScopeSpans) Scope() InstrumentationScope

Scope returns the scope associated with this ScopeSpans.

func (ScopeSpans) SetSchemaUrl

func (ms ScopeSpans) SetSchemaUrl(v string)

SetSchemaUrl replaces the schemaurl associated with this ScopeSpans.

func (ScopeSpans) Spans

func (ms ScopeSpans) Spans() SpanSlice

Spans returns the Spans associated with this ScopeSpans.

type ScopeSpansSlice

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

ScopeSpansSlice logically represents a slice of ScopeSpans.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewScopeSpansSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewScopeSpansSlice

func NewScopeSpansSlice() ScopeSpansSlice

NewScopeSpansSlice creates a ScopeSpansSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ScopeSpansSlice) AppendEmpty

func (es ScopeSpansSlice) AppendEmpty() ScopeSpans

AppendEmpty will append to the end of the slice an empty ScopeSpans. It returns the newly added ScopeSpans.

func (ScopeSpansSlice) At

func (es ScopeSpansSlice) At(ix int) ScopeSpans

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ScopeSpansSlice) CopyTo

func (es ScopeSpansSlice) CopyTo(dest ScopeSpansSlice)

CopyTo copies all elements from the current slice to the dest.

func (ScopeSpansSlice) EnsureCapacity

func (es ScopeSpansSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ScopeSpansSlice can be initialized:

es := NewScopeSpansSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ScopeSpansSlice) Len

func (es ScopeSpansSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewScopeSpansSlice()".

func (ScopeSpansSlice) MoveAndAppendTo

func (es ScopeSpansSlice) MoveAndAppendTo(dest ScopeSpansSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ScopeSpansSlice) RemoveIf

func (es ScopeSpansSlice) RemoveIf(f func(ScopeSpans) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ScopeSpansSlice) Sort

func (es ScopeSpansSlice) Sort(less func(a, b ScopeSpans) bool) ScopeSpansSlice

Sort sorts the ScopeSpans elements within ScopeSpansSlice given the provided less function so that two instances of ScopeSpansSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b ScopeSpans) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type SeverityNumber

type SeverityNumber int32

SeverityNumber represents severity number of a log record.

func (SeverityNumber) String

func (sn SeverityNumber) String() string

String returns the string representation of the SeverityNumber.

type Slice

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

Slice logically represents a slice of Value.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewSlice

func NewSlice() Slice

NewSlice creates a Slice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func NewSliceFromRaw added in v0.51.0

func NewSliceFromRaw(rawSlice []interface{}) Slice

NewSliceFromRaw creates a Slice with values from the given []interface{}.

func (Slice) AppendEmpty

func (es Slice) AppendEmpty() Value

AppendEmpty will append to the end of the slice an empty Value. It returns the newly added Value.

func (Slice) AsRaw added in v0.51.0

func (es Slice) AsRaw() []interface{}

AsRaw converts the Slice to a standard go slice.

func (Slice) At

func (es Slice) At(ix int) Value

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (Slice) CopyTo

func (es Slice) CopyTo(dest Slice)

CopyTo copies all elements from the current slice to the dest.

func (Slice) EnsureCapacity

func (es Slice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new Slice can be initialized:

es := NewSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (Slice) Len

func (es Slice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewSlice()".

func (Slice) MoveAndAppendTo

func (es Slice) MoveAndAppendTo(dest Slice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (Slice) RemoveIf

func (es Slice) RemoveIf(f func(Value) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

type Span

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

Span represents a single operation within a trace. See Span definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewSpan function to create new instances. Important: zero-initialized instance is not valid for use.

func NewSpan

func NewSpan() Span

NewSpan creates a new empty Span.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (Span) Attributes

func (ms Span) Attributes() Map

Attributes returns the Attributes associated with this Span.

func (Span) CopyTo

func (ms Span) CopyTo(dest Span)

CopyTo copies all properties from the current struct to the dest.

func (Span) DroppedAttributesCount

func (ms Span) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this Span.

func (Span) DroppedEventsCount

func (ms Span) DroppedEventsCount() uint32

DroppedEventsCount returns the droppedeventscount associated with this Span.

func (Span) DroppedLinksCount

func (ms Span) DroppedLinksCount() uint32

DroppedLinksCount returns the droppedlinkscount associated with this Span.

func (Span) EndTimestamp

func (ms Span) EndTimestamp() Timestamp

EndTimestamp returns the endtimestamp associated with this Span.

func (Span) Events

func (ms Span) Events() SpanEventSlice

Events returns the Events associated with this Span.

func (Span) Kind

func (ms Span) Kind() SpanKind

Kind returns the kind associated with this Span.

func (ms Span) Links() SpanLinkSlice

Links returns the Links associated with this Span.

func (Span) MoveTo

func (ms Span) MoveTo(dest Span)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (Span) Name

func (ms Span) Name() string

Name returns the name associated with this Span.

func (Span) ParentSpanID

func (ms Span) ParentSpanID() SpanID

ParentSpanID returns the parentspanid associated with this Span.

func (Span) SetDroppedAttributesCount

func (ms Span) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this Span.

func (Span) SetDroppedEventsCount

func (ms Span) SetDroppedEventsCount(v uint32)

SetDroppedEventsCount replaces the droppedeventscount associated with this Span.

func (Span) SetDroppedLinksCount

func (ms Span) SetDroppedLinksCount(v uint32)

SetDroppedLinksCount replaces the droppedlinkscount associated with this Span.

func (Span) SetEndTimestamp

func (ms Span) SetEndTimestamp(v Timestamp)

SetEndTimestamp replaces the endtimestamp associated with this Span.

func (Span) SetKind

func (ms Span) SetKind(v SpanKind)

SetKind replaces the kind associated with this Span.

func (Span) SetName

func (ms Span) SetName(v string)

SetName replaces the name associated with this Span.

func (Span) SetParentSpanID

func (ms Span) SetParentSpanID(v SpanID)

SetParentSpanID replaces the parentspanid associated with this Span.

func (Span) SetSpanID

func (ms Span) SetSpanID(v SpanID)

SetSpanID replaces the spanid associated with this Span.

func (Span) SetStartTimestamp

func (ms Span) SetStartTimestamp(v Timestamp)

SetStartTimestamp replaces the starttimestamp associated with this Span.

func (Span) SetTraceID

func (ms Span) SetTraceID(v TraceID)

SetTraceID replaces the traceid associated with this Span.

func (Span) SetTraceState

func (ms Span) SetTraceState(v TraceState)

SetTraceState replaces the tracestate associated with this Span.

func (Span) SpanID

func (ms Span) SpanID() SpanID

SpanID returns the spanid associated with this Span.

func (Span) StartTimestamp

func (ms Span) StartTimestamp() Timestamp

StartTimestamp returns the starttimestamp associated with this Span.

func (Span) Status

func (ms Span) Status() SpanStatus

Status returns the status associated with this Span.

func (Span) TraceID

func (ms Span) TraceID() TraceID

TraceID returns the traceid associated with this Span.

func (Span) TraceState

func (ms Span) TraceState() TraceState

TraceState returns the tracestate associated with this Span.

type SpanEvent

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

SpanEvent is a time-stamped annotation of the span, consisting of user-supplied text description and key-value pairs. See OTLP for event definition.

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewSpanEvent function to create new instances. Important: zero-initialized instance is not valid for use.

func NewSpanEvent

func NewSpanEvent() SpanEvent

NewSpanEvent creates a new empty SpanEvent.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (SpanEvent) Attributes

func (ms SpanEvent) Attributes() Map

Attributes returns the Attributes associated with this SpanEvent.

func (SpanEvent) CopyTo

func (ms SpanEvent) CopyTo(dest SpanEvent)

CopyTo copies all properties from the current struct to the dest.

func (SpanEvent) DroppedAttributesCount

func (ms SpanEvent) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this SpanEvent.

func (SpanEvent) MoveTo

func (ms SpanEvent) MoveTo(dest SpanEvent)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (SpanEvent) Name

func (ms SpanEvent) Name() string

Name returns the name associated with this SpanEvent.

func (SpanEvent) SetDroppedAttributesCount

func (ms SpanEvent) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanEvent.

func (SpanEvent) SetName

func (ms SpanEvent) SetName(v string)

SetName replaces the name associated with this SpanEvent.

func (SpanEvent) SetTimestamp

func (ms SpanEvent) SetTimestamp(v Timestamp)

SetTimestamp replaces the timestamp associated with this SpanEvent.

func (SpanEvent) Timestamp

func (ms SpanEvent) Timestamp() Timestamp

Timestamp returns the timestamp associated with this SpanEvent.

type SpanEventSlice

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

SpanEventSlice logically represents a slice of SpanEvent.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewSpanEventSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewSpanEventSlice

func NewSpanEventSlice() SpanEventSlice

NewSpanEventSlice creates a SpanEventSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (SpanEventSlice) AppendEmpty

func (es SpanEventSlice) AppendEmpty() SpanEvent

AppendEmpty will append to the end of the slice an empty SpanEvent. It returns the newly added SpanEvent.

func (SpanEventSlice) At

func (es SpanEventSlice) At(ix int) SpanEvent

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (SpanEventSlice) CopyTo

func (es SpanEventSlice) CopyTo(dest SpanEventSlice)

CopyTo copies all elements from the current slice to the dest.

func (SpanEventSlice) EnsureCapacity

func (es SpanEventSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new SpanEventSlice can be initialized:

es := NewSpanEventSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (SpanEventSlice) Len

func (es SpanEventSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewSpanEventSlice()".

func (SpanEventSlice) MoveAndAppendTo

func (es SpanEventSlice) MoveAndAppendTo(dest SpanEventSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (SpanEventSlice) RemoveIf

func (es SpanEventSlice) RemoveIf(f func(SpanEvent) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (SpanEventSlice) Sort

func (es SpanEventSlice) Sort(less func(a, b SpanEvent) bool) SpanEventSlice

Sort sorts the SpanEvent elements within SpanEventSlice given the provided less function so that two instances of SpanEventSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b SpanEvent) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type SpanID

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

SpanID is span identifier.

func InvalidSpanID

func InvalidSpanID() SpanID

InvalidSpanID returns an empty (all zero bytes) SpanID.

func NewSpanID

func NewSpanID(bytes [8]byte) SpanID

NewSpanID returns a new SpanID from the given byte array.

func (SpanID) Bytes

func (t SpanID) Bytes() [8]byte

Bytes returns the byte array representation of the SpanID.

func (SpanID) HexString

func (t SpanID) HexString() string

HexString returns hex representation of the SpanID.

func (SpanID) IsEmpty

func (t SpanID) IsEmpty() bool

IsEmpty returns true if id doesn't contain at least one non-zero byte.

type SpanKind

type SpanKind int32

SpanKind is the type of span. Can be used to specify additional relationships between spans in addition to a parent/child relationship.

func (SpanKind) String

func (sk SpanKind) String() string

String returns the string representation of the SpanKind.

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

SpanLink is a pointer from the current span to another span in the same trace or in a different trace. See Link definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewSpanLink function to create new instances. Important: zero-initialized instance is not valid for use.

func NewSpanLink() SpanLink

NewSpanLink creates a new empty SpanLink.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (SpanLink) Attributes

func (ms SpanLink) Attributes() Map

Attributes returns the Attributes associated with this SpanLink.

func (SpanLink) CopyTo

func (ms SpanLink) CopyTo(dest SpanLink)

CopyTo copies all properties from the current struct to the dest.

func (SpanLink) DroppedAttributesCount

func (ms SpanLink) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this SpanLink.

func (SpanLink) MoveTo

func (ms SpanLink) MoveTo(dest SpanLink)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (SpanLink) SetDroppedAttributesCount

func (ms SpanLink) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanLink.

func (SpanLink) SetSpanID

func (ms SpanLink) SetSpanID(v SpanID)

SetSpanID replaces the spanid associated with this SpanLink.

func (SpanLink) SetTraceID

func (ms SpanLink) SetTraceID(v TraceID)

SetTraceID replaces the traceid associated with this SpanLink.

func (SpanLink) SetTraceState

func (ms SpanLink) SetTraceState(v TraceState)

SetTraceState replaces the tracestate associated with this SpanLink.

func (SpanLink) SpanID

func (ms SpanLink) SpanID() SpanID

SpanID returns the spanid associated with this SpanLink.

func (SpanLink) TraceID

func (ms SpanLink) TraceID() TraceID

TraceID returns the traceid associated with this SpanLink.

func (SpanLink) TraceState

func (ms SpanLink) TraceState() TraceState

TraceState returns the tracestate associated with this SpanLink.

type SpanLinkSlice

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

SpanLinkSlice logically represents a slice of SpanLink.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewSpanLinkSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewSpanLinkSlice

func NewSpanLinkSlice() SpanLinkSlice

NewSpanLinkSlice creates a SpanLinkSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (SpanLinkSlice) AppendEmpty

func (es SpanLinkSlice) AppendEmpty() SpanLink

AppendEmpty will append to the end of the slice an empty SpanLink. It returns the newly added SpanLink.

func (SpanLinkSlice) At

func (es SpanLinkSlice) At(ix int) SpanLink

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (SpanLinkSlice) CopyTo

func (es SpanLinkSlice) CopyTo(dest SpanLinkSlice)

CopyTo copies all elements from the current slice to the dest.

func (SpanLinkSlice) EnsureCapacity

func (es SpanLinkSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new SpanLinkSlice can be initialized:

es := NewSpanLinkSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (SpanLinkSlice) Len

func (es SpanLinkSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewSpanLinkSlice()".

func (SpanLinkSlice) MoveAndAppendTo

func (es SpanLinkSlice) MoveAndAppendTo(dest SpanLinkSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (SpanLinkSlice) RemoveIf

func (es SpanLinkSlice) RemoveIf(f func(SpanLink) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (SpanLinkSlice) Sort

func (es SpanLinkSlice) Sort(less func(a, b SpanLink) bool) SpanLinkSlice

Sort sorts the SpanLink elements within SpanLinkSlice given the provided less function so that two instances of SpanLinkSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b SpanLink) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type SpanSlice

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

SpanSlice logically represents a slice of Span.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewSpanSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewSpanSlice

func NewSpanSlice() SpanSlice

NewSpanSlice creates a SpanSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (SpanSlice) AppendEmpty

func (es SpanSlice) AppendEmpty() Span

AppendEmpty will append to the end of the slice an empty Span. It returns the newly added Span.

func (SpanSlice) At

func (es SpanSlice) At(ix int) Span

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (SpanSlice) CopyTo

func (es SpanSlice) CopyTo(dest SpanSlice)

CopyTo copies all elements from the current slice to the dest.

func (SpanSlice) EnsureCapacity

func (es SpanSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new SpanSlice can be initialized:

es := NewSpanSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (SpanSlice) Len

func (es SpanSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewSpanSlice()".

func (SpanSlice) MoveAndAppendTo

func (es SpanSlice) MoveAndAppendTo(dest SpanSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (SpanSlice) RemoveIf

func (es SpanSlice) RemoveIf(f func(Span) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (SpanSlice) Sort

func (es SpanSlice) Sort(less func(a, b Span) bool) SpanSlice

Sort sorts the Span elements within SpanSlice given the provided less function so that two instances of SpanSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b Span) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type SpanStatus

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

SpanStatus is an optional final status for this span. Semantically, when Status was not set, that means the span ended without errors and to assume Status.Ok (code = 0).

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewSpanStatus function to create new instances. Important: zero-initialized instance is not valid for use.

func NewSpanStatus

func NewSpanStatus() SpanStatus

NewSpanStatus creates a new empty SpanStatus.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (SpanStatus) Code

func (ms SpanStatus) Code() StatusCode

Code returns the code associated with this SpanStatus.

func (SpanStatus) CopyTo

func (ms SpanStatus) CopyTo(dest SpanStatus)

CopyTo copies all properties from the current struct to the dest.

func (SpanStatus) Message

func (ms SpanStatus) Message() string

Message returns the message associated with this SpanStatus.

func (SpanStatus) MoveTo

func (ms SpanStatus) MoveTo(dest SpanStatus)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (SpanStatus) SetCode

func (ms SpanStatus) SetCode(v StatusCode)

SetCode replaces the code associated with this SpanStatus.

func (SpanStatus) SetMessage

func (ms SpanStatus) SetMessage(v string)

SetMessage replaces the message associated with this SpanStatus.

type StatusCode

type StatusCode int32

StatusCode mirrors the codes defined at https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status

func (StatusCode) String

func (sc StatusCode) String() string

String returns the string representation of the StatusCode.

type Sum

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

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.

func NewSum

func NewSum() Sum

NewSum creates a new empty Sum.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (Sum) AggregationTemporality

func (ms Sum) AggregationTemporality() MetricAggregationTemporality

AggregationTemporality returns the aggregationtemporality associated with this Sum.

func (Sum) CopyTo

func (ms Sum) CopyTo(dest Sum)

CopyTo copies all properties from the current struct to the dest.

func (Sum) DataPoints

func (ms Sum) DataPoints() NumberDataPointSlice

DataPoints returns the DataPoints associated with this Sum.

func (Sum) IsMonotonic

func (ms Sum) IsMonotonic() bool

IsMonotonic returns the ismonotonic associated with this Sum.

func (Sum) MoveTo

func (ms Sum) MoveTo(dest Sum)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (Sum) SetAggregationTemporality

func (ms Sum) SetAggregationTemporality(v MetricAggregationTemporality)

SetAggregationTemporality replaces the aggregationtemporality associated with this Sum.

func (Sum) SetIsMonotonic

func (ms Sum) SetIsMonotonic(v bool)

SetIsMonotonic replaces the ismonotonic associated with this Sum.

type Summary

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

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.

func NewSummary

func NewSummary() Summary

NewSummary creates a new empty Summary.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (Summary) CopyTo

func (ms Summary) CopyTo(dest Summary)

CopyTo copies all properties from the current struct to the dest.

func (Summary) DataPoints

func (ms Summary) DataPoints() SummaryDataPointSlice

DataPoints returns the DataPoints associated with this Summary.

func (Summary) MoveTo

func (ms Summary) MoveTo(dest Summary)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

type SummaryDataPoint

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

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.

func NewSummaryDataPoint

func NewSummaryDataPoint() SummaryDataPoint

NewSummaryDataPoint creates a new empty SummaryDataPoint.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (SummaryDataPoint) Attributes

func (ms SummaryDataPoint) Attributes() Map

Attributes returns the Attributes associated with this SummaryDataPoint.

func (SummaryDataPoint) CopyTo

func (ms SummaryDataPoint) CopyTo(dest SummaryDataPoint)

CopyTo copies all properties from the current struct to the dest.

func (SummaryDataPoint) Count

func (ms SummaryDataPoint) Count() uint64

Count returns the count associated with this SummaryDataPoint.

func (SummaryDataPoint) Flags

Flags returns the flags associated with this SummaryDataPoint.

func (SummaryDataPoint) MoveTo

func (ms SummaryDataPoint) MoveTo(dest SummaryDataPoint)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (SummaryDataPoint) QuantileValues

func (ms SummaryDataPoint) QuantileValues() ValueAtQuantileSlice

QuantileValues returns the QuantileValues associated with this SummaryDataPoint.

func (SummaryDataPoint) SetCount

func (ms SummaryDataPoint) SetCount(v uint64)

SetCount replaces the count associated with this SummaryDataPoint.

func (SummaryDataPoint) SetFlags

func (ms SummaryDataPoint) SetFlags(v MetricDataPointFlags)

SetFlags replaces the flags associated with this SummaryDataPoint.

func (SummaryDataPoint) SetStartTimestamp

func (ms SummaryDataPoint) SetStartTimestamp(v Timestamp)

SetStartTimestamp replaces the starttimestamp associated with this SummaryDataPoint.

func (SummaryDataPoint) SetSum

func (ms SummaryDataPoint) SetSum(v float64)

SetSum replaces the sum associated with this SummaryDataPoint.

func (SummaryDataPoint) SetTimestamp

func (ms SummaryDataPoint) SetTimestamp(v Timestamp)

SetTimestamp replaces the timestamp associated with this SummaryDataPoint.

func (SummaryDataPoint) StartTimestamp

func (ms SummaryDataPoint) StartTimestamp() Timestamp

StartTimestamp returns the starttimestamp associated with this SummaryDataPoint.

func (SummaryDataPoint) Sum

func (ms SummaryDataPoint) Sum() float64

Sum returns the sum associated with this SummaryDataPoint.

func (SummaryDataPoint) Timestamp

func (ms SummaryDataPoint) Timestamp() Timestamp

Timestamp returns the timestamp associated with this SummaryDataPoint.

type SummaryDataPointSlice

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

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.

func NewSummaryDataPointSlice

func NewSummaryDataPointSlice() SummaryDataPointSlice

NewSummaryDataPointSlice creates a SummaryDataPointSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (SummaryDataPointSlice) AppendEmpty

func (es SummaryDataPointSlice) AppendEmpty() SummaryDataPoint

AppendEmpty will append to the end of the slice an empty SummaryDataPoint. It returns the newly added SummaryDataPoint.

func (SummaryDataPointSlice) At

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (SummaryDataPointSlice) CopyTo

CopyTo copies all elements from the current slice to the dest.

func (SummaryDataPointSlice) EnsureCapacity

func (es SummaryDataPointSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new SummaryDataPointSlice can be initialized:

es := NewSummaryDataPointSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (SummaryDataPointSlice) Len

func (es SummaryDataPointSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewSummaryDataPointSlice()".

func (SummaryDataPointSlice) MoveAndAppendTo

func (es SummaryDataPointSlice) MoveAndAppendTo(dest SummaryDataPointSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (SummaryDataPointSlice) RemoveIf

func (es SummaryDataPointSlice) RemoveIf(f func(SummaryDataPoint) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (SummaryDataPointSlice) Sort

Sort sorts the SummaryDataPoint elements within SummaryDataPointSlice given the provided less function so that two instances of SummaryDataPointSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b SummaryDataPoint) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type Timestamp

type Timestamp uint64

Timestamp is a time specified as UNIX Epoch time in nanoseconds since 1970-01-01 00:00:00 +0000 UTC.

func NewTimestampFromTime

func NewTimestampFromTime(t time.Time) Timestamp

NewTimestampFromTime constructs a new Timestamp from the provided time.Time.

func (Timestamp) AsTime

func (ts Timestamp) AsTime() time.Time

AsTime converts this to a time.Time.

func (Timestamp) String

func (ts Timestamp) String() string

String returns the string representation of this in UTC.

type TraceID

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

TraceID is a trace identifier.

func InvalidTraceID

func InvalidTraceID() TraceID

InvalidTraceID returns an empty (all zero bytes) TraceID.

func NewTraceID

func NewTraceID(bytes [16]byte) TraceID

NewTraceID returns a new TraceID from the given byte array.

func (TraceID) Bytes

func (t TraceID) Bytes() [16]byte

Bytes returns the byte array representation of the TraceID.

func (TraceID) HexString

func (t TraceID) HexString() string

HexString returns hex representation of the TraceID.

func (TraceID) IsEmpty

func (t TraceID) IsEmpty() bool

IsEmpty returns true if id doesn't contain at least one non-zero byte.

type TraceState

type TraceState string

TraceState is a string representing the tracestate in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header

const (
	// TraceStateEmpty represents the empty TraceState.
	TraceStateEmpty TraceState = ""
)

type Traces

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

Traces is the top-level struct that is propagated through the traces pipeline. Use NewTraces to create new instance, zero-initialized instance is not valid for use.

func NewTraces

func NewTraces() Traces

NewTraces creates a new Traces struct.

func TracesFromOtlp

TracesFromOtlp internal helper to convert otlp request representation to Traces.

func TracesFromProto added in v0.50.0

func TracesFromProto(orig otlptrace.TracesData) Traces

TracesFromProto internal helper to convert protobuf representation to Traces.

func (Traces) Clone

func (td Traces) Clone() Traces

Clone returns a copy of Traces.

func (Traces) MoveTo

func (td Traces) MoveTo(dest Traces)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value.

func (Traces) ResourceSpans

func (td Traces) ResourceSpans() ResourceSpansSlice

ResourceSpans returns the ResourceSpansSlice associated with this Metrics.

func (Traces) SpanCount

func (td Traces) SpanCount() int

SpanCount calculates the total number of spans.

type Value

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

Value is a mutable cell containing any value. Typically used as an element of Map or Slice. Must use one of NewValue+ functions below to create new instances.

Intended to be passed by value since internally it is just a pointer to actual value representation. For the same reason passing by value and calling setters will modify the original, e.g.:

func f1(val Value) { val.SetIntVal(234) }
func f2() {
    v := NewValueString("a string")
    f1(v)
    _ := v.Type() // this will return ValueTypeInt
}

Important: zero-initialized instance is not valid for use. All Value functions below must be called only on instances that are created via NewValue+ functions.

func NewValueBool

func NewValueBool(v bool) Value

NewValueBool creates a new Value with the given bool value.

func NewValueDouble

func NewValueDouble(v float64) Value

NewValueDouble creates a new Value with the given float64 value.

func NewValueEmpty

func NewValueEmpty() Value

NewValueEmpty creates a new Value with an empty value.

func NewValueInt

func NewValueInt(v int64) Value

NewValueInt creates a new Value with the given int64 value.

func NewValueMBytes added in v0.52.0

func NewValueMBytes(v []byte) Value

NewValueMBytes creates a new Value with the given []byte value. The caller must ensure the []byte passed in is not modified after the call is made, sharing the data across multiple attributes is forbidden.

func NewValueMap

func NewValueMap() Value

NewValueMap creates a new Value of map type.

func NewValueSlice

func NewValueSlice() Value

NewValueSlice creates a new Value of array type.

func NewValueString

func NewValueString(v string) Value

NewValueString creates a new Value with the given string value.

func (Value) AsString

func (v Value) AsString() string

AsString converts an OTLP Value object of any type to its equivalent string representation. This differs from StringVal which only returns a non-empty value if the ValueType is ValueTypeString.

func (Value) BoolVal

func (v Value) BoolVal() bool

BoolVal returns the bool value associated with this Value. If the Type() is not ValueTypeBool then returns false. Calling this function on zero-initialized Value will cause a panic.

func (Value) CopyTo

func (v Value) CopyTo(dest Value)

CopyTo copies the attribute to a destination.

func (Value) DoubleVal

func (v Value) DoubleVal() float64

DoubleVal returns the float64 value associated with this Value. If the Type() is not ValueTypeDouble then returns float64(0). Calling this function on zero-initialized Value will cause a panic.

func (Value) Equal

func (v Value) Equal(av Value) bool

Equal checks for equality, it returns true if the objects are equal otherwise false.

func (Value) IntVal

func (v Value) IntVal() int64

IntVal returns the int64 value associated with this Value. If the Type() is not ValueTypeInt then returns int64(0). Calling this function on zero-initialized Value will cause a panic.

func (Value) MBytesVal added in v0.51.0

func (v Value) MBytesVal() []byte

MBytesVal returns the []byte value associated with this Value. If the Type() is not ValueTypeBytes then returns false. Calling this function on zero-initialized Value will cause a panic. Modifying the returned []byte in-place is forbidden.

func (Value) MapVal

func (v Value) MapVal() Map

MapVal returns the map value associated with this Value. If the Type() is not ValueTypeMap then returns an invalid map. Note that using such map can cause panic.

Calling this function on zero-initialized Value will cause a panic.

func (Value) SetBoolVal

func (v Value) SetBoolVal(bv bool)

SetBoolVal replaces the bool value associated with this Value, it also changes the type to be ValueTypeBool. Calling this function on zero-initialized Value will cause a panic.

func (Value) SetDoubleVal

func (v Value) SetDoubleVal(dv float64)

SetDoubleVal replaces the float64 value associated with this Value, it also changes the type to be ValueTypeDouble. Calling this function on zero-initialized Value will cause a panic.

func (Value) SetIntVal

func (v Value) SetIntVal(iv int64)

SetIntVal replaces the int64 value associated with this Value, it also changes the type to be ValueTypeInt. Calling this function on zero-initialized Value will cause a panic.

func (Value) SetMBytesVal added in v0.51.0

func (v Value) SetMBytesVal(bv []byte)

SetMBytesVal replaces the []byte value associated with this Value, it also changes the type to be ValueTypeBytes. Calling this function on zero-initialized Value will cause a panic. The caller must ensure the []byte passed in is not modified after the call is made, sharing the data across multiple attributes is forbidden.

func (Value) SetStringVal

func (v Value) SetStringVal(sv string)

SetStringVal replaces the string value associated with this Value, it also changes the type to be ValueTypeString. Calling this function on zero-initialized Value will cause a panic.

func (Value) SliceVal

func (v Value) SliceVal() Slice

SliceVal returns the slice value associated with this Value. If the Type() is not ValueTypeSlice then returns an invalid slice. Note that using such slice can cause panic.

Calling this function on zero-initialized Value will cause a panic.

func (Value) StringVal

func (v Value) StringVal() string

StringVal returns the string value associated with this Value. If the Type() is not ValueTypeString then returns empty string. Calling this function on zero-initialized Value will cause a panic.

func (Value) Type

func (v Value) Type() ValueType

Type returns the type of the value for this Value. Calling this function on zero-initialized Value will cause a panic.

type ValueAtQuantile

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

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.

func NewValueAtQuantile

func NewValueAtQuantile() ValueAtQuantile

NewValueAtQuantile creates a new empty ValueAtQuantile.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ValueAtQuantile) CopyTo

func (ms ValueAtQuantile) CopyTo(dest ValueAtQuantile)

CopyTo copies all properties from the current struct to the dest.

func (ValueAtQuantile) MoveTo

func (ms ValueAtQuantile) MoveTo(dest ValueAtQuantile)

MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value

func (ValueAtQuantile) Quantile

func (ms ValueAtQuantile) Quantile() float64

Quantile returns the quantile associated with this ValueAtQuantile.

func (ValueAtQuantile) SetQuantile

func (ms ValueAtQuantile) SetQuantile(v float64)

SetQuantile replaces the quantile associated with this ValueAtQuantile.

func (ValueAtQuantile) SetValue

func (ms ValueAtQuantile) SetValue(v float64)

SetValue replaces the value associated with this ValueAtQuantile.

func (ValueAtQuantile) Value

func (ms ValueAtQuantile) Value() float64

Value returns the value associated with this ValueAtQuantile.

type ValueAtQuantileSlice

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

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.

func NewValueAtQuantileSlice

func NewValueAtQuantileSlice() ValueAtQuantileSlice

NewValueAtQuantileSlice creates a ValueAtQuantileSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ValueAtQuantileSlice) AppendEmpty

func (es ValueAtQuantileSlice) AppendEmpty() ValueAtQuantile

AppendEmpty will append to the end of the slice an empty ValueAtQuantile. It returns the newly added ValueAtQuantile.

func (ValueAtQuantileSlice) At

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ValueAtQuantileSlice) CopyTo

CopyTo copies all elements from the current slice to the dest.

func (ValueAtQuantileSlice) EnsureCapacity

func (es ValueAtQuantileSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ValueAtQuantileSlice can be initialized:

es := NewValueAtQuantileSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ValueAtQuantileSlice) Len

func (es ValueAtQuantileSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewValueAtQuantileSlice()".

func (ValueAtQuantileSlice) MoveAndAppendTo

func (es ValueAtQuantileSlice) MoveAndAppendTo(dest ValueAtQuantileSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ValueAtQuantileSlice) RemoveIf

func (es ValueAtQuantileSlice) RemoveIf(f func(ValueAtQuantile) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ValueAtQuantileSlice) Sort

Sort sorts the ValueAtQuantile elements within ValueAtQuantileSlice given the provided less function so that two instances of ValueAtQuantileSlice can be compared.

Returns the same instance to allow nicer code like:

lessFunc := func(a, b ValueAtQuantile) bool {
  return a.Name() < b.Name() // choose any comparison here
}
assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc))

type ValueType

type ValueType int32

ValueType specifies the type of Value.

const (
	ValueTypeEmpty ValueType = iota
	ValueTypeString
	ValueTypeInt
	ValueTypeDouble
	ValueTypeBool
	ValueTypeMap
	ValueTypeSlice
	ValueTypeBytes
)

func (ValueType) String

func (avt ValueType) String() string

String returns the string representation of the ValueType.

Jump to

Keyboard shortcuts

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