Skip to main content

Enable Prometheus metrics for Aiven for DataHub

Enable Prometheus metrics for your Aiven for DataHub service to monitor its performance and health. The service exposes operational metrics including request rates, latencies, and resource usage.

You can enable Prometheus metrics and secure them by setting environment variables in the GMS application.

Required roles or permissions:role:project:admin, role:project:operator, or project:services:write

Prerequisites

Enable Prometheus metrics

  1. In your DataHub service, go to the DataHub resources section.

  2. Open the Aiven App that ends in -gms.

  3. In the Environment variables section, click Edit.

  4. On the Variables tab, add the following variables:

    KeyValue
    MANAGEMENT_ENDPOINT_PROMETHEUS_ENABLEDtrue
    MANAGEMENT_SERVER_PORT8080
    SPRING_APPLICATION_JSON{"authentication":{"excludedPaths":"/schema-registry/,/health,/health/live,/health/detailed,/config,/config/search/export,/public-iceberg/,/openapi/operations/dev/featureFlags,/openapi/operations/dev/featureFlags/*"}}
  5. Click Save.

Scrape Prometheus metrics

Use the following endpoint to scrape metrics:

https://GMS_URL/actuator/prometheus

Where GMS_URL is your DataHub GMS URL.

Example Prometheus configuration:

scrape_configs:
- job_name: datahub-gms
metrics_path: /actuator/prometheus
scheme: https
authorization:
type: Bearer
credentials: DATAHUB_ACCESS_TOKEN
static_configs:
- targets:
- GMS_URL

Where:

  • DATAHUB_ACCESS_TOKEN is your DataHub personal access token.
  • GMS_URL is your DataHub GMS URL

Requests without a valid token return an HTTP 401 Unauthorized status code.

You can get related metrics in JSON format at the /actuator/metrics endpoint.

Security

To restrict access to the metrics to authenticated users, do not expose port 4319 and do not include Prometheus in the excluded paths.