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.
role:project:admin, role:project:operator, or project:services:writePrerequisites
Enable Prometheus metrics
-
In your DataHub service, go to the DataHub resources section.
-
Open the Aiven App that ends in
-gms. -
In the Environment variables section, click Edit.
-
On the Variables tab, add the following variables:
Key Value MANAGEMENT_ENDPOINT_PROMETHEUS_ENABLEDtrueMANAGEMENT_SERVER_PORT8080SPRING_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/*"}} -
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_TOKENis your DataHub personal access token.GMS_URLis your DataHub GMS URL
Requests without a valid token return an HTTP 401 Unauthorized status code.
Access related metrics
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.