Last modified July 6, 2026

ServiceMonitor and PodMonitor reference

This page describes the Prometheus Operator ServiceMonitor and PodMonitor custom resources as used to collect metrics on the Giant Swarm Observability Platform. The metrics agent on each cluster discovers these resources and scrapes the targets they select.

For the task-oriented steps to set up metrics collection, see the data ingestion guide. For the complete upstream schema, see the Prometheus Operator API documentation.

Discovery requirements

For a ServiceMonitor or PodMonitor to be picked up by the platform:

  • Tenant label: the resource must carry the observability.giantswarm.io/tenant label. It routes the collected metrics to that tenant.
  • Tenant existence: the named tenant must already exist in a Grafana Organization. Metrics routed to a non-existent tenant are dropped.

ServiceMonitor

A ServiceMonitor collects metrics from applications that expose them through a Kubernetes Service. It’s the primary way to configure metric collection.

FieldDescription
metadata.labels."observability.giantswarm.io/tenant"Required. The tenant the collected metrics are routed to (see discovery requirements).
spec.selector.matchLabelsSelects the Services to scrape by their labels.
spec.endpoints[].portNamed Service port that exposes metrics.
spec.endpoints[].pathHTTP path that exposes metrics. Defaults to /metrics.
spec.endpoints[].intervalScrape interval, for example 60s.

PodMonitor

A PodMonitor collects metrics directly from Pods, without requiring a Service. Use a PodMonitor when:

  • Your application doesn’t need a Service for its primary function.
  • You need to collect metrics from specific Pod instances.
  • You want more granular control over Pod selection.
FieldDescription
metadata.labels."observability.giantswarm.io/tenant"Required. The tenant the collected metrics are routed to (see discovery requirements).
spec.selector.matchLabelsSelects the Pods to scrape by their labels.
spec.podMetricsEndpoints[].portNamed Pod port that exposes metrics.
spec.podMetricsEndpoints[].pathHTTP path that exposes metrics. Defaults to /metrics.
spec.podMetricsEndpoints[].intervalScrape interval, for example 60s.

See also

  • Data ingestion: how to configure metrics collection, with working ServiceMonitor and PodMonitor examples
  • Multi-tenancy: how tenants isolate observability data