# Extract Cluster Metrics in Prometheus Format

Available with the Professional plan and above

This guide explains how to extract your cluster metrics and monitor them via the [ScyllaDB Monitoring Stack](https://monitoring.docs.scylladb.com/) tool, which includes the Prometheus server in its stack.
To use the metrics outside of ScyllaDB Cloud, you need to install the Prometheus server or use a third-party party tool that can read Prometheus output files.
[This blog post](https://www.scylladb.com/2019/10/02/monitoring-scylla-with-datadog-a-tale-about-datadog-prometheus-integration/)  shows
instructions on transferring the metrics to Datadog.

## Before You Begin

See the following documents before extracting your cluster metrics:

* [ScyllaDB Monitoring Support Matrix](https://monitoring.docs.scylladb.com/stable/reference/matrix.html)
* [Calculating Prometheus Minimal Disk Space Requirement](https://monitoring.docs.scylladb.com/stable/install/monitoring_stack.html#calculating-prometheus-minimal-disk-space-requirement)

## Extracting ScyllaDB Cluster Metrics

1. Install the latest version of [ScyllaDB Monitoring Stack](https://monitoring.docs.scylladb.com/) locally
   or on a remote machine.
2. Start ScyllaDB Monitoring Stack and validate it was installed successfully.
3. Enable cluster metrics.
   * For a new cluster, enable the **Extract cluster metrics** option when creating your cluster.
   * For an existing cluster, choose **Actions> Enable Cluster Metrics** from the drop-down navigation bar or click **Enable** next to *CLUSTER METRICS* in your cluster’s view.
4. Click **Setup** next to *CLUSTER METRICS* to download the .yaml file with the cluster metrics. The content of the file may resemble the following:
   ```none
   scrape_configs:
   - job_name: scylla_cloud_cluster_2
     scrape_interval: 15s
     honor_labels: true
     metrics_path: /api/v1/cluster/2/proxy/federate
     params:
       match[]:
       - '{job=~".+"}'
     bearer_token: SECRET_TOKEN
     static_configs:
     - targets:
       - api.cloud.example.com
   ```
5. Navigate to the scylla-monitoring repository:
   ```none
   cd scylla-monitoring
   ```
6. Create a `scylla-cloud.yaml` file and add the Prometheus configuration file you received to it.
7. Manually edit the `prometheus/prometheus.yml` template to add additional configuration settings from the scrape_configs of `scylla-cloud.yaml` file you just saved.

   Alternatively, use the yq tool to merge the two files using the following command:
   ```none
   yq merge -i -a prometheus/prometheus.yml.template ../scylla-cloud.yaml
   ```
8. Restart the [scylla-monitoring](https://monitoring.docs.scylladb.com/stable/install/monitoring_stack.html#start-and-stop-scylla-monitoring-stack) service.
9. Point your browser to the [URL](https://monitoring.docs.scylladb.com/stable/install/monitoring_stack.html#view-grafana-dashboards) indicated to view your cluster metrics in Grafana.

You can disable cluster metrics by choosing **Actions> Disable Cluster Metrics** from the drop-down navigation bar in your cluster’s view.

## Related Information

* [ScyllaDB Monitoring Stack](https://monitoring.docs.scylladb.com/)
* [Troubleshooting Guide for ScyllaDB Monitoring Stack](https://monitoring.docs.scylladb.com/stable/troubleshooting/)
