Documentation ¶
Overview ¶
Package modelprocessor is meant to be used to enrich modelpb.Batch implementing the modelpb.BatchProcessor interface.
Index ¶
- func IsInternalMetricName(name string) bool
- func NewDropUnsampled(dropRUM bool, droppedCallback func(int64)) modelpb.BatchProcessor
- type Chained
- type ConfigOption
- type RemoveEventReceived
- type SetCulprit
- type SetDataStream
- type SetDefaultServiceEnvironment
- type SetErrorMessage
- type SetGroupingKey
- type SetHostHostname
- type SetServiceNodeName
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInternalMetricName ¶
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.
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.