Scrape Astra DB Serverless metrics in exposition format

This Astra DB Serverless feature is currently in public preview. Development is ongoing, and the features and functionality are subject to change. Astra DB Serverless, and the use of such, is subject to the DataStax Preview Terms.

You can use compatible third-party observability tools and services to scrape Astra DB Serverless metrics in Prometheus exposition format. You can use any tool or service that is compatible with Prometheus exposition format, such as Prometheus, Amazon CloudWatch, Datadog, Victoria Metrics, and more. The following steps use Prometheus for example purposes.

Whereas exporting metrics is push-based, this approach is pull-based. Your security policies might require you to use a pull-based configuration for metrics ingestion.

Prerequisites

Scraping metrics is a premium feature that requires a paid subscription plan.

Get credentials and IDs

  1. Create an application token with a role that has Manage Metrics permission.

    If you plan to scrape multiple databases, you can customize each token’s scope. For example, you can create separate tokens for each database, or you can create one token with the Organization Administrator role.

  2. Get the database ID for each Astra DB Serverless database that you want to scrape.

  3. If your Astra organization has PCU groups, and you want to scape PCU group metrics, get the uuid for each PCU group that you want to scrape.

    To get a list of PCU groups in your Astra organization, use POST /v2/pcus/actions/get:

    curl -sS -L -X POST "https://api.astra.datastax.com/v2/pcus/actions/get" \
    --header "Authorization: Bearer APPLICATION_TOKEN" \
    --header "Content-Type: application/json" \
    --data '{}'

    The provided APPLICATION_TOKEN must have the Organization Administrator or Billing Administrator role.

Configure Prometheus to scrape metrics

  1. In your Prometheus configuration YAML file, in the scrape_configs section, add a job for each database that you want to scrape:

    scrape_configs:
      - job_name: "prometheus-FIRST_DATABASE_ID"
        scrape_interval: 30s
        metrics_path: /v1/databases/FIRST_DATABASE_ID/metrics
        scheme: "https"
        authorization:
          type: "Astra-Token"
          credentials: "APPLICATION_TOKEN"
        static_configs:
          - targets: ["metrics.astra.datastax.com"]
    
      - job_name: "prometheus-SECOND_DATABASE_ID"
        scrape_interval: 30s
        metrics_path: /v1/databases/SECOND_DATABASE_ID/metrics
        scheme: "https"
        authorization:
          type: "Astra-Token"
          credentials: "APPLICATION_TOKEN"
        static_configs:
          - targets: ["metrics.astra.datastax.com"]
  2. For databases in PCU groups, add a job for each PCU group that you want to scape:

    scrape_configs:
      - job_name: "prometheus-PCU_GROUP_ID"
        scrape_interval: 30s
        metrics_path: /v1/pcugroup/PCU_GROUP_ID/metrics
        scheme: "https"
        authorization:
          type: "Astra-Token"
          credentials: "APPLICATION_TOKEN"
        static_configs:
          - targets: ["metrics.astra.datastax.com"]
  3. Set the global or job scrape interval to 30s. This is the recommended interval to avoid dropping histogram buckets and stay in sync with the Astra Portal dashboard.

    # Set an interval for all jobs in the global section.
    global:
      scrape_interval: 30s
    
    # Set intervals for individual jobs in the scrape_configs section.
    scrape_configs:
      - job_name: "prometheus-DATABASE_ID"
        scrape_interval: 30s
  4. Reload your Prometheus configuration.

  5. If required, configure your observability service to receive the Astra DB metrics from your Prometheus endpoint.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use Manage Privacy Choices

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: Contact IBM