Integrate Grafana Cloud with Astra DB Serverless

Grafana Cloud can consume and visualize Astra DB Serverless health metrics.

Prerequisites

  • You exported metrics to a third-party observability service. This guide assumes that you exported metrics to Prometheus, but you can also export metrics to Kafka, Amazon CloudWatch, Splunk, Pulsar, and Datadog.

  • You have a Grafana Cloud account.

  • You have an application token.

Generate a Grafana Cloud config file

You must generate a config file to view metrics from Prometheus:

  1. Sign in to your Grafana Cloud account, and then add a connection.

  2. Search for Prometheus, and then select Hosted Prometheus metrics.

  3. Specify a Token name, and then create the token.

The config file is generated. Here’s an example config file:

cat << EOF > ./agent-config.yaml
metrics:
  global:
    scrape_interval: 60s
  configs:
  - name: hosted-prometheus
    scrape_configs:
      - job_name: node
        static_configs:
        - targets: ['localhost:9100']
    remote_write:
      - url: PROMETHEUS_WRITE_METRICS_URL
        basic_auth:
          username: PROMETHEUS_USER_NAME
          password: PROMETHEUS_PASSWORD
EOF

Export metrics from Astra DB Serverless

  1. If you haven’t done so already, configure Astra DB to export metrics to Prometheus.

    To add a Prometheus metrics export destination to a database, send a POST request to the DevOps API Configure Telemetry endpoint. The request body must contain the database’s entire telemetry configuration, including all existing destinations, as returned by the Get Telemetry Configuration endpoint.

    curl -sS --location -X POST "https://api.astra.datastax.com/v2/databases/ASTRA_DB_ID/telemetry/metrics" \
    --header "Authorization: Bearer APPLICATION_TOKEN" \
    --header "Accept: application/json" \
    --data '{
      "prometheus_remote":  {
        "endpoint": "PROMETHEUS_URL",
        "auth_strategy": "basic",
        "password": PROMETHEUS_PASSWORD,
        "user": PROMETHEUS_USERNAME
      }
    }'

    Set the data parameters to the values that you retrieved from Grafana Cloud.

    A successful response returns a 202 Accepted status code.

  2. In Grafana Cloud, create a dashboard.

  3. Select your Prometheus data source, and then select Code mode.

    If configured correctly, the Astra DB Serverless metrics are shown under the Metrics Browser.

  4. Select the metrics that you want to visualize in Grafana Cloud.

Create an Astra DB Serverless dashboard from a template

You can use a template to create a Astra DB Serverless dashboard in Grafana Cloud.

This option is for Serverless (Non-Vector) databases only.

  1. In your Grafana Cloud instance, import a dashboard.

  2. Upload or enter the grafana_dashboard.json template.

  3. Click Load.

Once imported, your Serverless (Non-Vector) health charts autopopulate in Grafana Cloud.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com