data

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package data implements data structures that represent telemetry data in-memory. All data received is converted into this format and travels through the pipeline in this format and that is converted from this format by exporters when sending. The package is placed in "internal" for now since it is incubating and may undergoe changes as we iterate and improve it. Once it is stable we will move it to an exported location so that other components outside this module can use it.

Current implementation primarily uses OTLP ProtoBuf structs as the underlying data structures for many of of the declared structs. We keep a pointer to OTLP protobuf in the "orig" member field. This allows efficient translation to/from OTLP wire protocol. Note that the underlying data structure is kept private so that in the future we are free to make changes to it to make more optimal.

Most of internal data structures must be created via New* functions. Zero-initialized structures in most cases are not valid (read comments for each struct to know if it is the case). This is a slight deviation from idiomatic Go to avoid unnecessary pointer checks in dozens of functions which assume the invariant that "orig" member is non-nil. Several structures also provide New*Slice functions that allows to create more than one instance of the struct more efficiently instead of calling New* repeatedly. Use it where appropriate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetricDataToOtlp

func MetricDataToOtlp(md MetricData) []*otlpmetrics.ResourceMetrics

MetricDataToOtlp converts the internal MetricData to the OTLP.

func TraceDataToOtlp added in v0.2.9

func TraceDataToOtlp(td TraceData) []*otlptrace.ResourceSpans

TraceDataToOtlp converts the internal TraceData to the OTLP.

Types

type AttributeKeyValue added in v0.2.8

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

AttributeKeyValue stores a key and AttributeValue pair.

func NewAttributeKeyValue added in v0.2.8

func NewAttributeKeyValue(k string) AttributeKeyValue

NewAttributeKeyValue creates a new AttributeKeyValue with the given key.

func NewAttributeKeyValueBool added in v0.2.8

func NewAttributeKeyValueBool(k string, v bool) AttributeKeyValue

NewAttributeKeyValueBool creates a new AttributeKeyValue with the given key and bool value.

func NewAttributeKeyValueDouble added in v0.2.8

func NewAttributeKeyValueDouble(k string, v float64) AttributeKeyValue

NewAttributeKeyValueDouble creates a new AttributeKeyValue with the given key and float64 value.

func NewAttributeKeyValueInt added in v0.2.8

func NewAttributeKeyValueInt(k string, v int64) AttributeKeyValue

NewAttributeKeyValueInt creates a new AttributeKeyValue with the given key and int64 value.

func NewAttributeKeyValueString added in v0.2.8

func NewAttributeKeyValueString(k string, v string) AttributeKeyValue

NewAttributeKeyValueString creates a new AttributeKeyValue with the given key and string value.

func (AttributeKeyValue) Key added in v0.2.8

func (akv AttributeKeyValue) Key() string

Key returns the key associated with this AttributeKeyValue.

func (AttributeKeyValue) SetValue added in v0.2.8

func (akv AttributeKeyValue) SetValue(av AttributeValue)

SetValue replaces the value associated with this AttributeKeyValue.

func (AttributeKeyValue) Value added in v0.2.8

func (akv AttributeKeyValue) Value() AttributeValue

Value returns the value associated with this AttributeKeyValue.

type AttributeMap added in v0.2.8

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

AttributeMap stores a map of attribute keys to values.

func NewAttributeMap added in v0.2.8

func NewAttributeMap(attrMap map[string]AttributeValue) AttributeMap

NewAttributeMap creates a new AttributeMap from the given map[string]AttributeValue.

func (AttributeMap) Delete added in v0.2.8

func (am AttributeMap) Delete(key string) bool

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

func (AttributeMap) Get added in v0.2.8

func (am AttributeMap) Get(key string) (AttributeKeyValue, bool)

Get returns the AttributeKeyValue associated with the key and true, otherwise an invalid instance of the AttributeKeyValue and false.

func (AttributeMap) GetAttribute added in v0.2.8

func (am AttributeMap) GetAttribute(ix int) AttributeKeyValue

GetAttribute returns the AttributeKeyValue associated with the given index.

This function is used mostly for itereting over all the values in the map:

for i := 1; i < am.Len(); i++ {
    akv := am.GetAttribute(i)
    ... // Do something with the attribute
}

func (AttributeMap) Insert added in v0.2.8

func (am AttributeMap) Insert(akv AttributeKeyValue)

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

func (AttributeMap) Len added in v0.2.8

func (am AttributeMap) Len() int

Len returns the number of AttributeKeyValue in the map.

func (AttributeMap) Sort added in v0.2.8

func (am AttributeMap) Sort() AttributeMap

Sort sorts the entries in the AttributeMap so two instances can be compared. Returns the same instance to allow nicer code like: assert.EqualValues(t, expected.Sort(), actual.Sort())

func (AttributeMap) Update added in v0.2.8

func (am AttributeMap) Update(akv AttributeKeyValue)

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

func (AttributeMap) Upsert added in v0.2.8

func (am AttributeMap) Upsert(akv AttributeKeyValue)

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

type AttributeValue

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

AttributeValue represents a value of an attribute. Typically used in an Attributes map. Must use one of NewAttributeValue* functions below to create new instances. Important: zero-initialized instance is not valid for use.

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.:

function f1(val AttributeValue) { val.SetInt(234) }
function f2() {
	v := NewAttributeValueString("a string")
   f1(v)
   _ := v.GetType() // this will return AttributeValueINT
}

func NewAttributeValueBool

func NewAttributeValueBool(v bool) AttributeValue

func NewAttributeValueDouble

func NewAttributeValueDouble(v float64) AttributeValue

func NewAttributeValueInt

func NewAttributeValueInt(v int64) AttributeValue

func NewAttributeValueSlice

func NewAttributeValueSlice(len int) []AttributeValue

NewAttributeValueSlice creates a slice of attributes values that are correctly initialized.

func NewAttributeValueString

func NewAttributeValueString(v string) AttributeValue

func (AttributeValue) BoolVal

func (a AttributeValue) BoolVal() bool

func (AttributeValue) DoubleVal

func (a AttributeValue) DoubleVal() float64

func (AttributeValue) IntVal

func (a AttributeValue) IntVal() int64

func (AttributeValue) SetBool

func (a AttributeValue) SetBool(v bool)

func (AttributeValue) SetDouble

func (a AttributeValue) SetDouble(v float64)

func (AttributeValue) SetInt

func (a AttributeValue) SetInt(v int64)

func (AttributeValue) SetString

func (a AttributeValue) SetString(v string)

func (AttributeValue) StringVal

func (a AttributeValue) StringVal() string

func (AttributeValue) Type

type AttributeValueType

type AttributeValueType int32

AttributeValueType specifies the type of value. Numerically is equal to otlp.AttributeKeyValue_ValueType.

type AttributesMap

type AttributesMap map[string]AttributeValue

AttributesMap stores a map of attribute keys to values. TODO: Remove usage of this and use AttributeMap

type DoubleDataPoint

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

DoubleDataPoint is a single data point in a timeseries that describes the time-varying value of a double metric.

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

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

func NewDoubleDataPoint

func NewDoubleDataPoint() DoubleDataPoint

NewDoubleDataPoint creates a new empty DoubleDataPoint.

func (DoubleDataPoint) LabelsMap added in v0.2.8

func (ms DoubleDataPoint) LabelsMap() StringMap

LabelsMap returns the Labels associated with this DoubleDataPoint.

func (DoubleDataPoint) SetLabelsMap added in v0.2.8

func (ms DoubleDataPoint) SetLabelsMap(v StringMap)

SetLabelsMap replaces the Labels associated with this DoubleDataPoint.

func (DoubleDataPoint) SetStartTime

func (ms DoubleDataPoint) SetStartTime(v TimestampUnixNano)

SetStartTime replaces the starttime associated with this DoubleDataPoint.

func (DoubleDataPoint) SetTimestamp

func (ms DoubleDataPoint) SetTimestamp(v TimestampUnixNano)

SetTimestamp replaces the timestamp associated with this DoubleDataPoint.

func (DoubleDataPoint) SetValue

func (ms DoubleDataPoint) SetValue(v float64)

SetValue replaces the value associated with this DoubleDataPoint.

func (DoubleDataPoint) StartTime

func (ms DoubleDataPoint) StartTime() TimestampUnixNano

StartTime returns the starttime associated with this DoubleDataPoint.

func (DoubleDataPoint) Timestamp

func (ms DoubleDataPoint) Timestamp() TimestampUnixNano

Timestamp returns the timestamp associated with this DoubleDataPoint.

func (DoubleDataPoint) Value

func (ms DoubleDataPoint) Value() float64

Value returns the value associated with this DoubleDataPoint.

type DoubleDataPointSlice added in v0.2.8

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

DoubleDataPointSlice logically represents a slice of DoubleDataPoint.

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

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

func NewDoubleDataPointSlice

func NewDoubleDataPointSlice(len int) DoubleDataPointSlice

NewDoubleDataPointSlice creates a DoubleDataPointSlice with "len" empty elements.

es := NewDoubleDataPointSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (DoubleDataPointSlice) Get added in v0.2.8

Get 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.Get(i)
    ... // Do something with the element
}

func (DoubleDataPointSlice) Len added in v0.2.8

func (es DoubleDataPointSlice) Len() int

Len returns the number of elements in the slice.

func (DoubleDataPointSlice) Remove added in v0.2.8

func (es DoubleDataPointSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (DoubleDataPointSlice) Resize added in v0.2.8

func (es DoubleDataPointSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type HistogramBucket

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

HistogramBucket contains values for a histogram bucket.

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

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

func NewHistogramBucket

func NewHistogramBucket() HistogramBucket

NewHistogramBucket creates a new empty HistogramBucket.

func (HistogramBucket) Count

func (ms HistogramBucket) Count() uint64

Count returns the count associated with this HistogramBucket.

func (HistogramBucket) Exemplar

Exemplar returns the exemplar associated with this HistogramBucket.

func (HistogramBucket) SetCount

func (ms HistogramBucket) SetCount(v uint64)

SetCount replaces the count associated with this HistogramBucket.

func (HistogramBucket) SetExemplar

func (ms HistogramBucket) SetExemplar(v HistogramBucketExemplar)

SetExemplar replaces the exemplar associated with this HistogramBucket.

type HistogramBucketExemplar

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

HistogramBucketExemplar are example points that may be used to annotate aggregated Histogram values. They are metadata that gives information about a particular value added to a Histogram bucket.

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

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

func NewHistogramBucketExemplar

func NewHistogramBucketExemplar() HistogramBucketExemplar

NewHistogramBucketExemplar creates a new empty HistogramBucketExemplar.

func (HistogramBucketExemplar) Attachments

func (ms HistogramBucketExemplar) Attachments() StringMap

Attachments returns the Attachments associated with this HistogramBucketExemplar.

func (HistogramBucketExemplar) SetAttachments

func (ms HistogramBucketExemplar) SetAttachments(v StringMap)

SetAttachments replaces the Attachments associated with this HistogramBucketExemplar.

func (HistogramBucketExemplar) SetTimestamp

func (ms HistogramBucketExemplar) SetTimestamp(v TimestampUnixNano)

SetTimestamp replaces the timestamp associated with this HistogramBucketExemplar.

func (HistogramBucketExemplar) SetValue

func (ms HistogramBucketExemplar) SetValue(v float64)

SetValue replaces the value associated with this HistogramBucketExemplar.

func (HistogramBucketExemplar) Timestamp

Timestamp returns the timestamp associated with this HistogramBucketExemplar.

func (HistogramBucketExemplar) Value

func (ms HistogramBucketExemplar) Value() float64

Value returns the value associated with this HistogramBucketExemplar.

type HistogramBucketSlice added in v0.2.8

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

HistogramBucketSlice logically represents a slice of HistogramBucket.

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

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

func NewHistogramBucketSlice

func NewHistogramBucketSlice(len int) HistogramBucketSlice

NewHistogramBucketSlice creates a HistogramBucketSlice with "len" empty elements.

es := NewHistogramBucketSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (HistogramBucketSlice) Get added in v0.2.8

Get 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.Get(i)
    ... // Do something with the element
}

func (HistogramBucketSlice) Len added in v0.2.8

func (es HistogramBucketSlice) Len() int

Len returns the number of elements in the slice.

func (HistogramBucketSlice) Remove added in v0.2.8

func (es HistogramBucketSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (HistogramBucketSlice) Resize added in v0.2.8

func (es HistogramBucketSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

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.

This is a reference type, if passsed 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.

func (HistogramDataPoint) Buckets

Buckets returns the Buckets associated with this HistogramDataPoint.

func (HistogramDataPoint) Count

func (ms HistogramDataPoint) Count() uint64

Count returns the count associated with this HistogramDataPoint.

func (HistogramDataPoint) ExplicitBounds

func (ms HistogramDataPoint) ExplicitBounds() []float64

ExplicitBounds returns the explicitbounds associated with this HistogramDataPoint.

func (HistogramDataPoint) LabelsMap added in v0.2.8

func (ms HistogramDataPoint) LabelsMap() StringMap

LabelsMap returns the Labels associated with this HistogramDataPoint.

func (HistogramDataPoint) SetBuckets

func (ms HistogramDataPoint) SetBuckets(v HistogramBucketSlice)

SetBuckets replaces the Buckets associated with this HistogramDataPoint.

func (HistogramDataPoint) SetCount

func (ms HistogramDataPoint) SetCount(v uint64)

SetCount replaces the count associated with this HistogramDataPoint.

func (HistogramDataPoint) SetExplicitBounds

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

SetExplicitBounds replaces the explicitbounds associated with this HistogramDataPoint.

func (HistogramDataPoint) SetLabelsMap added in v0.2.8

func (ms HistogramDataPoint) SetLabelsMap(v StringMap)

SetLabelsMap replaces the Labels associated with this HistogramDataPoint.

func (HistogramDataPoint) SetStartTime

func (ms HistogramDataPoint) SetStartTime(v TimestampUnixNano)

SetStartTime replaces the starttime 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 TimestampUnixNano)

SetTimestamp replaces the timestamp associated with this HistogramDataPoint.

func (HistogramDataPoint) StartTime

func (ms HistogramDataPoint) StartTime() TimestampUnixNano

StartTime returns the starttime 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() TimestampUnixNano

Timestamp returns the timestamp associated with this HistogramDataPoint.

type HistogramDataPointSlice added in v0.2.8

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

HistogramDataPointSlice logically represents a slice of HistogramDataPoint.

This is a reference type, if passsed 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(len int) HistogramDataPointSlice

NewHistogramDataPointSlice creates a HistogramDataPointSlice with "len" empty elements.

es := NewHistogramDataPointSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (HistogramDataPointSlice) Get added in v0.2.8

Get 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.Get(i)
    ... // Do something with the element
}

func (HistogramDataPointSlice) Len added in v0.2.8

func (es HistogramDataPointSlice) Len() int

Len returns the number of elements in the slice.

func (HistogramDataPointSlice) Remove added in v0.2.8

func (es HistogramDataPointSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (HistogramDataPointSlice) Resize added in v0.2.8

func (es HistogramDataPointSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type InstrumentationLibrary

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

InstrumentationLibrary is a message representing the instrumentation library information.

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

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

func NewInstrumentationLibrary

func NewInstrumentationLibrary() InstrumentationLibrary

NewInstrumentationLibrary creates a new empty InstrumentationLibrary.

func (InstrumentationLibrary) Name

func (ms InstrumentationLibrary) Name() string

Name returns the name associated with this InstrumentationLibrary.

func (InstrumentationLibrary) SetName

func (ms InstrumentationLibrary) SetName(v string)

SetName replaces the name associated with this InstrumentationLibrary.

func (InstrumentationLibrary) SetVersion

func (ms InstrumentationLibrary) SetVersion(v string)

SetVersion replaces the version associated with this InstrumentationLibrary.

func (InstrumentationLibrary) Version

func (ms InstrumentationLibrary) Version() string

Version returns the version associated with this InstrumentationLibrary.

type InstrumentationLibraryMetrics

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

InstrumentationLibraryMetrics is a collection of metrics from a LibraryInstrumentation.

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

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

func NewInstrumentationLibraryMetrics added in v0.2.8

func NewInstrumentationLibraryMetrics() InstrumentationLibraryMetrics

NewInstrumentationLibraryMetrics creates a new empty InstrumentationLibraryMetrics.

func (InstrumentationLibraryMetrics) InstrumentationLibrary

func (ms InstrumentationLibraryMetrics) InstrumentationLibrary() InstrumentationLibrary

InstrumentationLibrary returns the instrumentationlibrary associated with this InstrumentationLibraryMetrics.

func (InstrumentationLibraryMetrics) Metrics

Metrics returns the Metrics associated with this InstrumentationLibraryMetrics.

func (InstrumentationLibraryMetrics) SetInstrumentationLibrary added in v0.2.8

func (ms InstrumentationLibraryMetrics) SetInstrumentationLibrary(v InstrumentationLibrary)

SetInstrumentationLibrary replaces the instrumentationlibrary associated with this InstrumentationLibraryMetrics.

func (InstrumentationLibraryMetrics) SetMetrics

func (ms InstrumentationLibraryMetrics) SetMetrics(v MetricSlice)

SetMetrics replaces the Metrics associated with this InstrumentationLibraryMetrics.

type InstrumentationLibraryMetricsSlice added in v0.2.8

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

InstrumentationLibraryMetricsSlice logically represents a slice of InstrumentationLibraryMetrics.

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

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

func NewInstrumentationLibraryMetricsSlice

func NewInstrumentationLibraryMetricsSlice(len int) InstrumentationLibraryMetricsSlice

NewInstrumentationLibraryMetricsSlice creates a InstrumentationLibraryMetricsSlice with "len" empty elements.

es := NewInstrumentationLibraryMetricsSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (InstrumentationLibraryMetricsSlice) Get added in v0.2.8

Get 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.Get(i)
    ... // Do something with the element
}

func (InstrumentationLibraryMetricsSlice) Len added in v0.2.8

Len returns the number of elements in the slice.

func (InstrumentationLibraryMetricsSlice) Remove added in v0.2.8

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (InstrumentationLibraryMetricsSlice) Resize added in v0.2.8

func (es InstrumentationLibraryMetricsSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type InstrumentationLibrarySpans

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

InstrumentationLibrarySpans is a collection of spans from a LibraryInstrumentation.

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

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

func NewInstrumentationLibrarySpans

func NewInstrumentationLibrarySpans() InstrumentationLibrarySpans

NewInstrumentationLibrarySpans creates a new empty InstrumentationLibrarySpans.

func (InstrumentationLibrarySpans) InstrumentationLibrary

func (ms InstrumentationLibrarySpans) InstrumentationLibrary() InstrumentationLibrary

InstrumentationLibrary returns the instrumentationlibrary associated with this InstrumentationLibrarySpans.

func (InstrumentationLibrarySpans) SetInstrumentationLibrary

func (ms InstrumentationLibrarySpans) SetInstrumentationLibrary(v InstrumentationLibrary)

SetInstrumentationLibrary replaces the instrumentationlibrary associated with this InstrumentationLibrarySpans.

func (InstrumentationLibrarySpans) SetSpans

func (ms InstrumentationLibrarySpans) SetSpans(v SpanSlice)

SetSpans replaces the Spans associated with this InstrumentationLibrarySpans.

func (InstrumentationLibrarySpans) Spans

Spans returns the Spans associated with this InstrumentationLibrarySpans.

type InstrumentationLibrarySpansSlice added in v0.2.9

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

InstrumentationLibrarySpansSlice logically represents a slice of InstrumentationLibrarySpans.

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

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

func NewInstrumentationLibrarySpansSlice added in v0.2.9

func NewInstrumentationLibrarySpansSlice(len int) InstrumentationLibrarySpansSlice

NewInstrumentationLibrarySpansSlice creates a InstrumentationLibrarySpansSlice with "len" empty elements.

es := NewInstrumentationLibrarySpansSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (InstrumentationLibrarySpansSlice) Get added in v0.2.9

Get 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.Get(i)
    ... // Do something with the element
}

func (InstrumentationLibrarySpansSlice) Len added in v0.2.9

Len returns the number of elements in the slice.

func (InstrumentationLibrarySpansSlice) Remove added in v0.2.9

func (es InstrumentationLibrarySpansSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (InstrumentationLibrarySpansSlice) Resize added in v0.2.9

func (es InstrumentationLibrarySpansSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type Int64DataPoint

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

Int64DataPoint is a single data point in a timeseries that describes the time-varying values of a int64 metric.

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

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

func NewInt64DataPoint

func NewInt64DataPoint() Int64DataPoint

NewInt64DataPoint creates a new empty Int64DataPoint.

func (Int64DataPoint) LabelsMap added in v0.2.8

func (ms Int64DataPoint) LabelsMap() StringMap

LabelsMap returns the Labels associated with this Int64DataPoint.

func (Int64DataPoint) SetLabelsMap added in v0.2.8

func (ms Int64DataPoint) SetLabelsMap(v StringMap)

SetLabelsMap replaces the Labels associated with this Int64DataPoint.

func (Int64DataPoint) SetStartTime

func (ms Int64DataPoint) SetStartTime(v TimestampUnixNano)

SetStartTime replaces the starttime associated with this Int64DataPoint.

func (Int64DataPoint) SetTimestamp

func (ms Int64DataPoint) SetTimestamp(v TimestampUnixNano)

SetTimestamp replaces the timestamp associated with this Int64DataPoint.

func (Int64DataPoint) SetValue

func (ms Int64DataPoint) SetValue(v int64)

SetValue replaces the value associated with this Int64DataPoint.

func (Int64DataPoint) StartTime

func (ms Int64DataPoint) StartTime() TimestampUnixNano

StartTime returns the starttime associated with this Int64DataPoint.

func (Int64DataPoint) Timestamp

func (ms Int64DataPoint) Timestamp() TimestampUnixNano

Timestamp returns the timestamp associated with this Int64DataPoint.

func (Int64DataPoint) Value

func (ms Int64DataPoint) Value() int64

Value returns the value associated with this Int64DataPoint.

type Int64DataPointSlice added in v0.2.8

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

Int64DataPointSlice logically represents a slice of Int64DataPoint.

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

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

func NewInt64DataPointSlice

func NewInt64DataPointSlice(len int) Int64DataPointSlice

NewInt64DataPointSlice creates a Int64DataPointSlice with "len" empty elements.

es := NewInt64DataPointSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (Int64DataPointSlice) Get added in v0.2.8

Get 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.Get(i)
    ... // Do something with the element
}

func (Int64DataPointSlice) Len added in v0.2.8

func (es Int64DataPointSlice) Len() int

Len returns the number of elements in the slice.

func (Int64DataPointSlice) Remove added in v0.2.8

func (es Int64DataPointSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (Int64DataPointSlice) Resize added in v0.2.8

func (es Int64DataPointSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type Metric

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

MetricDescriptor is the descriptor of a metric.

This is a reference type, if passsed 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.

func (Metric) DoubleDataPoints

func (ms Metric) DoubleDataPoints() DoubleDataPointSlice

DoubleDataPoints returns the DoubleDataPoints associated with this Metric.

func (Metric) HistogramDataPoints

func (ms Metric) HistogramDataPoints() HistogramDataPointSlice

HistogramDataPoints returns the HistogramDataPoints associated with this Metric.

func (Metric) Int64DataPoints

func (ms Metric) Int64DataPoints() Int64DataPointSlice

Int64DataPoints returns the Int64DataPoints associated with this Metric.

func (Metric) MetricDescriptor

func (ms Metric) MetricDescriptor() MetricDescriptor

MetricDescriptor returns the metricdescriptor associated with this Metric.

func (Metric) SetDoubleDataPoints

func (ms Metric) SetDoubleDataPoints(v DoubleDataPointSlice)

SetDoubleDataPoints replaces the DoubleDataPoints associated with this Metric.

func (Metric) SetHistogramDataPoints

func (ms Metric) SetHistogramDataPoints(v HistogramDataPointSlice)

SetHistogramDataPoints replaces the HistogramDataPoints associated with this Metric.

func (Metric) SetInt64DataPoints

func (ms Metric) SetInt64DataPoints(v Int64DataPointSlice)

SetInt64DataPoints replaces the Int64DataPoints associated with this Metric.

func (Metric) SetMetricDescriptor

func (ms Metric) SetMetricDescriptor(v MetricDescriptor)

SetMetricDescriptor replaces the metricdescriptor associated with this Metric.

func (Metric) SetSummaryDataPoints

func (ms Metric) SetSummaryDataPoints(v SummaryDataPointSlice)

SetSummaryDataPoints replaces the SummaryDataPoints associated with this Metric.

func (Metric) SummaryDataPoints

func (ms Metric) SummaryDataPoints() SummaryDataPointSlice

SummaryDataPoints returns the SummaryDataPoints associated with this Metric.

type MetricData

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

MetricData is the top-level struct that is propagated through the metrics pipeline. This is the newer version of consumerdata.MetricsData, but uses more efficient in-memory representation.

This is a reference type (like builtin map).

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

func MetricDataFromOtlp

func MetricDataFromOtlp(orig []*otlpmetrics.ResourceMetrics) MetricData

MetricDataFromOtlp creates the internal MetricData representation from the OTLP.

func NewMetricData

func NewMetricData() MetricData

NewMetricData creates a new MetricData.

func (MetricData) Clone added in v0.2.9

func (md MetricData) Clone() MetricData

Clone returns a copy of MetricData.

func (MetricData) MetricCount

func (md MetricData) MetricCount() int

MetricCount calculates the total number of metrics.

func (MetricData) ResourceMetrics

func (md MetricData) ResourceMetrics() ResourceMetricsSlice

func (MetricData) SetResourceMetrics

func (md MetricData) SetResourceMetrics(v ResourceMetricsSlice)

type MetricDescriptor

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

MetricDescriptor is the descriptor of a metric.

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

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

func NewMetricDescriptor

func NewMetricDescriptor() MetricDescriptor

NewMetricDescriptor creates a new empty MetricDescriptor.

func (MetricDescriptor) Description

func (ms MetricDescriptor) Description() string

Description returns the description associated with this MetricDescriptor.

func (MetricDescriptor) LabelsMap added in v0.2.8

func (ms MetricDescriptor) LabelsMap() StringMap

LabelsMap returns the Labels associated with this MetricDescriptor.

func (MetricDescriptor) Name

func (ms MetricDescriptor) Name() string

Name returns the name associated with this MetricDescriptor.

func (MetricDescriptor) SetDescription

func (ms MetricDescriptor) SetDescription(v string)

SetDescription replaces the description associated with this MetricDescriptor.

func (MetricDescriptor) SetLabelsMap added in v0.2.8

func (ms MetricDescriptor) SetLabelsMap(v StringMap)

SetLabelsMap replaces the Labels associated with this MetricDescriptor.

func (MetricDescriptor) SetName

func (ms MetricDescriptor) SetName(v string)

SetName replaces the name associated with this MetricDescriptor.

func (MetricDescriptor) SetType added in v0.2.8

func (ms MetricDescriptor) SetType(v MetricType)

SetType replaces the type associated with this MetricDescriptor.

func (MetricDescriptor) SetUnit

func (ms MetricDescriptor) SetUnit(v string)

SetUnit replaces the unit associated with this MetricDescriptor.

func (MetricDescriptor) Type

func (ms MetricDescriptor) Type() MetricType

Type returns the type associated with this MetricDescriptor.

func (MetricDescriptor) Unit

func (ms MetricDescriptor) Unit() string

Unit returns the unit associated with this MetricDescriptor.

type MetricSlice added in v0.2.8

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

MetricSlice logically represents a slice of Metric.

This is a reference type, if passsed 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(len int) MetricSlice

NewMetricSlice creates a MetricSlice with "len" empty elements.

es := NewMetricSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (MetricSlice) Get added in v0.2.8

func (es MetricSlice) Get(ix int) Metric

Get 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.Get(i)
    ... // Do something with the element
}

func (MetricSlice) Len added in v0.2.8

func (es MetricSlice) Len() int

Len returns the number of elements in the slice.

func (MetricSlice) Remove added in v0.2.8

func (es MetricSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (MetricSlice) Resize added in v0.2.8

func (es MetricSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type Resource

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

Resource information.

This is a reference type, if passsed 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.

func (Resource) Attributes

func (ms Resource) Attributes() AttributeMap

Attributes returns the Attributes associated with this Resource.

func (Resource) SetAttributes

func (ms Resource) SetAttributes(v AttributeMap)

SetAttributes replaces the Attributes associated with this Resource.

type ResourceMetrics

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

InstrumentationLibraryMetrics is a collection of metrics from a LibraryInstrumentation.

This is a reference type, if passsed 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.

func (ResourceMetrics) InstrumentationLibraryMetrics

func (ms ResourceMetrics) InstrumentationLibraryMetrics() InstrumentationLibraryMetricsSlice

InstrumentationLibraryMetrics returns the InstrumentationLibraryMetrics associated with this ResourceMetrics.

func (ResourceMetrics) Resource

func (ms ResourceMetrics) Resource() Resource

Resource returns the resource associated with this ResourceMetrics.

func (ResourceMetrics) SetInstrumentationLibraryMetrics

func (ms ResourceMetrics) SetInstrumentationLibraryMetrics(v InstrumentationLibraryMetricsSlice)

SetInstrumentationLibraryMetrics replaces the InstrumentationLibraryMetrics associated with this ResourceMetrics.

func (ResourceMetrics) SetResource

func (ms ResourceMetrics) SetResource(v Resource)

SetResource replaces the resource associated with this ResourceMetrics.

type ResourceMetricsSlice added in v0.2.8

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

ResourceMetricsSlice logically represents a slice of ResourceMetrics.

This is a reference type, if passsed 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(len int) ResourceMetricsSlice

NewResourceMetricsSlice creates a ResourceMetricsSlice with "len" empty elements.

es := NewResourceMetricsSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (ResourceMetricsSlice) Get added in v0.2.8

Get 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.Get(i)
    ... // Do something with the element
}

func (ResourceMetricsSlice) Len added in v0.2.8

func (es ResourceMetricsSlice) Len() int

Len returns the number of elements in the slice.

func (ResourceMetricsSlice) Remove added in v0.2.8

func (es ResourceMetricsSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (ResourceMetricsSlice) Resize added in v0.2.8

func (es ResourceMetricsSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type ResourceSpans

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

InstrumentationLibrarySpans is a collection of spans from a LibraryInstrumentation.

This is a reference type, if passsed 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.

func (ResourceSpans) InstrumentationLibrarySpans

func (ms ResourceSpans) InstrumentationLibrarySpans() InstrumentationLibrarySpansSlice

InstrumentationLibrarySpans returns the InstrumentationLibrarySpans associated with this ResourceSpans.

func (ResourceSpans) Resource

func (ms ResourceSpans) Resource() Resource

Resource returns the resource associated with this ResourceSpans.

func (ResourceSpans) SetInstrumentationLibrarySpans

func (ms ResourceSpans) SetInstrumentationLibrarySpans(v InstrumentationLibrarySpansSlice)

SetInstrumentationLibrarySpans replaces the InstrumentationLibrarySpans associated with this ResourceSpans.

func (ResourceSpans) SetResource

func (ms ResourceSpans) SetResource(v Resource)

SetResource replaces the resource associated with this ResourceSpans.

type ResourceSpansSlice added in v0.2.9

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

ResourceSpansSlice logically represents a slice of ResourceSpans.

This is a reference type, if passsed 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 added in v0.2.9

func NewResourceSpansSlice(len int) ResourceSpansSlice

NewResourceSpansSlice creates a ResourceSpansSlice with "len" empty elements.

es := NewResourceSpansSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (ResourceSpansSlice) Get added in v0.2.9

Get 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.Get(i)
    ... // Do something with the element
}

func (ResourceSpansSlice) Len added in v0.2.9

func (es ResourceSpansSlice) Len() int

Len returns the number of elements in the slice.

func (ResourceSpansSlice) Remove added in v0.2.9

func (es ResourceSpansSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (ResourceSpansSlice) Resize added in v0.2.9

func (es ResourceSpansSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

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/master/opentelemetry/proto/trace/v1/trace.proto#L37

This is a reference type, if passsed 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.

func (Span) Attributes

func (ms Span) Attributes() AttributeMap

Attributes returns the Attributes associated with this Span.

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) EndTime

func (ms Span) EndTime() TimestampUnixNano

EndTime returns the endtime 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) 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) SetAttributes

func (ms Span) SetAttributes(v AttributeMap)

SetAttributes replaces the Attributes associated with this Span.

func (Span) SetDroppedAttributesCount added in v0.2.8

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) SetEndTime

func (ms Span) SetEndTime(v TimestampUnixNano)

SetEndTime replaces the endtime associated with this Span.

func (Span) SetEvents

func (ms Span) SetEvents(v SpanEventSlice)

SetEvents replaces the Events associated with this Span.

func (Span) SetKind

func (ms Span) SetKind(v SpanKind)

SetKind replaces the kind associated with this Span.

func (ms Span) SetLinks(v SpanLinkSlice)

SetLinks replaces the Links 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) SetStartTime

func (ms Span) SetStartTime(v TimestampUnixNano)

SetStartTime replaces the starttime associated with this Span.

func (Span) SetStatus

func (ms Span) SetStatus(v SpanStatus)

SetStatus replaces the status 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) StartTime

func (ms Span) StartTime() TimestampUnixNano

StartTime returns the starttime 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 passsed 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.

func (SpanEvent) Attributes

func (ms SpanEvent) Attributes() AttributeMap

Attributes returns the Attributes associated with this SpanEvent.

func (SpanEvent) DroppedAttributesCount

func (ms SpanEvent) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this SpanEvent.

func (SpanEvent) Name

func (ms SpanEvent) Name() string

Name returns the name associated with this SpanEvent.

func (SpanEvent) SetAttributes

func (ms SpanEvent) SetAttributes(v AttributeMap)

SetAttributes replaces the Attributes associated with this SpanEvent.

func (SpanEvent) SetDroppedAttributesCount added in v0.2.8

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 TimestampUnixNano)

SetTimestamp replaces the timestamp associated with this SpanEvent.

func (SpanEvent) Timestamp

func (ms SpanEvent) Timestamp() TimestampUnixNano

Timestamp returns the timestamp associated with this SpanEvent.

type SpanEventSlice added in v0.2.8

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

SpanEventSlice logically represents a slice of SpanEvent.

This is a reference type, if passsed 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(len int) SpanEventSlice

NewSpanEventSlice creates a SpanEventSlice with "len" empty elements.

es := NewSpanEventSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (SpanEventSlice) Get added in v0.2.8

func (es SpanEventSlice) Get(ix int) SpanEvent

Get 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.Get(i)
    ... // Do something with the element
}

func (SpanEventSlice) Len added in v0.2.8

func (es SpanEventSlice) Len() int

Len returns the number of elements in the slice.

func (SpanEventSlice) Remove added in v0.2.8

func (es SpanEventSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (SpanEventSlice) Resize added in v0.2.8

func (es SpanEventSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type SpanID

type SpanID []byte

func NewSpanID

func NewSpanID(bytes []byte) SpanID

func (SpanID) Bytes

func (s SpanID) Bytes() []byte

type SpanKind

type SpanKind otlptrace.Span_SpanKind
const (
	SpanKindUNSPECIFIED SpanKind = 0
	SpanKindINTERNAL    SpanKind = SpanKind(otlptrace.Span_INTERNAL)
	SpanKindSERVER      SpanKind = SpanKind(otlptrace.Span_SERVER)
	SpanKindCLIENT      SpanKind = SpanKind(otlptrace.Span_CLIENT)
	SpanKindPRODUCER    SpanKind = SpanKind(otlptrace.Span_PRODUCER)
	SpanKindCONSUMER    SpanKind = SpanKind(otlptrace.Span_CONSUMER)
)

func (SpanKind) String

func (sk SpanKind) String() string
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 OTLP for link definition.

This is a reference type, if passsed 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.

func (SpanLink) Attributes

func (ms SpanLink) Attributes() AttributeMap

Attributes returns the Attributes associated with this SpanLink.

func (SpanLink) DroppedAttributesCount

func (ms SpanLink) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this SpanLink.

func (SpanLink) SetAttributes

func (ms SpanLink) SetAttributes(v AttributeMap)

SetAttributes replaces the Attributes associated with this SpanLink.

func (SpanLink) SetDroppedAttributesCount added in v0.2.8

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 added in v0.2.8

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

SpanLinkSlice logically represents a slice of SpanLink.

This is a reference type, if passsed 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(len int) SpanLinkSlice

NewSpanLinkSlice creates a SpanLinkSlice with "len" empty elements.

es := NewSpanLinkSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (SpanLinkSlice) Get added in v0.2.8

func (es SpanLinkSlice) Get(ix int) SpanLink

Get 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.Get(i)
    ... // Do something with the element
}

func (SpanLinkSlice) Len added in v0.2.8

func (es SpanLinkSlice) Len() int

Len returns the number of elements in the slice.

func (SpanLinkSlice) Remove added in v0.2.8

func (es SpanLinkSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (SpanLinkSlice) Resize added in v0.2.8

func (es SpanLinkSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type SpanSlice added in v0.2.9

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

SpanSlice logically represents a slice of Span.

This is a reference type, if passsed 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(len int) SpanSlice

NewSpanSlice creates a SpanSlice with "len" empty elements.

es := NewSpanSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (SpanSlice) Get added in v0.2.9

func (es SpanSlice) Get(ix int) Span

Get 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.Get(i)
    ... // Do something with the element
}

func (SpanSlice) Len added in v0.2.9

func (es SpanSlice) Len() int

Len returns the number of elements in the slice.

func (SpanSlice) Remove added in v0.2.9

func (es SpanSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (SpanSlice) Resize added in v0.2.9

func (es SpanSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type SpanStatus

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

SpanStatus is an optional final status for this span. Semantically when Status wasn't set it is means span ended without errors and assume Status.Ok (code = 0).

This is a reference type, if passsed 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.

func (SpanStatus) Code

func (ms SpanStatus) Code() StatusCode

Code returns the code associated with this SpanStatus.

func (SpanStatus) Message

func (ms SpanStatus) Message() string

Message returns the message associated with this SpanStatus.

func (SpanStatus) SetCode added in v0.2.8

func (ms SpanStatus) SetCode(v StatusCode)

SetCode replaces the code associated with this SpanStatus.

func (SpanStatus) SetMessage added in v0.2.8

func (ms SpanStatus) SetMessage(v string)

SetMessage replaces the message associated with this SpanStatus.

type StringKeyValue added in v0.2.8

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

StringKeyValue stores a key and value pair.

func NewStringKeyValue added in v0.2.8

func NewStringKeyValue(k string, v string) StringKeyValue

NewStringKeyValue creates a new StringKeyValue with the given key and value.

func (StringKeyValue) Key added in v0.2.8

func (akv StringKeyValue) Key() string

Key returns the key associated with this StringKeyValue.

func (StringKeyValue) SetValue added in v0.2.8

func (akv StringKeyValue) SetValue(v string)

SetValue replaces the value associated with this StringKeyValue.

func (StringKeyValue) Value added in v0.2.8

func (akv StringKeyValue) Value() string

Value returns the value associated with this StringKeyValue.

type StringMap added in v0.2.8

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

StringMap stores a map of attribute keys to values.

func NewStringMap added in v0.2.8

func NewStringMap(attrMap map[string]string) StringMap

NewStringMap creates a new StringMap from the given map[string]string.

func (StringMap) Delete added in v0.2.8

func (sm StringMap) Delete(k string) bool

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

func (StringMap) Get added in v0.2.8

func (sm StringMap) Get(k string) (StringKeyValue, bool)

Get returns the StringKeyValue associated with the key and true, otherwise an invalid instance of the StringKeyValue and false.

func (StringMap) GetStringKeyValue added in v0.2.8

func (sm StringMap) GetStringKeyValue(ix int) StringKeyValue

GetStringKeyValue returns the StringKeyValue associated with the given index.

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

for i := 0; i < am.Len(); i++ {
    akv := am.GetStringKeyValue(i)
    ... // Do something with the attribute
}

func (StringMap) Insert added in v0.2.8

func (sm StringMap) Insert(k, v string)

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

func (StringMap) Len added in v0.2.8

func (sm StringMap) Len() int

Len returns the number of StringKeyValue in the map.

func (StringMap) Sort added in v0.2.8

func (sm StringMap) Sort() StringMap

Sort sorts the entries in the StringMap so two instances can be compared. Returns the same instance to allow nicer code like: assert.EqualValues(t, expected.Sort(), actual.Sort())

func (StringMap) Update added in v0.2.8

func (sm StringMap) Update(k, v string)

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

func (StringMap) Upsert added in v0.2.8

func (sm StringMap) Upsert(k, v string)

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

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 metric.

This is a reference type, if passsed 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.

func (SummaryDataPoint) Count

func (ms SummaryDataPoint) Count() uint64

Count returns the count associated with this SummaryDataPoint.

func (SummaryDataPoint) LabelsMap added in v0.2.8

func (ms SummaryDataPoint) LabelsMap() StringMap

LabelsMap returns the Labels associated with this SummaryDataPoint.

func (SummaryDataPoint) SetCount

func (ms SummaryDataPoint) SetCount(v uint64)

SetCount replaces the count associated with this SummaryDataPoint.

func (SummaryDataPoint) SetLabelsMap added in v0.2.8

func (ms SummaryDataPoint) SetLabelsMap(v StringMap)

SetLabelsMap replaces the Labels associated with this SummaryDataPoint.

func (SummaryDataPoint) SetStartTime

func (ms SummaryDataPoint) SetStartTime(v TimestampUnixNano)

SetStartTime replaces the starttime 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 TimestampUnixNano)

SetTimestamp replaces the timestamp associated with this SummaryDataPoint.

func (SummaryDataPoint) SetValueAtPercentiles

func (ms SummaryDataPoint) SetValueAtPercentiles(v SummaryValueAtPercentileSlice)

SetValueAtPercentiles replaces the PercentileValues associated with this SummaryDataPoint.

func (SummaryDataPoint) StartTime

func (ms SummaryDataPoint) StartTime() TimestampUnixNano

StartTime returns the starttime 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() TimestampUnixNano

Timestamp returns the timestamp associated with this SummaryDataPoint.

func (SummaryDataPoint) ValueAtPercentiles

func (ms SummaryDataPoint) ValueAtPercentiles() SummaryValueAtPercentileSlice

ValueAtPercentiles returns the PercentileValues associated with this SummaryDataPoint.

type SummaryDataPointSlice added in v0.2.8

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

SummaryDataPointSlice logically represents a slice of SummaryDataPoint.

This is a reference type, if passsed 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(len int) SummaryDataPointSlice

NewSummaryDataPointSlice creates a SummaryDataPointSlice with "len" empty elements.

es := NewSummaryDataPointSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (SummaryDataPointSlice) Get added in v0.2.8

Get 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.Get(i)
    ... // Do something with the element
}

func (SummaryDataPointSlice) Len added in v0.2.8

func (es SummaryDataPointSlice) Len() int

Len returns the number of elements in the slice.

func (SummaryDataPointSlice) Remove added in v0.2.8

func (es SummaryDataPointSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (SummaryDataPointSlice) Resize added in v0.2.8

func (es SummaryDataPointSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type SummaryValueAtPercentile

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

SummaryValueAtPercentile represents the value at a given percentile of a distribution.

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

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

func NewSummaryValueAtPercentile

func NewSummaryValueAtPercentile() SummaryValueAtPercentile

NewSummaryValueAtPercentile creates a new empty SummaryValueAtPercentile.

func (SummaryValueAtPercentile) Percentile

func (ms SummaryValueAtPercentile) Percentile() float64

Percentile returns the percentile associated with this SummaryValueAtPercentile.

func (SummaryValueAtPercentile) SetPercentile

func (ms SummaryValueAtPercentile) SetPercentile(v float64)

SetPercentile replaces the percentile associated with this SummaryValueAtPercentile.

func (SummaryValueAtPercentile) SetValue

func (ms SummaryValueAtPercentile) SetValue(v float64)

SetValue replaces the value associated with this SummaryValueAtPercentile.

func (SummaryValueAtPercentile) Value

func (ms SummaryValueAtPercentile) Value() float64

Value returns the value associated with this SummaryValueAtPercentile.

type SummaryValueAtPercentileSlice added in v0.2.8

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

SummaryValueAtPercentileSlice logically represents a slice of SummaryValueAtPercentile.

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

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

func NewSummaryValueAtPercentileSlice

func NewSummaryValueAtPercentileSlice(len int) SummaryValueAtPercentileSlice

NewSummaryValueAtPercentileSlice creates a SummaryValueAtPercentileSlice with "len" empty elements.

es := NewSummaryValueAtPercentileSlice(4)

for i := 0; i < es.Len(); i++ {
    e := es.Get(i)
    // Here should set all the values for e.
}

func (SummaryValueAtPercentileSlice) Get added in v0.2.8

Get 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.Get(i)
    ... // Do something with the element
}

func (SummaryValueAtPercentileSlice) Len added in v0.2.8

Len returns the number of elements in the slice.

func (SummaryValueAtPercentileSlice) Remove added in v0.2.8

func (es SummaryValueAtPercentileSlice) Remove(ix int)

Remove the element at the given index from the slice. Elements after the removed one are shifted to fill the emptied space. The length of the slice is reduced by one.

func (SummaryValueAtPercentileSlice) Resize added in v0.2.8

func (es SummaryValueAtPercentileSlice) Resize(from, to int)

Resize the slice. This operation is equivalent with slice[from:to].

type TimestampUnixNano

type TimestampUnixNano uint64

TimestampUnixNano is a time specified as UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.

type TraceData

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

TraceData is the top-level struct that is propagated through the traces pipeline. This is the newer version of consumerdata.TraceData, but uses more efficient in-memory representation.

func NewTraceData

func NewTraceData() TraceData

NewTraceData creates a new TraceData.

func TraceDataFromOtlp added in v0.2.9

func TraceDataFromOtlp(orig []*otlptrace.ResourceSpans) TraceData

TraceDataFromOtlp creates the internal TraceData representation from the OTLP.

func (TraceData) Clone added in v0.2.9

func (td TraceData) Clone() TraceData

Clone returns a copy of TraceData.

func (TraceData) ResourceSpans

func (td TraceData) ResourceSpans() ResourceSpansSlice

func (TraceData) SetResourceSpans added in v0.2.9

func (td TraceData) SetResourceSpans(v ResourceSpansSlice)

func (TraceData) SpanCount

func (td TraceData) SpanCount() int

SpanCount calculates the total number of spans.

type TraceID

type TraceID []byte

func NewTraceID

func NewTraceID(bytes []byte) TraceID

func (TraceID) Bytes

func (t TraceID) Bytes() []byte

type TraceState

type TraceState string

TraceState in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header

Jump to

Keyboard shortcuts

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