assignkeys

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright The OpenTelemetry Authors SPDX-License-Identifier: Apache-2.0

Copyright The OpenTelemetry Authors SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	helper.TransformerConfig `mapstructure:",squash"`
	Field                    entry.Field `mapstructure:"field"`
	Keys                     []string    `mapstructure:"keys"`
}

Config is the configuration of a assign_keys operator

func NewConfig

func NewConfig() *Config

NewConfig creates a new assign_keys operator config with default values

func NewConfigWithID

func NewConfigWithID(operatorID string) *Config

NewConfigWithID creates a new assign_keys operator config with default values

func (Config) Build

Build will build an assign_keys operator from the supplied configuration

type Transformer

type Transformer struct {
	helper.TransformerOperator
	Field entry.Field
	Keys  []string
}

Transformer transforms a list in the entry field into a map. Each value is assigned a key from configuration keys

func (*Transformer) AssignKeys

func (t *Transformer) AssignKeys(keys []string, values []any) map[string]any

func (*Transformer) Process

func (t *Transformer) Process(ctx context.Context, entry *entry.Entry) error

Process will process an entry with AssignKeys transformation.

func (*Transformer) Transform

func (t *Transformer) Transform(entry *entry.Entry) error

Transform will apply AssignKeys to an entry

Jump to

Keyboard shortcuts

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