Documentation ¶
Index ¶
- Constants
- Variables
- type ByteArray
- func (b ByteArray) Clone() PipelineEvent
- func (ByteArray) GetName() string
- func (ByteArray) GetObservedTimestamp() uint64
- func (b ByteArray) GetSize() int64
- func (ByteArray) GetTags() Tags
- func (ByteArray) GetTimestamp() uint64
- func (ByteArray) GetType() EventType
- func (ByteArray) SetName(name string)
- func (ByteArray) SetObservedTimestamp(timestamp uint64)
- type EmptyMetricValue
- type EventType
- type GroupInfo
- type KeyValue
- type KeyValueSlice
- type KeyValues
- type Log
- func (m *Log) Clone() PipelineEvent
- func (m *Log) GetBody() []byte
- func (m *Log) GetIndices() LogContents
- func (m *Log) GetLevel() string
- func (m *Log) GetName() string
- func (m *Log) GetObservedTimestamp() uint64
- func (m *Log) GetOffset() uint64
- func (m *Log) GetRawSize() uint64
- func (m *Log) GetSize() int64
- func (m *Log) GetSpanID() string
- func (m *Log) GetTags() Tags
- func (m *Log) GetTimestamp() uint64
- func (m *Log) GetTraceID() string
- func (m *Log) GetType() EventType
- func (m *Log) SetBody(body []byte)
- func (m *Log) SetIndices(indices LogContents)
- func (m *Log) SetLevel(level string)
- func (m *Log) SetName(name string)
- func (m *Log) SetObservedTimestamp(observedTimestamp uint64)
- func (m *Log) SetOffset(offset uint64)
- func (m *Log) SetRawSize(rawSize uint64)
- func (m *Log) SetSpanID(spanID string)
- func (m *Log) SetTraceID(traceID string)
- type LogContents
- type Metadata
- type Metric
- func NewMetric(name string, metricType MetricType, tags Tags, timestamp int64, ...) *Metric
- func NewMultiValuesMetric(name string, metricType MetricType, tags Tags, timestamp int64, ...) *Metric
- func NewSingleValueMetric[T constraints.IntUintFloat](name string, metricType MetricType, tags Tags, timestamp int64, value T) *Metric
- func (m *Metric) Clone() PipelineEvent
- func (m *Metric) GetDescription() string
- func (m *Metric) GetMetricType() MetricType
- func (m *Metric) GetName() string
- func (m *Metric) GetObservedTimestamp() uint64
- func (m *Metric) GetSize() int64
- func (m *Metric) GetTags() Tags
- func (m *Metric) GetTimestamp() uint64
- func (m *Metric) GetType() EventType
- func (m *Metric) GetTypedValue() MetricTypedValues
- func (m *Metric) GetUnit() string
- func (m *Metric) GetValue() MetricValue
- func (m *Metric) SetName(name string)
- func (m *Metric) SetObservedTimestamp(timestamp uint64)
- func (m *Metric) String() string
- type MetricFloatValues
- type MetricMultiValue
- type MetricSingleValue
- type MetricType
- type MetricTypedValues
- type MetricValue
- type PipelineEvent
- type PipelineGroupEvents
- type Span
- func (m *Span) Clone() PipelineEvent
- func (m *Span) GetEndTime() uint64
- func (m *Span) GetEvents() []*SpanEvent
- func (m *Span) GetKind() SpanKind
- func (m *Span) GetLinks() []*SpanLink
- func (m *Span) GetName() string
- func (m *Span) GetObservedTimestamp() uint64
- func (m *Span) GetParentSpanID() string
- func (m *Span) GetSize() int64
- func (m *Span) GetSpanID() string
- func (m *Span) GetStartTime() uint64
- func (m *Span) GetStatus() StatusCode
- func (m *Span) GetTags() Tags
- func (m *Span) GetTimestamp() uint64
- func (m *Span) GetTraceID() string
- func (m *Span) GetTraceState() string
- func (m *Span) GetType() EventType
- func (m *Span) SetName(name string)
- func (m *Span) SetObservedTimestamp(timestamp uint64)
- type SpanEvent
- type SpanKind
- type SpanKindText
- type SpanLink
- type StatusCode
- type Tags
- type TypedValue
- type ValueType
Constants ¶
const ( SpanKindTextInternal = "internal" SpanKindTextServer = "server" SpanKindTextClient = "client" SpanKindTextProducer = "producer" SpanKindTextConsumer = "consumer" )
Variables ¶
var ( NilStringValues = &keyValuesNil[string]{} NilTypedValues = &keyValuesNil[*TypedValue]{} NilFloatValues = &keyValuesNil[float64]{} NilInterfaceValues = &keyValuesNil[interface{}]{} )
var ( MetricTypeTexts = map[MetricType]string{ MetricTypeCounter: "Counter", MetricTypeGauge: "Gauge", MetricTypeHistogram: "Histogram", MetricTypeSummary: "Summary", MetricTypeUntyped: "Untyped", MetricTypeMeter: "Meter", MetricTypeRateCounter: "RateCounter", } MetricTypeValues = map[string]MetricType{ "Counter": MetricTypeCounter, "Gauge": MetricTypeGauge, "Histogram": MetricTypeHistogram, "Summary": MetricTypeSummary, "Untyped": MetricTypeUntyped, "Meter": MetricTypeMeter, "RateCounter": MetricTypeRateCounter, } )
var ( SpanKindTexts = map[SpanKind]SpanKindText{ SpanKindInternal: SpanKindTextInternal, SpanKindServer: SpanKindTextServer, SpanKindClient: SpanKindTextClient, SpanKindProducer: SpanKindTextProducer, SpanKindConsumer: SpanKindTextConsumer, } SpanKindValues = map[SpanKindText]SpanKind{ SpanKindTextInternal: SpanKindInternal, SpanKindTextServer: SpanKindServer, SpanKindTextClient: SpanKindClient, SpanKindTextProducer: SpanKindProducer, SpanKindTextConsumer: SpanKindConsumer, } )
Functions ¶
This section is empty.
Types ¶
type ByteArray ¶
type ByteArray []byte
Defines a ByteArray event. For example, the agent is deployed as a proxy to directly transparently transmit the received binary data to the backend, using ByteArray can avoid additional Marshal/Unmarshal overhead.
func NewByteArray ¶
func (ByteArray) Clone ¶
func (b ByteArray) Clone() PipelineEvent
func (ByteArray) GetObservedTimestamp ¶
func (ByteArray) GetTimestamp ¶
func (ByteArray) SetObservedTimestamp ¶
type EmptyMetricValue ¶
type EmptyMetricValue struct { }
func (*EmptyMetricValue) GetMultiValues ¶
func (v *EmptyMetricValue) GetMultiValues() MetricFloatValues
func (*EmptyMetricValue) GetSingleValue ¶
func (v *EmptyMetricValue) GetSingleValue() float64
func (*EmptyMetricValue) IsMultiValues ¶
func (v *EmptyMetricValue) IsMultiValues() bool
func (*EmptyMetricValue) IsSingleValue ¶
func (v *EmptyMetricValue) IsSingleValue() bool
type EventType ¶
type EventType int
const ( EventTypeMetric EventType EventTypeSpan EventTypeLogging EventTypeByteArray )
type GroupInfo ¶
func (*GroupInfo) GetMetadata ¶
type KeyValue ¶
type KeyValue[TValue string | float64 | *TypedValue | any] struct { Key string Value TValue }
type KeyValueSlice ¶
type KeyValueSlice[TValue string | float64 | *TypedValue | any] []KeyValue[TValue]
func (KeyValueSlice[TValue]) Len ¶
func (x KeyValueSlice[TValue]) Len() int
func (KeyValueSlice[TValue]) Less ¶
func (x KeyValueSlice[TValue]) Less(i, j int) bool
func (KeyValueSlice[TValue]) Swap ¶
func (x KeyValueSlice[TValue]) Swap(i, j int)
type KeyValues ¶
type KeyValues[TValue string | float64 | *TypedValue | any] interface { Add(key string, value TValue) AddAll(items map[string]TValue) Get(key string) TValue Contains(key string) bool Delete(key string) Merge(other KeyValues[TValue]) Iterator() map[string]TValue SortTo(buf []KeyValue[TValue]) []KeyValue[TValue] Len() int IsNil() bool }
func NewKeyValues ¶
func NewKeyValues[TValue string | float64 | *TypedValue | any]() KeyValues[TValue]
type Log ¶
type Log struct { Name string Level string SpanID string TraceID string Tags Tags Timestamp uint64 ObservedTimestamp uint64 Offset uint64 RawSize uint64 Contents LogContents }
func NewSimpleLevelLog ¶
func (*Log) Clone ¶
func (m *Log) Clone() PipelineEvent
func (*Log) GetIndices ¶
func (m *Log) GetIndices() LogContents
func (*Log) GetObservedTimestamp ¶
func (*Log) GetRawSize ¶
func (*Log) GetTimestamp ¶
func (*Log) GetTraceID ¶
func (*Log) SetIndices ¶
func (m *Log) SetIndices(indices LogContents)
func (*Log) SetObservedTimestamp ¶
func (*Log) SetRawSize ¶
func (*Log) SetTraceID ¶
type LogContents ¶
type LogContents KeyValues[interface{}]
func NewLogContents ¶
func NewLogContents() LogContents
type Metadata ¶
func NewMetadata ¶
func NewMetadata() Metadata
func NewMetadataWithMap ¶
type Metric ¶
type Metric struct { Name string Unit string Description string Timestamp uint64 ObservedTimestamp uint64 Tags Tags MetricType MetricType Value MetricValue TypedValue MetricTypedValues }
Defines a Metric which has one or more timeseries. The following is a brief summary of the Metric data model. For more details, see: https://github.com/alibaba/ilogtail/discussions/518 - Metric is composed of a metadata and data. - Metadata part contains a name, description, unit, tags - Data is one of the possible types (Counter, Gauge, Histogram, Summary).
func NewMetric ¶
func NewMetric(name string, metricType MetricType, tags Tags, timestamp int64, value MetricValue, typedValues MetricTypedValues) *Metric
func NewMultiValuesMetric ¶
func NewMultiValuesMetric(name string, metricType MetricType, tags Tags, timestamp int64, values MetricFloatValues) *Metric
func NewSingleValueMetric ¶
func NewSingleValueMetric[T constraints.IntUintFloat](name string, metricType MetricType, tags Tags, timestamp int64, value T) *Metric
func (*Metric) Clone ¶
func (m *Metric) Clone() PipelineEvent
func (*Metric) GetDescription ¶
func (*Metric) GetMetricType ¶
func (m *Metric) GetMetricType() MetricType
func (*Metric) GetObservedTimestamp ¶
func (*Metric) GetTimestamp ¶
func (*Metric) GetTypedValue ¶
func (m *Metric) GetTypedValue() MetricTypedValues
func (*Metric) GetValue ¶
func (m *Metric) GetValue() MetricValue
func (*Metric) SetObservedTimestamp ¶
type MetricFloatValues ¶
type MetricMultiValue ¶
type MetricMultiValue struct {
Values MetricFloatValues
}
func NewMetricMultiValue ¶
func NewMetricMultiValue() *MetricMultiValue
func NewMetricMultiValueWithMap ¶
func NewMetricMultiValueWithMap(keyValues map[string]float64) *MetricMultiValue
func (*MetricMultiValue) Add ¶
func (v *MetricMultiValue) Add(key string, value float64)
func (*MetricMultiValue) GetMultiValues ¶
func (v *MetricMultiValue) GetMultiValues() MetricFloatValues
func (*MetricMultiValue) GetSingleValue ¶
func (v *MetricMultiValue) GetSingleValue() float64
func (*MetricMultiValue) IsMultiValues ¶
func (v *MetricMultiValue) IsMultiValues() bool
func (*MetricMultiValue) IsSingleValue ¶
func (v *MetricMultiValue) IsSingleValue() bool
type MetricSingleValue ¶
type MetricSingleValue struct {
Value float64
}
func (*MetricSingleValue) GetMultiValues ¶
func (v *MetricSingleValue) GetMultiValues() MetricFloatValues
func (*MetricSingleValue) GetSingleValue ¶
func (v *MetricSingleValue) GetSingleValue() float64
func (*MetricSingleValue) IsMultiValues ¶
func (v *MetricSingleValue) IsMultiValues() bool
func (*MetricSingleValue) IsSingleValue ¶
func (v *MetricSingleValue) IsSingleValue() bool
type MetricType ¶
type MetricType int
const ( MetricTypeUntyped MetricType MetricTypeCounter MetricTypeGauge MetricTypeHistogram MetricTypeSummary // Extended metrics types MetricTypeMeter // In bytetsd, meter is an extension of the counter type, which contains a counter value and a rate value within a period MetricTypeRateCounter // In bytetsd, ratecounter is an extension of the counter type, which contains a rate value within a period )
type MetricTypedValues ¶
type MetricTypedValues interface { KeyValues[*TypedValue] }
MetricTypedValues In TSDB such as influxdb, its fields not only have numeric types, also string, bool, and array types. MetricTypedValues is used to define types other than numeric values.
func NewMetricTypedValueWithMap ¶
func NewMetricTypedValueWithMap(keyValues map[string]*TypedValue) MetricTypedValues
func NewMetricTypedValues ¶
func NewMetricTypedValues() MetricTypedValues
type MetricValue ¶
type MetricValue interface { IsSingleValue() bool IsMultiValues() bool GetSingleValue() float64 GetMultiValues() MetricFloatValues }
type PipelineEvent ¶
type PipelineGroupEvents ¶
type PipelineGroupEvents struct { Group *GroupInfo Events []PipelineEvent }
type Span ¶
type Span struct { TraceID string SpanID string ParentSpanID string Name string TraceState string StartTime uint64 EndTime uint64 ObservedTimestamp uint64 Kind SpanKind Status StatusCode Tags Tags Links []*SpanLink Events []*SpanEvent }
A Span represents a single operation performed by a single component of the system.
func (*Span) Clone ¶
func (m *Span) Clone() PipelineEvent
func (*Span) GetEndTime ¶
func (*Span) GetObservedTimestamp ¶
func (*Span) GetParentSpanID ¶
func (*Span) GetStartTime ¶
func (*Span) GetStatus ¶
func (m *Span) GetStatus() StatusCode
func (*Span) GetTimestamp ¶
func (*Span) GetTraceID ¶
func (*Span) GetTraceState ¶
func (*Span) SetObservedTimestamp ¶
type SpanKind ¶
type SpanKind int
const ( // Indicates that the span represents an internal operation within an application, // as opposed to an operation happening at the boundaries. Default value. SpanKindInternal SpanKind // Indicates that the span covers server-side handling of an RPC or other // remote network request. SpanKindServer // Indicates that the span describes a request to some remote service. SpanKindClient // 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 // 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 )
type SpanKindText ¶
type SpanKindText string
type StatusCode ¶
type StatusCode int
const ( StatusCodeUnSet StatusCode = iota StatusCodeOK StatusCodeError )
type TypedValue ¶
type TypedValue struct { Type ValueType Value interface{} }
type ValueType ¶
type ValueType int
const ( ValueTypeString ValueType ValueTypeBoolean ValueTypeArray ValueTypeMap ContentKey = "content" BodyKey = ContentKey )