{
  "id": "connect-prometheus-operator",
  "title": "Connect the Prometheus operator to Redis Enterprise for Kubernetes",
  "url": "https://redis.io/docs/latest/operate/kubernetes/7.8.4/re-clusters/connect-prometheus-operator/",
  "summary": "This article describes how to configure a Prometheus operator custom resource to allow it to export metrics from Redis Enterprise for Kubernetes.",
  "content": "\nTo collect  metrics data from your databases and Redis Enterprise cluster (REC), you can connect your [Prometheus](https://prometheus.io/) server to an endpoint exposed on your REC. Redis Enterprise for Kubernetes creates a dedicated service to expose the `prometheus` port (8070) for data collection. A custom resource called `ServiceMonitor` allows the [Prometheus operator](https://github.com/prometheus-operator/prometheus-operator/tree/main/Documentation) to connect to this port and collect data from Redis Enterprise.\n\n## Prerequisites\n\nBefore connecting Redis Enterprise to Prometheus on your Kubernetes cluster, make sure you've done the following:\n\n- [Deploy Redis Enterprise for Kubernetes]() (version 6.2.10-4 or newer)\n- [Deploy the Prometheus operator](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/getting-started.md) (version 0.19.0 or newer)\n- [Create a Redis Enterprise cluster]()\n\n## Create a `ServiceMonitor` custom resource\n\nBelow is an example `ServiceMonitor` custom resource file. By specifying the service label (`app: redis.io/service=prom-metrics`) in the `selector.matchLabels` section, you can point the Prometheus operator to the correct Redis Enterprise service (`\u003crec_name\u003e-prom`).\n\nYou'll need to configure the following fields to connect Prometheus to Redis Enterprise:\n\n| Section | Field | Value |\n|---|---|---|\n| `spec.endpoints` | `port` | Name of exposed port (`prometheus`) |\n| `spec.namespaceSelector` | `matchNames` | Namespace for your REC |\n| `spec.selector` | `matchLabels` | REC service label (`app: redis.io/service=prom-metrics`) |\n\nApply the file in the same namespace as your Redis Enterprise cluster (REC).\n    If Redis Enterprise and Prometheus are deployed in different namespaces, you'll also need to add the [`serviceMonitorNamespaceSelector`](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#namespaceselector) field to your Prometheus resource. See the [Prometheus operator documentation](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/getting-started.md#related-resources) for more details on cross-namespace `ServiceMonitor` configuration.\n\n\n```YAML\napiVersion: monitoring.coreos.com/v1\nkind: ServiceMonitor\nmetadata:\n  name: redis-enterprise\nspec:\n  endpoints:\n  - interval: 15s\n    port: prometheus\n    scheme: https\n    tlsConfig:\n      insecureSkipVerify: true\n  namespaceSelector:\n    matchNames:\n    - \u003cyour_REC_namespace\u003e\n  selector:\n    matchLabels:\n      redis.io/service: prom-metrics\n```\n\nFor more info about configuring the `ServiceMonitor` resource, see the [`ServiceMonitorSpec` API documentation](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api-reference/api.md#monitoring.coreos.com/v1.ServiceMonitorSpec).\n\n## More info\n\n- github.com/prometheus-operator\n  - [Getting started](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/getting-started/introduction.md)\n  - [Running exporters](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/running-exporters.md)\n  - [Troubleshooting ServiceMonitor changes](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/platform/troubleshooting.md#troubleshooting-servicemonitor-changes)\n- redis.io/docs\n  - [Metrics in Prometheus]()\n  - [Monitoring and metrics]()\n",
  "tags": ["docs","operate","kubernetes"],
  "last_updated": "2026-04-08T12:21:52-07:00"
}

