ottllog

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 27

README

Log Context

The Log Context is a Context implementation for pdata Logs, the collector's internal representation for OTLP log data. This Context should be used when interacted with OTLP logs.

Paths

In general, the Log Context supports accessing pdata using the field names from the logs proto. All integers are returned and set via int64. All doubles are returned and set via float64.

All TraceIDs and SpanIDs are returned as pdata SpanID and TraceID types. Use the SpanID function and TraceID function when interacting with pdata representations of SpanID and TraceID. When checking for nil, instead check against an empty byte slice (SpanID(0x0000000000000000) and TraceID(0x00000000000000000000000000000000)).

The following fields are the exception.

path field accessed type
resource resource of the log being processed pcommon.Resource
resource.attributes resource attributes of the log being processed pcommon.Map
resource.attributes[""] the value of the resource attribute of the log being processed string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil
resource.dropped_attributes_count number of dropped attributes of the resource of the log being processed int64
instrumentation_scope instrumentation scope of the log being processed pcommon.InstrumentationScope
instrumentation_scope.name name of the instrumentation scope of the log being processed string
instrumentation_scope.version version of the instrumentation scope of the log being processed string
instrumentation_scope.dropped_attributes_count number of dropped attributes of the instrumentation scope of the log being processed int64
instrumentation_scope.attributes instrumentation scope attributes of the data point being processed pcommon.Map
instrumentation_scope.attributes[""] the value of the instrumentation scope attribute of the data point being processed string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil
attributes attributes of the log being processed pcommon.Map
attributes[""] the value of the attribute of the log being processed string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil
trace_id a byte slice representation of the trace id pcommon.TraceID
trace_id.string a string representation of the trace id string
span_id a byte slice representation of the span id pcommon.SpanID
span_id.string a string representation of the span id string

Enums

The Log Context supports the enum names from the logs proto.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

func NewParser(functions map[string]interface{}, telemetrySettings component.TelemetrySettings) ottl.Parser[TransformContext]

Types

type TransformContext

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

func NewTransformContext

func NewTransformContext(logRecord plog.LogRecord, instrumentationScope pcommon.InstrumentationScope, resource pcommon.Resource) TransformContext

func (TransformContext) GetInstrumentationScope

func (tCtx TransformContext) GetInstrumentationScope() pcommon.InstrumentationScope

func (TransformContext) GetLogRecord

func (tCtx TransformContext) GetLogRecord() plog.LogRecord

func (TransformContext) GetResource

func (tCtx TransformContext) GetResource() pcommon.Resource

Jump to

Keyboard shortcuts

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