modelprocessor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package modelprocessor is meant to be used to enrich modelpb.Batch implementing the modelpb.BatchProcessor interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInternalMetricName

func IsInternalMetricName(name string) bool

IsInternalMetricName returns true when the metric is considered "internal", and is stored in a strictly mapped data stream. Updates to the language / runtime mappings on the internal_metrics APM package must be kept up to date with the fields defined here.

func NewDropUnsampled

func NewDropUnsampled(dropRUM bool, droppedCallback func(int64)) modelpb.BatchProcessor

NewDropUnsampled returns a modelpb.BatchProcessor which drops unsampled transaction events, and runs the specified callback.

If dropRUM is false, only non-RUM unsampled transaction events are dropped; otherwise all unsampled transaction events are dropped.

This modelpb.BatchProcessor does not guarantee order preservation of the remaining events.

Types

type Chained

type Chained []modelpb.BatchProcessor

Chained is a chained modelpb.BatchProcessor, calling each of the processors in the slice in series.

func (Chained) ProcessBatch

func (c Chained) ProcessBatch(ctx context.Context, batch *modelpb.Batch) error

ProcessBatch calls each of the processors in c in series.

type ConfigOption

type ConfigOption func(config) config

ConfigOption allows passing a functional option when creating a new processor

func WithTracerProvider

func WithTracerProvider(tp trace.TracerProvider) ConfigOption

WithTracerProvider allows setting a custom tracer provider Defaults to the global tracer provider

type RemoveEventReceived

type RemoveEventReceived struct{}

RemoveEventReceived is a processor that removes event.received field as it should not be indexed.

func (RemoveEventReceived) ProcessBatch

func (RemoveEventReceived) ProcessBatch(ctx context.Context, b *modelpb.Batch) error

ProcessBatch removes event.received field for events.

type SetCulprit

type SetCulprit struct{}

SetCulprit is a modelpb.BatchProcessor that sets or updates the culprit for RUM errors, after source mapping and identifying library frames.

func (SetCulprit) ProcessBatch

func (s SetCulprit) ProcessBatch(ctx context.Context, b *modelpb.Batch) error

ProcessBatch sets or updates the culprit for RUM errors.

type SetDataStream

type SetDataStream struct {
	Namespace string
}

SetDataStream is a modelpb.BatchProcessor that routes events to the appropriate data streams.

func (*SetDataStream) ProcessBatch

func (s *SetDataStream) ProcessBatch(ctx context.Context, b *modelpb.Batch) error

ProcessBatch sets data stream fields for each event in b.

type SetDefaultServiceEnvironment

type SetDefaultServiceEnvironment struct {
	// DefaultServiceEnvironment is the default service.environment value
	// to set for events without one already set.
	DefaultServiceEnvironment string
}

SetDefaultServiceEnvironment is a transform.Processor that sets a default service.environment value for events without one already set.

func (*SetDefaultServiceEnvironment) ProcessBatch

ProcessBatch sets a default service.value for events without one already set.

type SetErrorMessage

type SetErrorMessage struct{}

SetErrorMessage is a modelpb.BatchProcessor that sets the APMEvent.Message field for error events.

func (SetErrorMessage) ProcessBatch

func (s SetErrorMessage) ProcessBatch(ctx context.Context, b *modelpb.Batch) error

ProcessBatch sets the message for errors.

type SetGroupingKey

type SetGroupingKey struct{}

SetGroupingKey is a modelpb.BatchProcessor that sets the grouping key for errors by hashing their stack frames.

func (SetGroupingKey) ProcessBatch

func (s SetGroupingKey) ProcessBatch(ctx context.Context, b *modelpb.Batch) error

ProcessBatch sets the grouping key for errors.

type SetHostHostname

type SetHostHostname struct{}

SetHostHostname is a transform.Processor that sets the final host.name and host.hostname values, according to whether the event originated from within Kubernetes or not.

func (SetHostHostname) ProcessBatch

func (SetHostHostname) ProcessBatch(ctx context.Context, b *modelpb.Batch) error

ProcessBatch sets or overrides the host.name and host.hostname fields for events.

type SetServiceNodeName

type SetServiceNodeName struct{}

SetServiceNodeName is a transform.Processor that sets the service node name value for events without one already set.

SetServiceNodeName should be called after SetHostHostname, to ensure Name is set.

func (SetServiceNodeName) ProcessBatch

func (SetServiceNodeName) ProcessBatch(ctx context.Context, b *modelpb.Batch) error

ProcessBatch sets a default service.node.name for events without one already set.

type Tracer

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

Tracer is a model.BatchProcessor that wraps another processor within a transaction.

func NewTracer

func NewTracer(n string, p modelpb.BatchProcessor, opts ...ConfigOption) *Tracer

NewTracer returns a Tracer that emits transactions for batches processed.

func (*Tracer) ProcessBatch

func (c *Tracer) ProcessBatch(ctx context.Context, b *modelpb.Batch) error

ProcessBatch runs for each batch run, and emits telemetry

Jump to

Keyboard shortcuts

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