elasticapmreceiver

package module
v0.0.0-...-ddcde6d Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 18 Imported by: 0

README

Elastic APM Receiver

An experimental OpenTelemetry Collector receiver for Elastic APM trace data.

Elastic APM agents export telemetry data to Elastic APM Server via the Events Intake API. With this receiver, agents can point to an OpenTelemetry Collector instance instead and export trace data to any backend supported by OpenTelemetry.

Metrics and logs are currently not supported.

Elastic RUM JS Agent to OpenTelemetry Collector to Jaeger

This is a proof of concept. It is not intended for production use.

Getting Started

⚠️ This receiver must be built from source. See Build for instructions.

The receiver can be configured using the following settings:

  • endpoint the URI where this receiver can be contacted (default: 0.0.0.0:8200)
  • events_url_path the path to the Events Intake V2 endpoint (default: /intake/v2/events)
  • rum_events_url_path the path to the RUM Events Intake V2 endpoint (default: /intake/v2/rum/events)
  • max_event_size_bytes the maximum size of an event in bytes (default: 300KiB)
  • batch_size the maximum number of events to process in a single batch (default: 10)

See OTel Collector Server Configuration for more options (e.g. CORS, TLS, Headers, Auth).

Build

Use OpenTelemetry Collector Builder to build a binary with this receiver included.

Extend builder-config.yaml to include a receiver configuration for the Elastic APM receiver. For example:

receivers:
  - gomod: github.com/ldgrp/elasticapmreceiver v0.0.0

Then build the binary:

$ ocb --config builder-config.yaml

How it works

This receiver depends heavily on the latest elastic/apm-data package to process incoming requests and convert them into an APMEvent struct. This struct is then converted to an OpenTelemetry span and scheduled for export.

  • The Elastic APM RUM JS Agent exports transactions with a duration attribute, without a timestamp attribute. Traditionally, APM Server is in charge of setting the timestamp attribute https://github.com/elastic/apm-server/issues/723. Equivalently, this receiver sets the timestamp attribute to the current time.

  • Elastic APM Agents periodically poll APM Server for configuration changes. This receiver does not support this feature.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

Types

type Config

type Config struct {
	*confighttp.HTTPServerSettings `mapstructure:",squash"`
	EventsURLPath                  string `mapstructure:"events_url_path"`
	RUMEventsUrlPath               string `mapstructure:"rum_events_url_path"`
	MaxEventSize                   int    `mapstructure:"max_event_size_bytes"`
	BatchSize                      int    `mapstructure:"batch_size"`
}

func (*Config) Validate

func (cfg *Config) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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