transformer

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package transformer contains various Transformers that represent a high level operation - typically a single "change" block from the schema change file. They rely on Migrators to do the actual work of applying the change to the data. Transformers accept and operate on a specific type of pdata (logs, metrics, etc)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllAttributes

type AllAttributes struct {
	MetricAttributes    MetricAttributes
	LogAttributes       LogAttributes
	SpanAttributes      SpanAttributes
	SpanEventAttributes SpanEventAttributes
	ResourceAttributes  ResourceAttributes
}

AllAttributes is a Transformer that acts on . It is a wrapper around the other attribute transformers. It powers the [All rename_attributes] transformation. [All rename_attributes]: https://opentelemetry.io/docs/specs/otel/schemas/file_format_v1.1.0/#all-section

func NewAllAttributesTransformer

func NewAllAttributesTransformer(set migrate.AttributeChangeSet) AllAttributes

func (AllAttributes) Do

func (o AllAttributes) Do(ss migrate.StateSelector, data any) error

func (AllAttributes) IsMigrator

func (o AllAttributes) IsMigrator()

type LogAttributes

type LogAttributes struct {
	AttributeChange migrate.AttributeChangeSet
}

LogAttributes is a Transformer that acts on plog.LogRecord attributes. It powers the [Log's rename_attributes] transformation. It also powers the AllAttributes. [Log's rename_attributes]: https://opentelemetry.io/docs/specs/otel/schemas/file_format_v1.1.0/#rename_attributes-transformation-3

func (LogAttributes) Do

func (LogAttributes) IsMigrator

func (o LogAttributes) IsMigrator()

type MetricAttributes

type MetricAttributes struct {
	AttributeChange migrate.AttributeChangeSet
}

MetricAttributes is a Transformer that acts on pmetric.Metric's DataPoint's attributes. It is part of the AllAttributes.

func (MetricAttributes) Do

func (MetricAttributes) IsMigrator

func (o MetricAttributes) IsMigrator()

type MetricDataPointAttributes

type MetricDataPointAttributes struct {
	ConditionalAttributeChange migrate.ConditionalAttributeSet
}

MetricDataPointAttributes is a conditional Transformer that acts on pmetric.Metric's DataPoint's attributes. It powers the [Metric's rename_attributes] transformation. [Metric's rename_attributes]: https://opentelemetry.io/docs/specs/otel/schemas/file_format_v1.1.0/#rename_attributes-transformation-2

func (MetricDataPointAttributes) Do

func (MetricDataPointAttributes) IsMigrator

func (o MetricDataPointAttributes) IsMigrator()

type MetricSignalNameChange

type MetricSignalNameChange struct {
	SignalNameChange migrate.SignalNameChange
}

MetricSignalNameChange is an transformer that powers the [Metric's rename_metrics] change. [Metric's rename_metrics]: https://opentelemetry.io/docs/specs/otel/schemas/file_format_v1.1.0/#rename_metrics-transformation

func (MetricSignalNameChange) Do

func (MetricSignalNameChange) IsMigrator

func (c MetricSignalNameChange) IsMigrator()

type ResourceAttributes

type ResourceAttributes struct {
	AttributeChange migrate.AttributeChangeSet
}

ResourceAttributes is a Transformer that acts on pcommon.Resource attributes. It powers the [Resource's rename_attributes] transformation. It also powers the AllAttributes. [Resource's rename_attributes]: https://opentelemetry.io/docs/specs/otel/schemas/file_format_v1.1.0/#resources-section

func (ResourceAttributes) Do

func (ResourceAttributes) IsMigrator

func (o ResourceAttributes) IsMigrator()

type SpanAttributes

type SpanAttributes struct {
	AttributeChange migrate.AttributeChangeSet
}

SpanAttributes is a Transformer that acts on ptrace.Span attributes. It powers the [Span's rename_attributes] transformation. It also powers the AllAttributes. [Span's rename_attributes]: https://opentelemetry.io/docs/specs/otel/schemas/file_format_v1.1.0/#rename_attributes-transformation

func (SpanAttributes) Do

func (SpanAttributes) IsMigrator

func (o SpanAttributes) IsMigrator()

type SpanConditionalAttributes

type SpanConditionalAttributes struct {
	Migrator migrate.ConditionalAttributeSet
}

SpanConditionalAttributes is a conditional Transformer that acts on ptrace.Span's name. It powers the [Span's rename_attributes] transformation. [Span's rename_attributes]: https://opentelemetry.io/docs/specs/otel/schemas/file_format_v1.1.0/#rename_attributes-transformation

func (SpanConditionalAttributes) Do

func (SpanConditionalAttributes) IsMigrator

func (o SpanConditionalAttributes) IsMigrator()

type SpanEventAttributes

type SpanEventAttributes struct {
	AttributeChange migrate.AttributeChangeSet
}

SpanEventAttributes is a Transformer that acts on ptrace.SpanEvent attributes. It is part of the AllAttributes.

func (SpanEventAttributes) Do

func (SpanEventAttributes) IsMigrator

func (o SpanEventAttributes) IsMigrator()

type SpanEventConditionalAttributes

type SpanEventConditionalAttributes struct {
	MultiConditionalAttributeSet migrate.MultiConditionalAttributeSet
}

SpanEventConditionalAttributes is an transformer that powers the [Span Event's rename_attributes] change. [Span Event's rename_attributes]: https://opentelemetry.io/docs/specs/otel/schemas/file_format_v1.1.0/#rename_attributes-transformation-1

func (SpanEventConditionalAttributes) Do

func (SpanEventConditionalAttributes) IsMigrator

func (o SpanEventConditionalAttributes) IsMigrator()

type SpanEventSignalNameChange

type SpanEventSignalNameChange struct {
	SignalNameChange migrate.SignalNameChange
}

SpanEventSignalNameChange is an transformer that powers the [Span Event's rename_events] change. [Span Event's rename_events]: https://opentelemetry.io/docs/specs/otel/schemas/file_format_v1.1.0/#rename_events-transformation

func (SpanEventSignalNameChange) Do

func (SpanEventSignalNameChange) IsMigrator

func (c SpanEventSignalNameChange) IsMigrator()

type Transformer

type Transformer[T pmetric.Metric | plog.LogRecord | ptrace.Span | pcommon.Resource] interface {
	Do(ss migrate.StateSelector, data T) error
}

Jump to

Keyboard shortcuts

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