Kubernetes · Enterprise

Kubernetes Observability: OpenTelemetry Collector, Managed Prometheus and Uptime Kuma

Collect metrics with an OpenTelemetry Collector, send them to managed Prometheus, add custom metrics and use Uptime Kuma for outside-in uptime checks, all deployed with Helm.

  • OpenTelemetry
  • Prometheus
  • Managed Prometheus
  • Uptime Kuma
  • Helm
  • Kubernetes
  • Grafana
  • PromQL

// Why this matters

A reliable way to deploy an OpenTelemetry Collector on Kubernetes with managed Prometheus gives every team the same answer to what is happening in my workload. Without a shared pipeline each team installs its own exporters, scrape configs drift and nobody can compare services. Dashboards built on different label conventions cannot be reused.

Choosing managed Prometheus removes the part most teams regret running themselves: scaling storage, retention and high availability. The OpenTelemetry Collector gives you a vendor-neutral collection layer, so you can change backends or add traces and logs later without touching applications.

// The problem

Self-run Prometheus per cluster is easy at first and painful later. Retention fills disks, queries slow down as cardinality grows, and a cluster rebuild loses history. Per-team sidecars and agents multiply: each new tool means a new daemon, new credentials and new network rules.

There is also a blind spot. Metrics collected inside the cluster report that pods are healthy while customers see errors because DNS, the load balancer or the certificate is broken. You need both inside-out and outside-in signals, with alerts that page on symptoms.

// The solution

The pipeline has three parts. Collection: a collector DaemonSet runs on every node and scrapes node-local targets (kubelet, cadvisor, node-level exporters) through the Prometheus receiver, with target allocation restricted to the local node so there are no duplicates. A smaller gateway Deployment receives data, batches it, drops noisy series and adds resource attributes such as cluster and environment.

Storage: the gateway exports with Prometheus remote write to a managed workspace. Authentication uses workload identity federation to a cloud role that is allowed to write, so the collector pod carries no static credentials. Queries run in the managed service, from its charts UI or from Grafana using the same endpoint.

Custom metrics: applications expose a /metrics endpoint with client libraries. Discovery is by pod annotations or a ServiceMonitor. Agree a convention up front: snake_case names, units in the name, a small bounded label set, and a service label on everything. High-cardinality labels such as user ids are rejected in review.

Outside-in: Uptime Kuma runs as a small stateful app, probes public URLs, TCP ports and certificate expiry from outside, and notifies the same channel as alerts. I considered a hosted synthetic monitoring product but a self-run Uptime Kuma is cheap, simple and sufficient for HTTP and cert checks. See Guardrails and Engineering Telemetry: Org Policy, Project Factory, Gatekeeper, Four Keys for how these signals feed engineering reporting.

How it flows flow1. Pick the backend → 2. Identity → 3. Deploy agent → 4. Deploy gateway → 5. Gate: remote write → 6. Custom metrics → 7. Dashboards → 8. Uptime checks → 9. Alert01Pick the backend02Identity03Deploy agent04Deploy gateway05 · GATEGate: remote write06Custom metrics07Dashboards08Uptime checks09Alert
How it flows. End-to-end flow. Dashed pink nodes are gates: points where a human or a check must pass before the next stage runs.
  1. Pick the backendmanaged Prometheus workspace with remote-write endpoint
  2. Identityworkload identity so the collector can write without keys
  3. Deploy agentcollector DaemonSet scrapes kubelet and node metrics
  4. Deploy gatewaycollector Deployment batches, relabels and exports
  5. Gate: remote write gatesamples must reach the workspace before dashboards mean anything
  6. Custom metricsapps expose /metrics and are discovered by annotation
  7. Dashboardscharts and alerts in the managed UI or Grafana
  8. Uptime checksUptime Kuma probes public endpoints from outside
  9. Alertroute burn and downtime alerts to the on-call channel
Sourceskubelet / cadvisorapp /metricsnode exporterCollector agentDaemonSetprometheus receiverlocal targets onlyCollector gatewaybatchrelabel / dropresource attributesBackendremote writemanaged Prometheusdashboards and alerts
Telemetry path. Everything exits through one gateway, so backends can change without touching workloads.
App podAgentGatewayCloud IAMPrometheusscrape /metrics every 30sOTLP batch of samplesexchange pod token for write roleshort-lived credentialsremote write requestack 204, series stored
A metric sample from pod to chart. Identity is federated, so there are no keys in the cluster.

// Before you start

  • A Kubernetes cluster (1.27 or newer) and Helm 3
  • A managed Prometheus workspace in your cloud with a remote-write endpoint
  • Workload identity configured between the cluster and the cloud IAM role that can write metrics
  • Permission to install CRDs if you use the OpenTelemetry operator or Prometheus Operator CRDs
  • Basic PromQL knowledge
  • A storage class for Uptime Kuma data

// Step-by-step implementation

  1. 01 Step 1. Prepare the identity for remote write

    Create a cloud role allowed to write to the managed workspace and bind it to a Kubernetes service account through workload identity. The collector pods use that service account and get short-lived credentials automatically.

  2. 02 Step 2. Install the collector gateway with Helm

    The gateway receives OTLP from agents, batches, and exports with remote write. The memory limiter protects the pod when a spike arrives, and the batch processor keeps requests efficient.

  3. 03 Step 3. Install the node agent DaemonSet

    The agent runs on every node and scrapes only the local kubelet and pods using node-scoped service discovery, which avoids duplicate series. It forwards to the gateway over OTLP.

  4. 04 Step 4. Expose and annotate custom metrics

    Add a client library to the application, expose /metrics and annotate the pod. Keep label sets small and bounded.

  5. 05 Step 5. Write alerting rules on symptoms

    Alert on what users feel: error ratio and latency, not CPU. Use a for clause to avoid flapping, and add a runbook link in the annotations.

  6. 06 Step 6. Deploy Uptime Kuma for outside-in checks

    Uptime Kuma is a single-pod stateful service with a small SQLite database on a volume. Expose it behind your ingress with authentication, then add monitors for HTTP endpoints, keyword checks and certificate expiry.

// How to verify it works

  • kubectl -n observability get pods shows one agent pod per node and two gateway pods, all Ready.
  • The gateway logs show successful remote-write requests with no authorization errors.
  • A PromQL query for up in the managed workspace returns series with your cluster and environment labels.
  • Your custom counter appears (for example orders_requests_total) and increases as you generate traffic.
  • Stop an upstream service and confirm Uptime Kuma shows the endpoint down and notifies the channel.

// Design decisions and trade-offs

  • An OpenTelemetry Collector as the single collection point, so scrape logic and exporters change in one place rather than in every workload.
  • Managed Prometheus for storage and query, to avoid running and scaling long-term metrics storage ourselves.
  • A two-tier collector: a DaemonSet agent for node-local data and a small gateway Deployment for processing and export.
  • Custom application metrics through Prometheus annotations or a ServiceMonitor, with naming conventions agreed up front.
  • Uptime Kuma checks from outside the cluster, because internal metrics cannot tell you that the ingress is unreachable.

// Pitfalls and lessons learned

  • Duplicate series from agents scraping everything. Filter service discovery to the local node.
  • High-cardinality labels. A user id or full URL as a label can overwhelm storage; bound every label.
  • Static keys for remote write. Use workload identity; keys leak and expire.
  • No memory limiter on the gateway, so a burst becomes an out-of-memory restart and a gap in data.
  • Alerting on causes (CPU) instead of symptoms (errors and latency).
  • Treating internal metrics as availability evidence. Only an outside-in probe notices a broken ingress or expired certificate.

// Frequently asked questions

How do I send Kubernetes metrics to managed Prometheus with OpenTelemetry?

Run the OpenTelemetry Collector with the Prometheus receiver to scrape targets and the Prometheus remote write exporter to send to the workspace, authenticated with workload identity.

Should I run the OpenTelemetry Collector as a DaemonSet or a Deployment?

Use both: a DaemonSet agent for node-local data and a Deployment gateway for batching, filtering and export.

How do I add custom application metrics?

Expose a Prometheus-format /metrics endpoint with a client library and let the collector discover it by annotation or ServiceMonitor.

Is Uptime Kuma enough for production uptime monitoring?

It is good for HTTP, TCP and certificate checks from one vantage point. For multi-region probing or SLAs consider adding more vantage points.

// The outcome

A uniform telemetry path in each cluster: metrics collected by OpenTelemetry, stored and charted in managed Prometheus, custom metrics supported and external availability tracked separately.

// Where to take it next

// Keep reading