Documentation ¶
Overview ¶
nolint:errcheck
Index ¶
- type Document
- func (doc *Document) Add(key string, v Value)
- func (doc *Document) AddAttribute(key string, attribute pcommon.Value)
- func (doc *Document) AddAttributes(key string, attributes pcommon.Map)
- func (doc *Document) AddInt(key string, value int64)
- func (doc *Document) AddSpanID(key string, id pcommon.SpanID)
- func (doc *Document) AddString(key string, v string)
- func (doc *Document) AddTimestamp(key string, ts pcommon.Timestamp)
- func (doc *Document) AddTraceID(key string, id pcommon.TraceID)
- func (doc *Document) Dedup()
- func (doc *Document) Serialize(w io.Writer, dedot bool) error
- func (doc *Document) Sort()
- type Kind
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is an intermediate representation for converting open telemetry records with arbitrary attributes into a JSON document that can be processed by OpenSearch.
func DocumentFromAttributes ¶
DocumentFromAttributes creates a document from a OpenTelemetry attribute map. All nested maps will be flattened, with keys being joined using a `.` symbol.
func DocumentFromAttributesWithPath ¶
DocumentFromAttributesWithPath creates a document from a OpenTelemetry attribute map. All nested maps will be flattened, with keys being joined using a `.` symbol.
All keys in the map will be prefixed with path.
func (*Document) AddAttribute ¶
AddAttribute converts and adds a AttributeValue to the document. If the attribute represents a map, the fields will be flattened.
func (*Document) AddAttributes ¶
AddAttributes expands and flattens all key-value pairs from the input attribute map into the document.
func (*Document) AddSpanID ¶
AddSpanID adds the hex presentation of a SpanID to the document. If the SpanID is empty, no value will be added.
func (*Document) AddTimestamp ¶
AddTimestamp adds a raw timestamp value to the Document.
func (*Document) AddTraceID ¶
AddTraceID adds the hex presentation of a TraceID value to the document. If the TraceID is empty, no value will be added.
func (*Document) Dedup ¶
func (doc *Document) Dedup()
Dedup removes fields from the document, that have duplicate keys. The filtering only keeps the last value for a key.
Dedup ensure that keys are sorted.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value type that can be added to a Document.
func DoubleValue ¶
DoubleValue creates a new value from a double value..
func TimestampValue ¶
TimestampValue create a new value from a time.Time.
func ValueFromAttribute ¶
ValueFromAttribute converts a AttributeValue into a value.