elasticexporter

package module
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: Apache-2.0 Imports: 17 Imported by: 1

README

Elastic native support for OpenTelemetry

ℹ️ Since version 7.13, Elastic supports native OTLP ingestion. This means you can use an OTLP exporter to send data to Elastic, instead of the OpenTelemetry Collector Exporter for Elastic. The otlp exporter is the recommended way to integrate the OpenTelemetry Collector to Elastic.

For more details, see the Elastic documentation to integrate with OpenTelemetry.

Sample configurations

Sample configuration using an Elastic APM Secret Token

When authenticating with an Elastic APM Secret Token, define an Authorization: "Bearer xxx" header on the OTLP exporter:

...
exporters:
  otlp/elastic:
      endpoint: "xxx.elastic-cloud.com:443"
      headers:
          Authorization: "Bearer your-apm-secret-token"
service:
  pipelines:
    metrics:
      receivers:
        - otlp
      processors:
        - batch
      exporters:
        - otlp/elastic
    traces:
      receivers:
        - otlp
      processors:
        - batch
      exporters:
        - otlp/elastic
Sample configuration using an Elastic API Key

When authenticating with an Elastic API Key, define an Authorization: "ApiKey xxx" header on the OTLP exporter:

exporters:
  otlp/elastic:
      endpoint: "xxx.elastic-cloud.com:443"
      headers:
          Authorization: "ApiKey your-api-key"
...
Sample configuration for an insecure setup disabling TLS and authentication
exporters:
  otlp/elastic:
      endpoint: "localhost:8200"
      insecure: true

Migration

ℹ️ The native support of OpenTelemetry by Elastic doesn't remove the architectural benefits of using the OpenTelemetry Collector in observability architectures. The OpenTelemetry Collector continues to add high availability, scalability, retries, live reconfiguration (like with sampling), data enrichment, ingestion of various protocols such as Jaeger or Zipkin, etc.

To migrate from the legacy OpenTelemetry Collector exporter for Elastic to the native support of OpenTelemetry in Elastic, replace the OpenTelemetry Collector's elastic exporter with an otlp exporter.

Sample migration:

...
exporters:

  ## REMOVE THE DEFINITION OF THE `ELASTIC` EXPORTER
  # elastic:
  #      apm_server_url: "https://elasticapm.example.com"
  #      secret_token: "hunter2"

  ## INTRODUCE THE DEFINITION OF AN `OTLP` EXPORTER (SAME ELASTIC HOST, SAME AUTHENTICATION TOKEN OR KEY, DON'T FORGET TO SPECIFY THE LISTEN PORT)
  otlp/elastic:
      endpoint: "xxx.elastic-cloud.com:443"
      headers:
          Authorization: "Bearer hunter2"
service:
  pipelines:
    metrics:
      receivers:
        - otlp
      processors:
        - batch
      exporters:
      
        ## REMOVE THE `ELASTIC` EXPORTER
        # - elastic
        
        ## ADD THE `OTLP` EXPORTER
        - otlp/elastic
    traces:
      receivers:
        - otlp
      processors:
        - batch
      exporters:
      
        ## REMOVE THE `ELASTIC` EXPORTER
        # - elastic
        
        ## ADD THE `OTLP` EXPORTER
        - otlp/elastic

Legacy OpenTelemetry Collector Exporter for Elastic

This exporter supports sending OpenTelemetry data to Elastic Observability.

Complete documentation is available on Elastic.co.

Configuration options
  • apm_server_url (required): Elastic APM Server URL.
  • api_key (optional): credential for API Key authorization, if enabled in Elastic APM Server.
  • secret_token (optional): credential for Secret Token authorization, if enabled in Elastic APM Server.
  • ca_file (optional): root Certificate Authority (CA) certificate, for verifying the server's identity, if TLS is enabled.
  • cert_file (optional): client TLS certificate.
  • key_file (optional): client TLS key.
  • insecure (optional): disable verification of the server's identity, if TLS is enabled.
Example
exporters:
    elastic:
        apm_server_url: "https://elasticapm.example.com"
        secret_token: "hunter2"

Documentation

Overview

Package elasticexporter contains an opentelemetry-collector exporter for Elastic APM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory added in v0.7.0

func NewFactory() component.ExporterFactory

NewFactory creates a factory for Elastic exporter.

Types

type Config

type Config struct {
	config.ExporterSettings    `mapstructure:",squash"`
	configtls.TLSClientSetting `mapstructure:",squash"`

	// APMServerURLs holds the APM Server URL.
	//
	// This is required.
	APMServerURL string `mapstructure:"apm_server_url"`

	// APIKey holds an optional API Key for authorization.
	//
	// https://www.elastic.co/guide/en/apm/server/7.7/api-key-settings.html
	APIKey string `mapstructure:"api_key"`

	// SecretToken holds the optional secret token for authorization.
	//
	// https://www.elastic.co/guide/en/apm/server/7.7/secret-token.html
	SecretToken string `mapstructure:"secret_token"`
}

Config defines configuration for Elastic APM exporter.

func (Config) Validate

func (cfg Config) Validate() error

Validate validates the configuration.

Directories

Path Synopsis
internal
translator/elastic
Package elastic contains an OTLP exporter for Elastic APM.
Package elastic contains an OTLP exporter for Elastic APM.

Jump to

Keyboard shortcuts

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