Documentation ¶
Index ¶
- Constants
- func LogsToOtlp(mw Logs) *otlpcollectorlog.ExportLogsServiceRequest
- func LogsToProto(l Logs) otlplogs.LogsData
- func MetricsToOtlp(mw Metrics) *otlpcollectormetrics.ExportMetricsServiceRequest
- func MetricsToProto(l Metrics) otlpmetrics.MetricsData
- func TracesToOtlp(mw Traces) *otlpcollectortrace.ExportTraceServiceRequest
- func TracesToProto(mw Traces) otlptrace.TracesData
- type Buckets
- type Exemplar
- func (ms Exemplar) CopyTo(dest Exemplar)
- func (ms Exemplar) DoubleVal() float64
- func (ms Exemplar) FilteredAttributes() Map
- func (ms Exemplar) IntVal() int64
- func (ms Exemplar) MoveTo(dest Exemplar)
- func (ms Exemplar) SetDoubleVal(v float64)
- func (ms Exemplar) SetIntVal(v int64)
- func (ms Exemplar) SetSpanID(v SpanID)
- func (ms Exemplar) SetTimestamp(v Timestamp)
- func (ms Exemplar) SetTraceID(v TraceID)
- func (ms Exemplar) SpanID() SpanID
- func (ms Exemplar) Timestamp() Timestamp
- func (ms Exemplar) TraceID() TraceID
- func (ms Exemplar) ValueType() ExemplarValueType
- type ExemplarSlice
- func (es ExemplarSlice) AppendEmpty() Exemplar
- func (es ExemplarSlice) At(ix int) Exemplar
- func (es ExemplarSlice) CopyTo(dest ExemplarSlice)
- func (es ExemplarSlice) EnsureCapacity(newCap int)
- func (es ExemplarSlice) Len() int
- func (es ExemplarSlice) MoveAndAppendTo(dest ExemplarSlice)
- func (es ExemplarSlice) RemoveIf(f func(Exemplar) bool)
- type ExemplarValueType
- type ExponentialHistogram
- func (ms ExponentialHistogram) AggregationTemporality() MetricAggregationTemporality
- func (ms ExponentialHistogram) CopyTo(dest ExponentialHistogram)
- func (ms ExponentialHistogram) DataPoints() ExponentialHistogramDataPointSlice
- func (ms ExponentialHistogram) MoveTo(dest ExponentialHistogram)
- func (ms ExponentialHistogram) SetAggregationTemporality(v MetricAggregationTemporality)
- type ExponentialHistogramDataPoint
- func (ms ExponentialHistogramDataPoint) Attributes() Map
- func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoint)
- func (ms ExponentialHistogramDataPoint) Count() uint64
- func (ms ExponentialHistogramDataPoint) Exemplars() ExemplarSlice
- func (ms ExponentialHistogramDataPoint) Flags() MetricDataPointFlags
- func (ms ExponentialHistogramDataPoint) HasMax() bool
- func (ms ExponentialHistogramDataPoint) HasMin() bool
- func (ms ExponentialHistogramDataPoint) Max() float64
- func (ms ExponentialHistogramDataPoint) Min() float64
- func (ms ExponentialHistogramDataPoint) MoveTo(dest ExponentialHistogramDataPoint)
- func (ms ExponentialHistogramDataPoint) Negative() Buckets
- func (ms ExponentialHistogramDataPoint) Positive() Buckets
- func (ms ExponentialHistogramDataPoint) Scale() int32
- func (ms ExponentialHistogramDataPoint) SetCount(v uint64)
- func (ms ExponentialHistogramDataPoint) SetFlags(v MetricDataPointFlags)
- func (ms ExponentialHistogramDataPoint) SetMax(v float64)
- func (ms ExponentialHistogramDataPoint) SetMin(v float64)
- func (ms ExponentialHistogramDataPoint) SetScale(v int32)
- func (ms ExponentialHistogramDataPoint) SetStartTimestamp(v Timestamp)
- func (ms ExponentialHistogramDataPoint) SetSum(v float64)
- func (ms ExponentialHistogramDataPoint) SetTimestamp(v Timestamp)
- func (ms ExponentialHistogramDataPoint) SetZeroCount(v uint64)
- func (ms ExponentialHistogramDataPoint) StartTimestamp() Timestamp
- func (ms ExponentialHistogramDataPoint) Sum() float64
- func (ms ExponentialHistogramDataPoint) Timestamp() Timestamp
- func (ms ExponentialHistogramDataPoint) ZeroCount() uint64
- type ExponentialHistogramDataPointSlice
- func (es ExponentialHistogramDataPointSlice) AppendEmpty() ExponentialHistogramDataPoint
- func (es ExponentialHistogramDataPointSlice) At(ix int) ExponentialHistogramDataPoint
- func (es ExponentialHistogramDataPointSlice) CopyTo(dest ExponentialHistogramDataPointSlice)
- func (es ExponentialHistogramDataPointSlice) EnsureCapacity(newCap int)
- func (es ExponentialHistogramDataPointSlice) Len() int
- func (es ExponentialHistogramDataPointSlice) MoveAndAppendTo(dest ExponentialHistogramDataPointSlice)
- func (es ExponentialHistogramDataPointSlice) RemoveIf(f func(ExponentialHistogramDataPoint) bool)
- func (es ExponentialHistogramDataPointSlice) Sort(less func(a, b ExponentialHistogramDataPoint) bool) ExponentialHistogramDataPointSlice
- type Gauge
- type Histogram
- type HistogramDataPoint
- func (ms HistogramDataPoint) Attributes() Map
- func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint)
- func (ms HistogramDataPoint) Count() uint64
- func (ms HistogramDataPoint) Exemplars() ExemplarSlice
- func (ms HistogramDataPoint) Flags() MetricDataPointFlags
- func (ms HistogramDataPoint) HasMax() bool
- func (ms HistogramDataPoint) HasMin() bool
- func (ms HistogramDataPoint) HasSum() bool
- func (ms HistogramDataPoint) MBucketCounts() []uint64
- func (ms HistogramDataPoint) MExplicitBounds() []float64
- func (ms HistogramDataPoint) Max() float64
- func (ms HistogramDataPoint) Min() float64
- func (ms HistogramDataPoint) MoveTo(dest HistogramDataPoint)
- func (ms HistogramDataPoint) SetCount(v uint64)
- func (ms HistogramDataPoint) SetFlags(v MetricDataPointFlags)
- func (ms HistogramDataPoint) SetMBucketCounts(v []uint64)
- func (ms HistogramDataPoint) SetMExplicitBounds(v []float64)
- func (ms HistogramDataPoint) SetMax(v float64)
- func (ms HistogramDataPoint) SetMin(v float64)
- func (ms HistogramDataPoint) SetStartTimestamp(v Timestamp)
- func (ms HistogramDataPoint) SetSum(v float64)
- func (ms HistogramDataPoint) SetTimestamp(v Timestamp)
- func (ms HistogramDataPoint) StartTimestamp() Timestamp
- func (ms HistogramDataPoint) Sum() float64
- func (ms HistogramDataPoint) Timestamp() Timestamp
- type HistogramDataPointSlice
- func (es HistogramDataPointSlice) AppendEmpty() HistogramDataPoint
- func (es HistogramDataPointSlice) At(ix int) HistogramDataPoint
- func (es HistogramDataPointSlice) CopyTo(dest HistogramDataPointSlice)
- func (es HistogramDataPointSlice) EnsureCapacity(newCap int)
- func (es HistogramDataPointSlice) Len() int
- func (es HistogramDataPointSlice) MoveAndAppendTo(dest HistogramDataPointSlice)
- func (es HistogramDataPointSlice) RemoveIf(f func(HistogramDataPoint) bool)
- func (es HistogramDataPointSlice) Sort(less func(a, b HistogramDataPoint) bool) HistogramDataPointSlice
- type InstrumentationScope
- func (ms InstrumentationScope) CopyTo(dest InstrumentationScope)
- func (ms InstrumentationScope) MoveTo(dest InstrumentationScope)
- func (ms InstrumentationScope) Name() string
- func (ms InstrumentationScope) SetName(v string)
- func (ms InstrumentationScope) SetVersion(v string)
- func (ms InstrumentationScope) Version() string
- type LogRecord
- func (ms LogRecord) Attributes() Map
- func (ms LogRecord) Body() Value
- func (ms LogRecord) CopyTo(dest LogRecord)
- func (ms LogRecord) DroppedAttributesCount() uint32
- func (ms LogRecord) Flags() uint32
- func (ms LogRecord) MoveTo(dest LogRecord)
- func (ms LogRecord) ObservedTimestamp() Timestamp
- func (ms LogRecord) SetDroppedAttributesCount(v uint32)
- func (ms LogRecord) SetFlags(v uint32)
- func (ms LogRecord) SetObservedTimestamp(v Timestamp)
- func (ms LogRecord) SetSeverityNumber(v SeverityNumber)
- func (ms LogRecord) SetSeverityText(v string)
- func (ms LogRecord) SetSpanID(v SpanID)
- func (ms LogRecord) SetTimestamp(v Timestamp)
- func (ms LogRecord) SetTraceID(v TraceID)
- func (ms LogRecord) SeverityNumber() SeverityNumber
- func (ms LogRecord) SeverityText() string
- func (ms LogRecord) SpanID() SpanID
- func (ms LogRecord) Timestamp() Timestamp
- func (ms LogRecord) TraceID() TraceID
- type LogRecordSlice
- func (es LogRecordSlice) AppendEmpty() LogRecord
- func (es LogRecordSlice) At(ix int) LogRecord
- func (es LogRecordSlice) CopyTo(dest LogRecordSlice)
- func (es LogRecordSlice) EnsureCapacity(newCap int)
- func (es LogRecordSlice) Len() int
- func (es LogRecordSlice) MoveAndAppendTo(dest LogRecordSlice)
- func (es LogRecordSlice) RemoveIf(f func(LogRecord) bool)
- func (es LogRecordSlice) Sort(less func(a, b LogRecord) bool) LogRecordSlice
- type Logs
- type Map
- func (m Map) AsRaw() map[string]interface{}
- func (m Map) Clear()
- func (m Map) CopyTo(dest Map)
- func (m Map) EnsureCapacity(capacity int)
- func (m Map) Get(key string) (Value, bool)
- func (m Map) Insert(k string, v Value)
- func (m Map) InsertBool(k string, v bool)
- func (m Map) InsertDouble(k string, v float64)
- func (m Map) InsertInt(k string, v int64)
- func (m Map) InsertMBytes(k string, v []byte)
- func (m Map) InsertNull(k string)
- func (m Map) InsertString(k string, v string)
- func (m Map) Len() int
- func (m Map) Range(f func(k string, v Value) bool)
- func (m Map) Remove(key string) bool
- func (m Map) RemoveIf(f func(string, Value) bool)
- func (m Map) Sort() Map
- func (m Map) Update(k string, v Value)
- func (m Map) UpdateBool(k string, v bool)
- func (m Map) UpdateDouble(k string, v float64)
- func (m Map) UpdateInt(k string, v int64)
- func (m Map) UpdateMBytes(k string, v []byte)
- func (m Map) UpdateString(k string, v string)
- func (m Map) Upsert(k string, v Value)
- func (m Map) UpsertBool(k string, v bool)
- func (m Map) UpsertDouble(k string, v float64)
- func (m Map) UpsertInt(k string, v int64)
- func (m Map) UpsertMBytes(k string, v []byte)
- func (m Map) UpsertString(k string, v string)
- type Metric
- func (ms Metric) CopyTo(dest Metric)
- func (ms Metric) DataType() MetricDataType
- func (ms Metric) Description() string
- func (ms Metric) ExponentialHistogram() ExponentialHistogram
- func (ms Metric) Gauge() Gauge
- func (ms Metric) Histogram() Histogram
- func (ms Metric) MoveTo(dest Metric)
- func (ms Metric) Name() string
- func (ms Metric) SetDataType(ty MetricDataType)
- func (ms Metric) SetDescription(v string)
- func (ms Metric) SetName(v string)
- func (ms Metric) SetUnit(v string)
- func (ms Metric) Sum() Sum
- func (ms Metric) Summary() Summary
- func (ms Metric) Unit() string
- type MetricAggregationTemporality
- type MetricDataPointFlag
- type MetricDataPointFlags
- type MetricDataType
- type MetricSlice
- func (es MetricSlice) AppendEmpty() Metric
- func (es MetricSlice) At(ix int) Metric
- func (es MetricSlice) CopyTo(dest MetricSlice)
- func (es MetricSlice) EnsureCapacity(newCap int)
- func (es MetricSlice) Len() int
- func (es MetricSlice) MoveAndAppendTo(dest MetricSlice)
- func (es MetricSlice) RemoveIf(f func(Metric) bool)
- func (es MetricSlice) Sort(less func(a, b Metric) bool) MetricSlice
- type Metrics
- type NumberDataPoint
- func (ms NumberDataPoint) Attributes() Map
- func (ms NumberDataPoint) CopyTo(dest NumberDataPoint)
- func (ms NumberDataPoint) DoubleVal() float64
- func (ms NumberDataPoint) Exemplars() ExemplarSlice
- func (ms NumberDataPoint) Flags() MetricDataPointFlags
- func (ms NumberDataPoint) IntVal() int64
- func (ms NumberDataPoint) MoveTo(dest NumberDataPoint)
- func (ms NumberDataPoint) SetDoubleVal(v float64)
- func (ms NumberDataPoint) SetFlags(v MetricDataPointFlags)
- func (ms NumberDataPoint) SetIntVal(v int64)
- func (ms NumberDataPoint) SetStartTimestamp(v Timestamp)
- func (ms NumberDataPoint) SetTimestamp(v Timestamp)
- func (ms NumberDataPoint) StartTimestamp() Timestamp
- func (ms NumberDataPoint) Timestamp() Timestamp
- func (ms NumberDataPoint) ValueType() NumberDataPointValueType
- type NumberDataPointSlice
- func (es NumberDataPointSlice) AppendEmpty() NumberDataPoint
- func (es NumberDataPointSlice) At(ix int) NumberDataPoint
- func (es NumberDataPointSlice) CopyTo(dest NumberDataPointSlice)
- func (es NumberDataPointSlice) EnsureCapacity(newCap int)
- func (es NumberDataPointSlice) Len() int
- func (es NumberDataPointSlice) MoveAndAppendTo(dest NumberDataPointSlice)
- func (es NumberDataPointSlice) RemoveIf(f func(NumberDataPoint) bool)
- func (es NumberDataPointSlice) Sort(less func(a, b NumberDataPoint) bool) NumberDataPointSlice
- type NumberDataPointValueType
- type OptionalType
- type Resource
- type ResourceLogs
- type ResourceLogsSlice
- func (es ResourceLogsSlice) AppendEmpty() ResourceLogs
- func (es ResourceLogsSlice) At(ix int) ResourceLogs
- func (es ResourceLogsSlice) CopyTo(dest ResourceLogsSlice)
- func (es ResourceLogsSlice) EnsureCapacity(newCap int)
- func (es ResourceLogsSlice) Len() int
- func (es ResourceLogsSlice) MoveAndAppendTo(dest ResourceLogsSlice)
- func (es ResourceLogsSlice) RemoveIf(f func(ResourceLogs) bool)
- func (es ResourceLogsSlice) Sort(less func(a, b ResourceLogs) bool) ResourceLogsSlice
- type ResourceMetrics
- func (ms ResourceMetrics) CopyTo(dest ResourceMetrics)
- func (ms ResourceMetrics) MoveTo(dest ResourceMetrics)
- func (ms ResourceMetrics) Resource() Resource
- func (ms ResourceMetrics) SchemaUrl() string
- func (ms ResourceMetrics) ScopeMetrics() ScopeMetricsSlice
- func (ms ResourceMetrics) SetSchemaUrl(v string)
- type ResourceMetricsSlice
- func (es ResourceMetricsSlice) AppendEmpty() ResourceMetrics
- func (es ResourceMetricsSlice) At(ix int) ResourceMetrics
- func (es ResourceMetricsSlice) CopyTo(dest ResourceMetricsSlice)
- func (es ResourceMetricsSlice) EnsureCapacity(newCap int)
- func (es ResourceMetricsSlice) Len() int
- func (es ResourceMetricsSlice) MoveAndAppendTo(dest ResourceMetricsSlice)
- func (es ResourceMetricsSlice) RemoveIf(f func(ResourceMetrics) bool)
- func (es ResourceMetricsSlice) Sort(less func(a, b ResourceMetrics) bool) ResourceMetricsSlice
- type ResourceSpans
- type ResourceSpansSlice
- func (es ResourceSpansSlice) AppendEmpty() ResourceSpans
- func (es ResourceSpansSlice) At(ix int) ResourceSpans
- func (es ResourceSpansSlice) CopyTo(dest ResourceSpansSlice)
- func (es ResourceSpansSlice) EnsureCapacity(newCap int)
- func (es ResourceSpansSlice) Len() int
- func (es ResourceSpansSlice) MoveAndAppendTo(dest ResourceSpansSlice)
- func (es ResourceSpansSlice) RemoveIf(f func(ResourceSpans) bool)
- func (es ResourceSpansSlice) Sort(less func(a, b ResourceSpans) bool) ResourceSpansSlice
- type ScopeLogs
- type ScopeLogsSlice
- func (es ScopeLogsSlice) AppendEmpty() ScopeLogs
- func (es ScopeLogsSlice) At(ix int) ScopeLogs
- func (es ScopeLogsSlice) CopyTo(dest ScopeLogsSlice)
- func (es ScopeLogsSlice) EnsureCapacity(newCap int)
- func (es ScopeLogsSlice) Len() int
- func (es ScopeLogsSlice) MoveAndAppendTo(dest ScopeLogsSlice)
- func (es ScopeLogsSlice) RemoveIf(f func(ScopeLogs) bool)
- func (es ScopeLogsSlice) Sort(less func(a, b ScopeLogs) bool) ScopeLogsSlice
- type ScopeMetrics
- type ScopeMetricsSlice
- func (es ScopeMetricsSlice) AppendEmpty() ScopeMetrics
- func (es ScopeMetricsSlice) At(ix int) ScopeMetrics
- func (es ScopeMetricsSlice) CopyTo(dest ScopeMetricsSlice)
- func (es ScopeMetricsSlice) EnsureCapacity(newCap int)
- func (es ScopeMetricsSlice) Len() int
- func (es ScopeMetricsSlice) MoveAndAppendTo(dest ScopeMetricsSlice)
- func (es ScopeMetricsSlice) RemoveIf(f func(ScopeMetrics) bool)
- func (es ScopeMetricsSlice) Sort(less func(a, b ScopeMetrics) bool) ScopeMetricsSlice
- type ScopeSpans
- type ScopeSpansSlice
- func (es ScopeSpansSlice) AppendEmpty() ScopeSpans
- func (es ScopeSpansSlice) At(ix int) ScopeSpans
- func (es ScopeSpansSlice) CopyTo(dest ScopeSpansSlice)
- func (es ScopeSpansSlice) EnsureCapacity(newCap int)
- func (es ScopeSpansSlice) Len() int
- func (es ScopeSpansSlice) MoveAndAppendTo(dest ScopeSpansSlice)
- func (es ScopeSpansSlice) RemoveIf(f func(ScopeSpans) bool)
- func (es ScopeSpansSlice) Sort(less func(a, b ScopeSpans) bool) ScopeSpansSlice
- type SeverityNumber
- type Slice
- type Span
- func (ms Span) Attributes() Map
- func (ms Span) CopyTo(dest Span)
- func (ms Span) DroppedAttributesCount() uint32
- func (ms Span) DroppedEventsCount() uint32
- func (ms Span) DroppedLinksCount() uint32
- func (ms Span) EndTimestamp() Timestamp
- func (ms Span) Events() SpanEventSlice
- func (ms Span) Kind() SpanKind
- func (ms Span) Links() SpanLinkSlice
- func (ms Span) MoveTo(dest Span)
- func (ms Span) Name() string
- func (ms Span) ParentSpanID() SpanID
- func (ms Span) SetDroppedAttributesCount(v uint32)
- func (ms Span) SetDroppedEventsCount(v uint32)
- func (ms Span) SetDroppedLinksCount(v uint32)
- func (ms Span) SetEndTimestamp(v Timestamp)
- func (ms Span) SetKind(v SpanKind)
- func (ms Span) SetName(v string)
- func (ms Span) SetParentSpanID(v SpanID)
- func (ms Span) SetSpanID(v SpanID)
- func (ms Span) SetStartTimestamp(v Timestamp)
- func (ms Span) SetTraceID(v TraceID)
- func (ms Span) SetTraceState(v TraceState)
- func (ms Span) SpanID() SpanID
- func (ms Span) StartTimestamp() Timestamp
- func (ms Span) Status() SpanStatus
- func (ms Span) TraceID() TraceID
- func (ms Span) TraceState() TraceState
- type SpanEvent
- func (ms SpanEvent) Attributes() Map
- func (ms SpanEvent) CopyTo(dest SpanEvent)
- func (ms SpanEvent) DroppedAttributesCount() uint32
- func (ms SpanEvent) MoveTo(dest SpanEvent)
- func (ms SpanEvent) Name() string
- func (ms SpanEvent) SetDroppedAttributesCount(v uint32)
- func (ms SpanEvent) SetName(v string)
- func (ms SpanEvent) SetTimestamp(v Timestamp)
- func (ms SpanEvent) Timestamp() Timestamp
- type SpanEventSlice
- func (es SpanEventSlice) AppendEmpty() SpanEvent
- func (es SpanEventSlice) At(ix int) SpanEvent
- func (es SpanEventSlice) CopyTo(dest SpanEventSlice)
- func (es SpanEventSlice) EnsureCapacity(newCap int)
- func (es SpanEventSlice) Len() int
- func (es SpanEventSlice) MoveAndAppendTo(dest SpanEventSlice)
- func (es SpanEventSlice) RemoveIf(f func(SpanEvent) bool)
- func (es SpanEventSlice) Sort(less func(a, b SpanEvent) bool) SpanEventSlice
- type SpanID
- type SpanKind
- type SpanLink
- func (ms SpanLink) Attributes() Map
- func (ms SpanLink) CopyTo(dest SpanLink)
- func (ms SpanLink) DroppedAttributesCount() uint32
- func (ms SpanLink) MoveTo(dest SpanLink)
- func (ms SpanLink) SetDroppedAttributesCount(v uint32)
- func (ms SpanLink) SetSpanID(v SpanID)
- func (ms SpanLink) SetTraceID(v TraceID)
- func (ms SpanLink) SetTraceState(v TraceState)
- func (ms SpanLink) SpanID() SpanID
- func (ms SpanLink) TraceID() TraceID
- func (ms SpanLink) TraceState() TraceState
- type SpanLinkSlice
- func (es SpanLinkSlice) AppendEmpty() SpanLink
- func (es SpanLinkSlice) At(ix int) SpanLink
- func (es SpanLinkSlice) CopyTo(dest SpanLinkSlice)
- func (es SpanLinkSlice) EnsureCapacity(newCap int)
- func (es SpanLinkSlice) Len() int
- func (es SpanLinkSlice) MoveAndAppendTo(dest SpanLinkSlice)
- func (es SpanLinkSlice) RemoveIf(f func(SpanLink) bool)
- func (es SpanLinkSlice) Sort(less func(a, b SpanLink) bool) SpanLinkSlice
- type SpanSlice
- func (es SpanSlice) AppendEmpty() Span
- func (es SpanSlice) At(ix int) Span
- func (es SpanSlice) CopyTo(dest SpanSlice)
- func (es SpanSlice) EnsureCapacity(newCap int)
- func (es SpanSlice) Len() int
- func (es SpanSlice) MoveAndAppendTo(dest SpanSlice)
- func (es SpanSlice) RemoveIf(f func(Span) bool)
- func (es SpanSlice) Sort(less func(a, b Span) bool) SpanSlice
- type SpanStatus
- type StatusCode
- type Sum
- func (ms Sum) AggregationTemporality() MetricAggregationTemporality
- func (ms Sum) CopyTo(dest Sum)
- func (ms Sum) DataPoints() NumberDataPointSlice
- func (ms Sum) IsMonotonic() bool
- func (ms Sum) MoveTo(dest Sum)
- func (ms Sum) SetAggregationTemporality(v MetricAggregationTemporality)
- func (ms Sum) SetIsMonotonic(v bool)
- type Summary
- type SummaryDataPoint
- func (ms SummaryDataPoint) Attributes() Map
- func (ms SummaryDataPoint) CopyTo(dest SummaryDataPoint)
- func (ms SummaryDataPoint) Count() uint64
- func (ms SummaryDataPoint) Flags() MetricDataPointFlags
- func (ms SummaryDataPoint) MoveTo(dest SummaryDataPoint)
- func (ms SummaryDataPoint) QuantileValues() ValueAtQuantileSlice
- func (ms SummaryDataPoint) SetCount(v uint64)
- func (ms SummaryDataPoint) SetFlags(v MetricDataPointFlags)
- func (ms SummaryDataPoint) SetStartTimestamp(v Timestamp)
- func (ms SummaryDataPoint) SetSum(v float64)
- func (ms SummaryDataPoint) SetTimestamp(v Timestamp)
- func (ms SummaryDataPoint) StartTimestamp() Timestamp
- func (ms SummaryDataPoint) Sum() float64
- func (ms SummaryDataPoint) Timestamp() Timestamp
- type SummaryDataPointSlice
- func (es SummaryDataPointSlice) AppendEmpty() SummaryDataPoint
- func (es SummaryDataPointSlice) At(ix int) SummaryDataPoint
- func (es SummaryDataPointSlice) CopyTo(dest SummaryDataPointSlice)
- func (es SummaryDataPointSlice) EnsureCapacity(newCap int)
- func (es SummaryDataPointSlice) Len() int
- func (es SummaryDataPointSlice) MoveAndAppendTo(dest SummaryDataPointSlice)
- func (es SummaryDataPointSlice) RemoveIf(f func(SummaryDataPoint) bool)
- func (es SummaryDataPointSlice) Sort(less func(a, b SummaryDataPoint) bool) SummaryDataPointSlice
- type Timestamp
- type TraceID
- type TraceState
- type Traces
- type Value
- func (v Value) AsString() string
- func (v Value) BoolVal() bool
- func (v Value) CopyTo(dest Value)
- func (v Value) DoubleVal() float64
- func (v Value) Equal(av Value) bool
- func (v Value) IntVal() int64
- func (v Value) MBytesVal() []byte
- func (v Value) MapVal() Map
- func (v Value) SetBoolVal(bv bool)
- func (v Value) SetDoubleVal(dv float64)
- func (v Value) SetIntVal(iv int64)
- func (v Value) SetMBytesVal(bv []byte)
- func (v Value) SetStringVal(sv string)
- func (v Value) SliceVal() Slice
- func (v Value) StringVal() string
- func (v Value) Type() ValueType
- type ValueAtQuantile
- type ValueAtQuantileSlice
- func (es ValueAtQuantileSlice) AppendEmpty() ValueAtQuantile
- func (es ValueAtQuantileSlice) At(ix int) ValueAtQuantile
- func (es ValueAtQuantileSlice) CopyTo(dest ValueAtQuantileSlice)
- func (es ValueAtQuantileSlice) EnsureCapacity(newCap int)
- func (es ValueAtQuantileSlice) Len() int
- func (es ValueAtQuantileSlice) MoveAndAppendTo(dest ValueAtQuantileSlice)
- func (es ValueAtQuantileSlice) RemoveIf(f func(ValueAtQuantile) bool)
- func (es ValueAtQuantileSlice) Sort(less func(a, b ValueAtQuantile) bool) ValueAtQuantileSlice
- type ValueType
Constants ¶
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) )
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) )
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) )
const ( StatusCodeUnset = StatusCode(otlptrace.Status_STATUS_CODE_UNSET) StatusCodeOk = StatusCode(otlptrace.Status_STATUS_CODE_OK) StatusCodeError = StatusCode(otlptrace.Status_STATUS_CODE_ERROR) )
const ( // MetricDataPointFlagNoRecordedValue is flag for a metric aggregator which reports changes since last report time. MetricDataPointFlagNoRecordedValue = MetricDataPointFlag(otlpmetrics.DataPointFlags_FLAG_NO_RECORDED_VALUE) )
const ( // MetricDataPointFlagsNone is the default MetricDataPointFlags. MetricDataPointFlagsNone = MetricDataPointFlags(otlpmetrics.DataPointFlags_FLAG_NONE) )
Variables ¶
This section is empty.
Functions ¶
func LogsToOtlp ¶
func LogsToOtlp(mw Logs) *otlpcollectorlog.ExportLogsServiceRequest
LogsToOtlp internal helper to convert Logs to otlp request representation.
func LogsToProto ¶ added in v0.50.0
LogsToProto internal helper to convert Logs to protobuf representation.
func MetricsToOtlp ¶
func MetricsToOtlp(mw Metrics) *otlpcollectormetrics.ExportMetricsServiceRequest
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 ¶
func TracesToOtlp(mw Traces) *otlpcollectortrace.ExportTraceServiceRequest
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) MBucketCounts ¶ added in v0.51.0
MBucketCounts returns the mbucketcounts associated with this Buckets.
func (Buckets) MoveTo ¶
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (Buckets) SetMBucketCounts ¶ added in v0.51.0
SetMBucketCounts replaces the mbucketcounts 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) FilteredAttributes ¶
FilteredAttributes returns the FilteredAttributes associated with this Exemplar.
func (Exemplar) MoveTo ¶
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (Exemplar) SetDoubleVal ¶
SetDoubleVal replaces the doubleval associated with this Exemplar.
func (Exemplar) SetTimestamp ¶
SetTimestamp replaces the timestamp associated with this Exemplar.
func (Exemplar) SetTraceID ¶
SetTraceID replaces 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 ¶
func (ms ExponentialHistogram) CopyTo(dest ExponentialHistogram)
CopyTo copies all properties from the current struct to the dest.
func (ExponentialHistogram) DataPoints ¶
func (ms ExponentialHistogram) DataPoints() ExponentialHistogramDataPointSlice
DataPoints returns the DataPoints associated with this ExponentialHistogram.
func (ExponentialHistogram) MoveTo ¶
func (ms ExponentialHistogram) MoveTo(dest ExponentialHistogram)
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 ¶
func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoint)
CopyTo copies all properties from the current struct to the dest.
func (ExponentialHistogramDataPoint) Count ¶
func (ms ExponentialHistogramDataPoint) Count() uint64
Count returns the count associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Exemplars ¶
func (ms ExponentialHistogramDataPoint) Exemplars() ExemplarSlice
Exemplars returns the Exemplars associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Flags ¶
func (ms ExponentialHistogramDataPoint) Flags() MetricDataPointFlags
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
func (ms ExponentialHistogramDataPoint) Max() float64
Max returns the max associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Min ¶ added in v0.52.0
func (ms ExponentialHistogramDataPoint) Min() float64
Min returns the min associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) MoveTo ¶
func (ms ExponentialHistogramDataPoint) MoveTo(dest ExponentialHistogramDataPoint)
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 ¶
func (ms ExponentialHistogramDataPoint) Scale() int32
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 ¶
func (ms ExponentialHistogramDataPoint) SetFlags(v MetricDataPointFlags)
SetFlags replaces the flags associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetMax ¶ added in v0.52.0
func (ms ExponentialHistogramDataPoint) SetMax(v float64)
SetMax replaces the max associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) SetMin ¶ added in v0.52.0
func (ms ExponentialHistogramDataPoint) SetMin(v float64)
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 ¶
func (ms ExponentialHistogramDataPoint) SetSum(v float64)
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 ¶
func (ms ExponentialHistogramDataPoint) Sum() float64
Sum returns the sum associated with this ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPoint) Timestamp ¶
func (ms ExponentialHistogramDataPoint) Timestamp() 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 ¶
func (es ExponentialHistogramDataPointSlice) AppendEmpty() ExponentialHistogramDataPoint
AppendEmpty will append to the end of the slice an empty ExponentialHistogramDataPoint. It returns the newly added ExponentialHistogramDataPoint.
func (ExponentialHistogramDataPointSlice) At ¶
func (es ExponentialHistogramDataPointSlice) At(ix int) ExponentialHistogramDataPoint
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 ¶
func (es ExponentialHistogramDataPointSlice) CopyTo(dest ExponentialHistogramDataPointSlice)
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 ¶
func (es ExponentialHistogramDataPointSlice) Len() int
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewExponentialHistogramDataPointSlice()".
func (ExponentialHistogramDataPointSlice) MoveAndAppendTo ¶
func (es ExponentialHistogramDataPointSlice) MoveAndAppendTo(dest ExponentialHistogramDataPointSlice)
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (ExponentialHistogramDataPointSlice) RemoveIf ¶
func (es ExponentialHistogramDataPointSlice) RemoveIf(f func(ExponentialHistogramDataPoint) bool)
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 ¶
func (es ExponentialHistogramDataPointSlice) Sort(less func(a, b ExponentialHistogramDataPoint) bool) ExponentialHistogramDataPointSlice
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) DataPoints ¶
func (ms Gauge) DataPoints() NumberDataPointSlice
DataPoints returns the DataPoints associated with this Gauge.
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) DataPoints ¶
func (ms Histogram) DataPoints() HistogramDataPointSlice
DataPoints returns the DataPoints associated with this Histogram.
func (Histogram) MoveTo ¶
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 ¶
func (ms HistogramDataPoint) Flags() MetricDataPointFlags
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 ¶
func (ms HistogramDataPoint) SetFlags(v MetricDataPointFlags)
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 ¶
func (es HistogramDataPointSlice) AppendEmpty() HistogramDataPoint
AppendEmpty will append to the end of the slice an empty HistogramDataPoint. It returns the newly added HistogramDataPoint.
func (HistogramDataPointSlice) At ¶
func (es HistogramDataPointSlice) At(ix int) HistogramDataPoint
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 ¶
func (es HistogramDataPointSlice) CopyTo(dest HistogramDataPointSlice)
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 ¶
func (es HistogramDataPointSlice) Sort(less func(a, b HistogramDataPoint) bool) HistogramDataPointSlice
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 ¶
func (ms InstrumentationScope) CopyTo(dest InstrumentationScope)
CopyTo copies all properties from the current struct to the dest.
func (InstrumentationScope) MoveTo ¶
func (ms InstrumentationScope) MoveTo(dest InstrumentationScope)
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 ¶
Attributes returns the Attributes associated with this LogRecord.
func (LogRecord) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this LogRecord.
func (LogRecord) MoveTo ¶
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (LogRecord) ObservedTimestamp ¶
ObservedTimestamp returns the observedtimestamp associated with this LogRecord.
func (LogRecord) SetDroppedAttributesCount ¶
SetDroppedAttributesCount replaces the droppedattributescount associated with this LogRecord.
func (LogRecord) SetObservedTimestamp ¶
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 ¶
SetSeverityText replaces the severitytext associated with this LogRecord.
func (LogRecord) SetTimestamp ¶
SetTimestamp replaces the timestamp associated with this LogRecord.
func (LogRecord) SetTraceID ¶
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 ¶
SeverityText returns the severitytext 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 ¶
func LogsFromOtlp(orig *otlpcollectorlog.ExportLogsServiceRequest) Logs
LogsFromOtlp internal helper to convert otlp request representation to Logs.
func LogsFromProto ¶ added in v0.50.0
LogsFromProto internal helper to convert protobuf representation to Logs.
func (Logs) LogRecordCount ¶
LogRecordCount calculates the total number of log records.
func (Logs) MoveTo ¶
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 NewMapFromRaw ¶
NewMapFromRaw creates a Map with values from the given map[string]interface{}.
func (Map) EnsureCapacity ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
Remove removes the entry associated with the key and returns true if the key was present in the map, otherwise returns false.
func (Map) Sort ¶
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 ¶
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 ¶
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 ¶
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 ¶
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
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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
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 ¶
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) 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 ¶
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 ¶
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 ¶
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 ¶
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
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 ¶
SetDescription replaces the description associated with this Metric.
func (Metric) 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 ¶
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.
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 ¶
func (at MetricAggregationTemporality) String() 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 ¶
func (d MetricDataPointFlags) HasFlag(flag MetricDataPointFlag) bool
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 ¶
func MetricsFromOtlp(orig *otlpcollectormetrics.ExportMetricsServiceRequest) Metrics
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 (Metrics) DataPointCount ¶
DataPointCount calculates the total number of data points.
func (Metrics) MetricCount ¶
MetricCount calculates the total number of metrics.
func (Metrics) MoveTo ¶
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 ¶
func (ms NumberDataPoint) Flags() MetricDataPointFlags
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 ¶
func (ms NumberDataPoint) ValueType() NumberDataPointValueType
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 ¶
func (es NumberDataPointSlice) At(ix int) NumberDataPoint
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 ¶
func (es NumberDataPointSlice) CopyTo(dest NumberDataPointSlice)
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 ¶
func (es NumberDataPointSlice) Sort(less func(a, b NumberDataPoint) bool) NumberDataPointSlice
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 ¶
Attributes returns the Attributes associated with this Resource.
func (Resource) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this Resource.
func (Resource) MoveTo ¶
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (Resource) SetDroppedAttributesCount ¶
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 ¶
func (es ResourceLogsSlice) At(ix int) ResourceLogs
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 ¶
func (es ResourceMetricsSlice) At(ix int) ResourceMetrics
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 ¶
func (es ResourceMetricsSlice) CopyTo(dest ResourceMetricsSlice)
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 ¶
func (es ResourceMetricsSlice) Sort(less func(a, b ResourceMetrics) bool) ResourceMetricsSlice
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 ¶
func (es ResourceSpansSlice) At(ix int) ResourceSpans
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) LogRecords ¶
func (ms ScopeLogs) LogRecords() LogRecordSlice
LogRecords returns the LogRecords associated with this ScopeLogs.
func (ScopeLogs) MoveTo ¶
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (ScopeLogs) Scope ¶
func (ms ScopeLogs) Scope() InstrumentationScope
Scope returns the scope associated with this ScopeLogs.
func (ScopeLogs) SetSchemaUrl ¶
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 ¶
func (ms ScopeMetrics) Scope() InstrumentationScope
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 ¶
func (es ScopeMetricsSlice) At(ix int) ScopeMetrics
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 ¶
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 ¶
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) EnsureCapacity ¶
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 ¶
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewSlice()".
func (Slice) MoveAndAppendTo ¶
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
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 ¶
Attributes returns the Attributes associated with this Span.
func (Span) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this Span.
func (Span) DroppedEventsCount ¶
DroppedEventsCount returns the droppedeventscount associated with this Span.
func (Span) DroppedLinksCount ¶
DroppedLinksCount returns the droppedlinkscount associated with this Span.
func (Span) EndTimestamp ¶
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) Links ¶
func (ms Span) Links() SpanLinkSlice
Links returns the Links associated with this Span.
func (Span) MoveTo ¶
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (Span) ParentSpanID ¶
ParentSpanID returns the parentspanid associated with this Span.
func (Span) SetDroppedAttributesCount ¶
SetDroppedAttributesCount replaces the droppedattributescount associated with this Span.
func (Span) SetDroppedEventsCount ¶
SetDroppedEventsCount replaces the droppedeventscount associated with this Span.
func (Span) SetDroppedLinksCount ¶
SetDroppedLinksCount replaces the droppedlinkscount associated with this Span.
func (Span) SetEndTimestamp ¶
SetEndTimestamp replaces the endtimestamp associated with this Span.
func (Span) SetParentSpanID ¶
SetParentSpanID replaces the parentspanid associated with this Span.
func (Span) SetStartTimestamp ¶
SetStartTimestamp replaces the starttimestamp associated with this Span.
func (Span) SetTraceID ¶
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) StartTimestamp ¶
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) 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 ¶
Attributes returns the Attributes associated with this SpanEvent.
func (SpanEvent) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this SpanEvent.
func (SpanEvent) MoveTo ¶
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (SpanEvent) SetDroppedAttributesCount ¶
SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanEvent.
func (SpanEvent) SetTimestamp ¶
SetTimestamp replaces 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.
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.
type SpanLink ¶
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 ¶
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 ¶
Attributes returns the Attributes associated with this SpanLink.
func (SpanLink) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this SpanLink.
func (SpanLink) MoveTo ¶
MoveTo moves all properties from the current struct to dest resetting the current instance to its zero value
func (SpanLink) SetDroppedAttributesCount ¶
SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanLink.
func (SpanLink) SetTraceID ¶
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) 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 ¶
AppendEmpty will append to the end of the slice an empty Span. It returns the newly added Span.
func (SpanSlice) 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 (SpanSlice) EnsureCapacity ¶
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 ¶
Len returns the number of elements in the slice.
Returns "0" for a newly instance created with "NewSpanSlice()".
func (SpanSlice) MoveAndAppendTo ¶
MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.
func (SpanSlice) RemoveIf ¶
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 ¶
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) DataPoints ¶
func (ms Sum) DataPoints() NumberDataPointSlice
DataPoints returns the DataPoints associated with this Sum.
func (Sum) IsMonotonic ¶
IsMonotonic returns the ismonotonic associated with this Sum.
func (Sum) MoveTo ¶
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 ¶
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) DataPoints ¶
func (ms Summary) DataPoints() SummaryDataPointSlice
DataPoints returns the DataPoints associated with this Summary.
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 ¶
func (ms SummaryDataPoint) Flags() MetricDataPointFlags
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 ¶
func (es SummaryDataPointSlice) At(ix int) SummaryDataPoint
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 ¶
func (es SummaryDataPointSlice) CopyTo(dest SummaryDataPointSlice)
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 ¶
func (es SummaryDataPointSlice) Sort(less func(a, b SummaryDataPoint) bool) SummaryDataPointSlice
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 ¶
NewTimestampFromTime constructs a new Timestamp from the provided time.Time.
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 ¶
NewTraceID returns a new TraceID from the given byte array.
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 TracesFromOtlp ¶
func TracesFromOtlp(orig *otlpcollectortrace.ExportTraceServiceRequest) Traces
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) MoveTo ¶
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.
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 ¶
NewValueBool creates a new Value with the given bool value.
func NewValueDouble ¶
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 ¶
NewValueInt creates a new Value with the given int64 value.
func NewValueMBytes ¶ added in v0.52.0
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 NewValueString ¶
NewValueString creates a new Value with the given string value.
func (Value) AsString ¶
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 ¶
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) DoubleVal ¶
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 ¶
Equal checks for equality, it returns true if the objects are equal otherwise false.
func (Value) IntVal ¶
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
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 ¶
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 ¶
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 ¶
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 ¶
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
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 ¶
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 ¶
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.
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 ¶
func (es ValueAtQuantileSlice) At(ix int) ValueAtQuantile
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 ¶
func (es ValueAtQuantileSlice) CopyTo(dest ValueAtQuantileSlice)
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 ¶
func (es ValueAtQuantileSlice) Sort(less func(a, b ValueAtQuantile) bool) ValueAtQuantileSlice
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))