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/tenantlabel. 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.
| Field | Description |
|---|---|
metadata.labels."observability.giantswarm.io/tenant" | Required. The tenant the collected metrics are routed to (see discovery requirements). |
spec.selector.matchLabels | Selects the Services to scrape by their labels. |
spec.endpoints[].port | Named Service port that exposes metrics. |
spec.endpoints[].path | HTTP path that exposes metrics. Defaults to /metrics. |
spec.endpoints[].interval | Scrape 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.
| Field | Description |
|---|---|
metadata.labels."observability.giantswarm.io/tenant" | Required. The tenant the collected metrics are routed to (see discovery requirements). |
spec.selector.matchLabels | Selects the Pods to scrape by their labels. |
spec.podMetricsEndpoints[].port | Named Pod port that exposes metrics. |
spec.podMetricsEndpoints[].path | HTTP path that exposes metrics. Defaults to /metrics. |
spec.podMetricsEndpoints[].interval | Scrape 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
Need help, got feedback?
We listen to your Slack support channel. You can also reach us at support@giantswarm.io. And of course, we welcome your pull requests!