Type to search.

Add internal telemetry to an OTel Collector monitored by Fleet

Serverless Preview

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Preview

    This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack Preview 9.4+

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Preview since 9.4

    This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Monitor the health, resource usage, and pipeline performance of an OpenTelemetry (OTel) Collector in Kibana by sending its own metrics, logs, and traces to Elasticsearch. The collector emits this telemetry to its own OTLP (OpenTelemetry Protocol) receiver, which forwards it through a pipeline to Elasticsearch.

Note

If you added your collector using the Add collector flow, the generated configuration already includes internal telemetry.

You'll need:

  • An OTel Collector with OpAMP extension support, already added in Fleet. For more information, refer to Add an OTel Collector in Fleet.
  • Access to your OTel Collector's configuration file
  • An Elasticsearch API key with create_index, write, and auto_configure index privileges on metrics-*, logs-*, and traces-* data streams, or an existing exporter you can reuse for internal telemetry

To add internal telemetry to an existing collector configuration, extend it with the following components:

  1. Configure the OTLP receiver:

    YAML
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
          http:
            endpoint: 0.0.0.0:4318
    
  2. Configure an exporter that sends telemetry to your Elasticsearch backend. If your collector already exports telemetry, you can reuse the existing exporter and add the OTLP receiver to its pipelines. Otherwise, configure the elasticsearch/otel exporter:

    YAML
    exporters:
      elasticsearch/otel:
        endpoints: [https://elasticsearch:9200]
        api_key: "<es-api-key>"
        mapping:
          mode: otel
    
    1. Replace with your Elasticsearch endpoint.
    2. Replace with an Elasticsearch API key.
    Note

    On Serverless Observability projects and Elastic Cloud Hosted deployments, you can replace the elasticsearch/otel exporter with the Elastic Cloud Managed OTLP Endpoint, which accepts OTLP data directly and uses an APM-scoped API key. For more details, refer to Elastic Cloud Managed OTLP Endpoint (mOTLP).

  3. Set up the service pipelines:

    YAML
    service:
      pipelines:
        metrics:
          receivers: [otlp]
          exporters: [elasticsearch/otel]
        logs:
          receivers: [otlp]
          exporters: [elasticsearch/otel]
        traces:
          receivers: [otlp]
          exporters: [elasticsearch/otel]
    
  4. Set up internal telemetry for the OTel Collector:

    YAML
    service:
      telemetry:
        resource:
          service.instance.id: "<instance-uid>"
        metrics:
          level: detailed
          readers:
            - periodic:
                interval: 3000
                exporter:
                  otlp:
                    protocol: grpc
                    endpoint: http://localhost:4317
        logs:
          processors:
            - batch:
                exporter:
                  otlp:
                    protocol: grpc
                    endpoint: http://localhost:4317
        traces:
          processors:
            - batch:
                exporter:
                  otlp:
                    protocol: grpc
                    endpoint: http://localhost:4317
    
    1. Replace with the UUID value provided in extensions.opamp.instance_uid.
  5. Save your configuration, then start or restart the OTel Collector.

When your collector is running, confirm that internal telemetry is reaching Elasticsearch:

  1. The first time the collector ingests data, Fleet automatically installs the OTel Collector internal telemetry dashboards in Kibana.
  2. In Kibana, go to Dashboards and search for OTel Collector internal telemetry.
  3. Open a dashboard and confirm that visualizations display your collector's metrics, logs, traces, resource usage, pipeline performance, and component health.