type PipelineGroupEvents struct {
Group *GroupInfo
Events []PipelineEvent
}
type GroupInfo struct {
Metadata Metadata
Tags Tags
}
type MetricEvent struct {
Name string
MetricType MetricType
Timestamp uint64
ObservedTimestamp uint64
Unit string
Description string
Tags Tags
Value MetricValue
TypedValue MetricTypedValues
}
type MetricValue interface {
IsSingleValue() bool
IsMultiValues() bool
GetSingleValue() float64
GetMultiValues() MetricFloatValues
}
type MetricSingleValue struct {
Value float64
}
type MetricMultiValue struct {
Values MetricFloatValues
}
if metric.Value.IsSingleValue() {
value := metric.Value.GetSingleValue()
}
if metric.Value.IsMultiValues() {
values := metric.Value.GetMultiValues()
for field, value := range values.Iterator() {
// field 为 string 类型,表示多值的字段名
// value 为 float64 类型
}
}
type TypedValue struct {
Type ValueType
Value interface{}
}
type MetricTypedValues interface {
KeyValues[*TypedValue]
}
type SpanLink struct {
TraceID string
SpanID string
TraceState string
Tags Tags
}
type SpanEvent struct {
Timestamp int64
Name string
}
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
}
type LogContents KeyValues[string]
type Log struct {
Name string
Level string
SpanID string
TraceID string
Tags Tags
Timestamp uint64
ObservedTimestamp uint64
Offset uint64
Contents LogContents
}