assignkeys

package
v0.97.0 Latest Latest
Warning

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

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

Documentation

Overview

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

func (c Config) Build(logger *zap.SugaredLogger) (operator.Operator, error)

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 (p *Transformer) AssignKeys(keys []string, values []any) map[string]any

func (*Transformer) Process

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

Process will process an entry with AssignKeys transformation.

func (*Transformer) Transform

func (p *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