Telegraf

Embed
Preview of the card
<a href="https://forumulate.com/p/watchtower/docs/telegraf"><img src="https://forumulate.com/api/public/orgs/watchtower/spaces/docs/pages/cb44e912-ebba-4e29-bc66-0db16197ad5c/social-card.svg?v=3e7ae33eec8b" alt="Telegraf" width="600" height="315"></a>

Forward metrics from your own Telegraf (1.32 or later) with its opentelemetry output, which speaks OTLP/gRPC. Needs an ingestion key with ingest:metrics. Set WT_OTLP_GRPC_ADDR (the gateway's OTLP gRPC address, for example ingest.example.com:4317) and WT_INGEST_KEY in Telegraf's environment.

[[inputs.cpu]]
  percpu = false
  totalcpu = true

[[inputs.mem]]

[[outputs.opentelemetry]]
  service_address = "${WT_OTLP_GRPC_ADDR}"
  timeout = "10s"
  compression = "gzip"
  metrics_schema = "prometheus-v2"
  tls_ca = "/etc/ssl/certs/ca-certificates.crt"

  [outputs.opentelemetry.headers]
    Authorization = "Bearer ${WT_INGEST_KEY}"

metrics_schema = "prometheus-v2" maps each Telegraf field to its own OTLP metric (cpu_usage_idle, mem_used, ...) with the tags as attributes, which is the shape the metric explorer and PromQL expect. Setting tls_ca turns TLS on; for a plain-text test gateway remove it and point WT_OTLP_GRPC_ADDR at the gateway's non-TLS port. Add a service.name through the output's [outputs.opentelemetry.attributes] table (or a Telegraf global tag service) so the metrics are grouped under a service.

Delivery is at-least-once: Telegraf retries a failed batch from its output buffer, so a lost acknowledgement can send points twice. The buffer is in memory (metric_buffer_limit), so points not yet flushed are lost if Telegraf crashes. Do not set wt.* attributes; the gateway deletes them.

Status: structure-checked, not yet run against the real agent. Check the output options against your Telegraf version.

Updated