ottlresource

package
v0.76.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 8

README

Resource Context

The Resource Context is a Context implementation for pdata Resources, the Collector's internal representation for an OTLP Resource. This Context should be used when interacting only with OTLP resources.

Paths

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

The following paths are supported.

path field accessed type
cache the value of the current transform context's temporary cache. cache can be used as a temporary placeholder for data during complex transformations pcommon.Map
cache[""] the value of an item in cache string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil
attributes attributes of the resource being processed pcommon.Map
attributes[""] the value of the attribute of the resource being processed string, bool, int64, float64, pcommon.Map, pcommon.Slice, []byte or nil
dropped_attributes_count number of dropped attributes of the resource being processed int64

Enums

The Resource Context does not define any Enums at this time.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

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

func NewStatements added in v0.72.0

func NewStatements(statements []*ottl.Statement[TransformContext], telemetrySettings component.TelemetrySettings, options ...StatementsOption) ottl.Statements[TransformContext]

Types

type Option added in v0.70.0

type Option func(*ottl.Parser[TransformContext])

type StatementsOption added in v0.72.0

type StatementsOption func(*ottl.Statements[TransformContext])

func WithErrorMode added in v0.72.0

func WithErrorMode(errorMode ottl.ErrorMode) StatementsOption

type TransformContext

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

func NewTransformContext

func NewTransformContext(resource pcommon.Resource) TransformContext

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