common

package
v0.119.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadContextCache added in v0.119.0

func LoadContextCache(contextCache map[ContextID]*pcommon.Map, context ContextID) *pcommon.Map

LoadContextCache retrieves or creates a context cache map for the given context ID. If the cache is not found, a new map is created and stored in the contextCache map.

func ResourceFunctions added in v0.64.0

func ResourceFunctions() map[string]ottl.Factory[ottlresource.TransformContext]

func ScopeFunctions added in v0.64.0

func ScopeFunctions() map[string]ottl.Factory[ottlscope.TransformContext]

Types

type ContextID added in v0.64.0

type ContextID string
const (
	Resource  ContextID = "resource"
	Scope     ContextID = "scope"
	Span      ContextID = "span"
	SpanEvent ContextID = "spanevent"
	Metric    ContextID = "metric"
	DataPoint ContextID = "datapoint"
	Log       ContextID = "log"
)

func (*ContextID) UnmarshalText added in v0.64.0

func (c *ContextID) UnmarshalText(text []byte) error

type ContextStatements added in v0.64.0

type ContextStatements struct {
	Context    ContextID `mapstructure:"context"`
	Conditions []string  `mapstructure:"conditions"`
	Statements []string  `mapstructure:"statements"`

	// `SharedCache` is an experimental feature that may change or be removed in the future.
	// When enabled, it allows the statements cache to be shared across all other groups that share the cache.
	// This feature is not configurable via `mapstructure` and cannot be set in configuration files.
	SharedCache bool `mapstructure:"-"`
}

func (ContextStatements) GetStatements added in v0.119.0

func (c ContextStatements) GetStatements() []string

type LogParserCollection added in v0.64.0

type LogParserCollection ottl.ParserCollection[LogsConsumer]

func NewLogParserCollection added in v0.64.0

func NewLogParserCollection(settings component.TelemetrySettings, options ...LogParserCollectionOption) (*LogParserCollection, error)

func (*LogParserCollection) ParseContextStatements added in v0.64.0

func (lpc *LogParserCollection) ParseContextStatements(contextStatements ContextStatements) (LogsConsumer, error)

type LogParserCollectionOption added in v0.64.0

type LogParserCollectionOption ottl.ParserCollectionOption[LogsConsumer]

func WithLogErrorMode added in v0.73.0

func WithLogErrorMode(errorMode ottl.ErrorMode) LogParserCollectionOption

func WithLogParser added in v0.65.0

type LogsConsumer added in v0.119.0

type LogsConsumer interface {
	Context() ContextID
	ConsumeLogs(ctx context.Context, ld plog.Logs, cache *pcommon.Map) error
}

type MetricParserCollection added in v0.64.0

type MetricParserCollection ottl.ParserCollection[MetricsConsumer]

func NewMetricParserCollection added in v0.64.0

func NewMetricParserCollection(settings component.TelemetrySettings, options ...MetricParserCollectionOption) (*MetricParserCollection, error)

func (*MetricParserCollection) ParseContextStatements added in v0.64.0

func (mpc *MetricParserCollection) ParseContextStatements(contextStatements ContextStatements) (MetricsConsumer, error)

type MetricParserCollectionOption added in v0.64.0

type MetricParserCollectionOption ottl.ParserCollectionOption[MetricsConsumer]

func WithDataPointParser added in v0.65.0

func WithMetricErrorMode added in v0.73.0

func WithMetricErrorMode(errorMode ottl.ErrorMode) MetricParserCollectionOption

func WithMetricParser added in v0.65.0

type MetricsConsumer added in v0.119.0

type MetricsConsumer interface {
	Context() ContextID
	ConsumeMetrics(ctx context.Context, md pmetric.Metrics, cache *pcommon.Map) error
}

type TraceParserCollection added in v0.64.0

type TraceParserCollection ottl.ParserCollection[TracesConsumer]

func NewTraceParserCollection added in v0.64.0

func NewTraceParserCollection(settings component.TelemetrySettings, options ...TraceParserCollectionOption) (*TraceParserCollection, error)

func (*TraceParserCollection) ParseContextStatements added in v0.64.0

func (tpc *TraceParserCollection) ParseContextStatements(contextStatements ContextStatements) (TracesConsumer, error)

type TraceParserCollectionOption added in v0.64.0

type TraceParserCollectionOption ottl.ParserCollectionOption[TracesConsumer]

func WithSpanEventParser added in v0.65.0

func WithSpanParser added in v0.65.0

func WithTraceErrorMode added in v0.73.0

func WithTraceErrorMode(errorMode ottl.ErrorMode) TraceParserCollectionOption

type TracesConsumer added in v0.119.0

type TracesConsumer interface {
	Context() ContextID
	ConsumeTraces(ctx context.Context, td ptrace.Traces, cache *pcommon.Map) error
}

Jump to

Keyboard shortcuts

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