Skip to content

Latest commit

 

History

History

elasticexporter

Elastic native support for OpenTelemetry

Deprecated Elastic Exporter

Status
Stability deprecated
Supported pipeline types traces, metrics
Distributions contrib

ℹ️ This exporter has been deprecated due to Elastic APM Server supporting native OTLP ingestion since version 7.13. This means you can use an OTLP exporter to send data to Elastic APM Server, 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"
      tls:
        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.
  • tls:
    • 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"