otlp

package
v1.14.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AgentNameJaeger          = "Jaeger"
	MaxDataStreamBytes       = 100
	DisallowedNamespaceRunes = "\\/*?\"<>| ,#:"
	DisallowedDatasetRunes   = "-\\/*?\"<>| ,#:"
)

Variables

This section is empty.

Functions

func TranslateSpan

func TranslateSpan(spanKind ptrace.SpanKind, attributes pcommon.Map, event *modelpb.APMEvent)

TranslateSpan converts incoming otlp/otel trace data into the expected elasticsearch format.

func TranslateTransaction

func TranslateTransaction(
	attributes pcommon.Map,
	spanStatus ptrace.Status,
	library pcommon.InstrumentationScope,
	event *modelpb.APMEvent,
)

TranslateTransaction converts incoming otlp/otel trace data into the expected elasticsearch format.

Types

type ConsumeLogsResult

type ConsumeLogsResult struct {
	ErrorMessage       string
	RejectedLogRecords int64
}

ConsumeLogsResult contains the number of rejected log records and error message for partial success response.

type ConsumeMetricsResult

type ConsumeMetricsResult struct {
	ErrorMessage       string
	RejectedDataPoints int64
}

ConsumeMetricsResult contains the number of rejected data points and error message for partial success response.

type ConsumeTracesResult

type ConsumeTracesResult struct {
	ErrorMessage  string
	RejectedSpans int64
}

ConsumeTracesResult contains the number of rejected spans and error message for partial success response.

type Consumer

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

Consumer transforms OpenTelemetry data to the Elastic APM data model, sending each payload as a batch to the configured BatchProcessor.

func NewConsumer

func NewConsumer(config ConsumerConfig) *Consumer

NewConsumer returns a new Consumer with the given configuration.

func (*Consumer) Capabilities

func (c *Consumer) Capabilities() consumer.Capabilities

Capabilities is part of the consumer interfaces.

func (*Consumer) ConsumeLogs

func (c *Consumer) ConsumeLogs(ctx context.Context, logs plog.Logs) error

ConsumeLogs calls ConsumeLogsWithResult but ignores the result. It exists to satisfy the go.opentelemetry.io/collector/consumer.Logs interface.

func (*Consumer) ConsumeLogsWithResult

func (c *Consumer) ConsumeLogsWithResult(ctx context.Context, logs plog.Logs) (ConsumeLogsResult, error)

ConsumeLogsWithResult consumes OpenTelemetry log data, converting into the Elastic APM log model and sending to the reporter.

func (*Consumer) ConsumeMetrics

func (c *Consumer) ConsumeMetrics(ctx context.Context, metrics pmetric.Metrics) error

ConsumeMetrics calls ConsumeMetricsWithResult but ignores the result. It exists to satisfy the go.opentelemetry.io/collector/consumer.Metrics interface.

func (*Consumer) ConsumeMetricsWithResult

func (c *Consumer) ConsumeMetricsWithResult(ctx context.Context, metrics pmetric.Metrics) (ConsumeMetricsResult, error)

ConsumeMetricsWithResult consumes OpenTelemetry metrics data, converting into the Elastic APM metrics model and sending to the reporter.

func (*Consumer) ConsumeTraces

func (c *Consumer) ConsumeTraces(ctx context.Context, traces ptrace.Traces) error

ConsumeTraces calls ConsumeTracesWithResult but ignores the result. It exists to satisfy the go.opentelemetry.io/collector/consumer.Traces interface.

func (*Consumer) ConsumeTracesWithResult

func (c *Consumer) ConsumeTracesWithResult(ctx context.Context, traces ptrace.Traces) (ConsumeTracesResult, error)

ConsumeTracesWithResult consumes OpenTelemetry trace data, converting into Elastic APM events and reporting to the Elastic APM schema.

func (*Consumer) Stats

func (c *Consumer) Stats() ConsumerStats

Stats returns a snapshot of the current statistics about data consumption.

type ConsumerConfig

type ConsumerConfig struct {
	// Logger holds a logger for the consumer. If this is nil, then
	// no logging will be performed.
	Logger *zap.Logger

	// Processor holds the modelpb.BatchProcessor which will be invoked
	// with event batches when consuming OTLP payloads.
	Processor modelpb.BatchProcessor

	// Semaphore holds a semaphore on which Processor.HandleStream will acquire a
	// token before proceeding, to limit concurrency.
	Semaphore input.Semaphore

	// RemapOTelMetrics remaps certain OpenTelemetry metrics to elastic metrics.
	// Note that both, OTel and Elastic, metrics would be published.
	RemapOTelMetrics bool
}

ConsumerConfig holds configuration for Consumer.

type ConsumerStats

type ConsumerStats struct {
	// UnsupportedMetricsDropped records the number of unsupported metrics
	// that have been dropped by the consumer.
	UnsupportedMetricsDropped int64
}

ConsumerStats holds a snapshot of statistics about data consumption.

Jump to

Keyboard shortcuts

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