Skip to main content

Monitoring with ELK (Elastic)

The platform sends OTLP to the OpenTelemetry Gateway, which adds the credential and forwards everything to Elastic: traces to the APM app, metrics and logs to Elasticsearch, all visible in Kibana. The Elastic Agent adds Kubernetes metrics and container logs.

Before you start​

  • An Elastic deployment, 8.x or later — Elastic Cloud (in a region that meets your data-residency requirements) or your own cluster, for example on ECK — with Kibana and an OTLP intake: the APM integration (APM Server), or the managed OTLP endpoint (Elastic Cloud Hosted and Serverless only).
  • The intake endpoint, for example https://<deployment>.apm.<region>.aws.cloud.es.io:443, from Kibana (Observability → APM → Add data, or the APM integration policy).
  • An API key limited to ingest (APM event:write) — preferred — or the APM secret token.
  • The nodes reach the endpoint on port 443.
  • With a private registry: the Elastic Agent image mirrored to it.

Step 1. Install the gateway​

Follow OpenTelemetry Gateway: store the API key (in its base64 form) or the secret token as the gateway token, then install it with the common part plus:

config:
exporters:
otlp_grpc/elastic:
endpoint: <apm-endpoint-host>:443
headers:
Authorization: "ApiKey ${env:OTLP_TOKEN}" # APM secret token instead: "Bearer ${env:OTLP_TOKEN}"
service:
pipelines:
traces: {receivers: [otlp], processors: [memory_limiter, batch], exporters: [otlp_grpc/elastic]}
metrics: {receivers: [otlp], processors: [memory_limiter, batch], exporters: [otlp_grpc/elastic]}
logs: {receivers: [otlp], processors: [memory_limiter, batch], exporters: [otlp_grpc/elastic]}

With the managed OTLP endpoint of Elastic Cloud instead of APM Server, use the exporter otlp_http/elastic with endpoint: <managed-otlp-url> and Authorization: "ApiKey ${env:OTLP_TOKEN}".

kubectl -n idv-monitoring logs deploy/otel-gateway --tail=50 | grep -i -E 'error|unauthorized|denied' || echo "no export errors"

Step 2. Send the platform's telemetry to the gateway​

In observability-values.yaml (Configure the platform's OTLP settings):

global:
observability:
otlpEndpoint: http://otel-gateway.idv-monitoring:4318
otlpGrpcEndpoint: http://otel-gateway.idv-monitoring:4317
collector:
logs:
enabled: false # true only if the Elastic Agent (step 3) does not collect container logs

Run the upgrade and the checks of Apply the change.

Step 3. Kubernetes metrics and container logs: Elastic Agent​

In Kibana, Fleet → Add agent → Kubernetes generates a DaemonSet manifest with the Kubernetes integration (nodes, pods, containers, events, container logs). Apply it as shown there.

  • Add a toleration for each taint you gave your nodes (for example the DIS node), so they are covered too.
  • Collect the container logs in one place only — the Elastic Agent (recommended: it adds Kubernetes metadata) or the platform's log collector, never both, or every line arrives twice.
  • The Elastic Agent collects the logs of every namespace by default. Limit it to the namespaces you need, and apply the same retention and access rules to the platform's logs as to your other production logs.

Done when, in Kibana:

  • Observability → APM → Services lists the platform services with traces.
  • Discover on metrics-* finds dis_license_expiration_remaining_days.
  • Observability → Logs shows the pod logs of the platform namespace.
  • Infrastructure → Kubernetes shows the nodes and pods.

Step 4. Alerts​

Create Kibana alerting rules (Observability → Alerts → Manage rules) — for example a metric threshold or an Elasticsearch query rule — on the metrics in Alert Rules. The Kubernetes integration brings ready-made dashboards, and the APM app alerts on error rate and latency per service.

Remove​

  1. Set the platform's endpoints to "" and upgrade (Stop exporting).
  2. Remove the gateway (Remove the gateway), and remove the Elastic Agent from Fleet and delete its manifest.
  3. Revoke the API key (or rotate the APM secret token) and delete its secret-store entry.
  4. Data already sent stays in Elasticsearch until its index lifecycle deletes it.