Skip to Content

Observability & Monitoring

Send Databrain data to Elastic

Send traces, metrics and logs from a self-hosted Databrain backend to Elastic.

Before you start

  • You read Send traces, metrics and logs to your tool.
  • Elastic Cloud: the managed OTLP endpoint and an API key with the event:write privilege for the apm application.
  • Self-managed Elastic: an OTLP endpoint that your Elastic stack exposes, such as an EDOT Collector gateway.

Steps

  1. Run an OpenTelemetry Collector (otel/opentelemetry-collector-contrib) with this config. Set ELASTIC_OTLP_ENDPOINT and ELASTIC_API_KEY on the Collector. Keep the space after ApiKey.

    receivers:
      otlp:
        protocols:
          http:
            endpoint: 0.0.0.0:4318
    
    processors:
      batch: {}
    
    exporters:
      otlphttp/elastic:
        endpoint: ${env:ELASTIC_OTLP_ENDPOINT}
        headers:
          Authorization: "ApiKey ${env:ELASTIC_API_KEY}"
    
    service:
      pipelines:
        traces:
          receivers: [otlp]
          processors: [batch]
          exporters: [otlphttp/elastic]
        metrics:
          receivers: [otlp]
          processors: [batch]
          exporters: [otlphttp/elastic]
        logs:
          receivers: [otlp]
          processors: [batch]
          exporters: [otlphttp/elastic]
  2. Set these on the Databrain backend and restart it:

    OTEL_ENABLED=true
    OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318

Check it

In Kibana, open Observability > Applications. databrain-api shows up after a few requests.

If nothing arrives, check the Collector log first, then see Observability setup. Elastic reference: Elastic managed OTLP endpoint.