---
title: "Scrape metrics from universe nodes"
url: "https://docs.yugabyte.com/stable/yugabyte-platform/alerts-monitoring/prometheus-custom/prometheus-scrape/"
---

# Scrape metrics from universe nodes

Export universe metrics to your own Prometheus instance

Scrape from universe nodes directly

Your independent Prometheus instance will scrape data from database nodes directly (in the case of VM-based universes) or scrape data from a Kubernetes Prometheus Operator Service Monitor (in the case of K8s-based universes). This data scraping runs in parallel to and independently from the YugabyteDB Anywhere-embedded Prometheus.

- Cloud or on-premises universe
- Kubernetes universe

Every node of a YugabyteDB universe exports granular time series metrics. The metrics are formatted in both Prometheus exposition format or JSON for seamless integration with Prometheus.

**Prometheus format**

View YB-TServer metrics in Prometheus format in the browser or via the CLI using the following command:

```sh
curl <node IP>:9000/prometheus-metrics
```

View YB-Master server metrics in Prometheus format in the browser or via the CLI using the following command:

```sh
curl <node IP>:7000/prometheus-metrics
```

**JSON format**

The YugabyteDB Anywhere API can expose the health check results as a JSON blob. You can view YB-TServer metrics in JSON format in the browser or via the CLI using the following command:

```sh
curl <node IP>:9000/metrics
```

Using this API to retrieve health check alerts would require you to first parse the JSON, and then do some text parsing afterward to scrape the metrics from each field.

The [Prometheus Operator](https://prometheus-operator.dev "Prometheus Operator") should be installed on your Kubernetes universe. To verify that it is running, use the following command:

```sh
kubectl get pods -n kube-prometheus-stack kube-prometheus-stack-operator-5577f9747-hqzbw
```

```output
NAME                                             READY   STATUS    RESTARTS   AGE
kube-prometheus-stack-operator-5577f9747-hqzbw   1/1     Running   0          4d19h
```

To use a custom Prometheus instance with a universe on Kubernetes, Add the following configuration to the [Kubernetes Overrides](/stable/yugabyte-platform/scale-deployments/edit-helm-overrides/ "Kubernetes Overrides"):

```yaml
serviceMonitor:
  enabled: true
  extraLabels:
    release: prom
```

This enables a service monitor and adds an extra label `release: prom`, which is required by the Prometheus Operator to discover the service monitor.

To verify the configuration:

1. Access your Prometheus dashboard.
2. Navigate to the **Service Discovery** page and search for the name of your universe.
   
   The service monitor for your YugabyteDB Anywhere universe should be listed.
   
   ![Prometheus Service Discovery](/images/yp/alerts-monitoring/prometheus-service-discovery.png "Prometheus Service Discovery")

To view metrics, use Prometheus queries. For sample queries, refer to [Analyze key metrics](/stable/explore/observability/prometheus-integration/#analyze-key-metrics "Analyze key metrics").
