---
title: "Get Prometheus service discovery targets"
method: GET
path: "/v1/organizations/{organizationId}/prometheus/discovery"
tags: ["Prometheus"]
---

# Get Prometheus service discovery targets

`GET /v1/organizations/{organizationId}/prometheus/discovery`

## Request

- Base URL: `https://api.clickhouse.cloud`
- URL: `https://api.clickhouse.cloud/v1/organizations/{organizationId}/prometheus/discovery`
- Auth: HTTP basic

Returns one Prometheus scrape target per service in the organization, in the [HTTP service discovery](https://prometheus.io/docs/prometheus/latest/http_sd/) (`http_sd`) format. Only services the API key is authorized to view are included; services that are being deleted or have been deleted are omitted.

Point an [`http_sd_configs`](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config) job at this endpoint to discover and scrape all services in the organization automatically. Prometheus refreshes the target list on every discovery poll, so newly created and deleted services are picked up without configuration changes.

Filter targets in `relabel_configs` by `__meta_clickhouse_region`, `__meta_clickhouse_provider` or `__meta_clickhouse_tag_<key>`. Invalid label name characters in tag keys become `_`. `__meta_clickhouse_tagpresent_<key>` is `true` for every tag, including tags without a value.

Discovered targets scrape with `filtered_metrics=true` by default; pass `?filtered_metrics=false` to this endpoint to discover unfiltered targets. See the [Prometheus integration guide](https://clickhouse.com/docs/integrations/prometheus) for more on the exported metrics.

## Path parameters

- `organizationId` string, uuid, required

## Query parameters

- `filtered_metrics` string, boolean

## Response `200`

Successful response

- PrometheusDiscoveryTargetGroup[]
  - `targets` string[]: Host (and port) of the ClickHouse Cloud API.
  - `labels` PrometheusDiscoveryLabels
    - `__scheme__` string: URL scheme Prometheus must scrape the target with.
    - `__metrics_path__` string: Path of the per-service Prometheus metrics endpoint.
    - `__param_filtered_metrics` string, boolean: Value passed as the filtered_metrics query parameter on each scrape.
    - `clickhouse_org_id` string, uuid: Organization ID the service belongs to.
    - `clickhouse_service_id` string, uuid: Service ID.
    - `clickhouse_discovery_service_name` string: Service name.
    - `__meta_clickhouse_region` string: Service region, for example `us-east-1`.
    - `__meta_clickhouse_provider` string: Cloud provider, for example `aws`.

## Other responses

- `400`: The request cannot be processed due to a client error. Please verify your request parameters and try again.
- `500`: An internal server error has occurred. If this issue persists, please contact ClickHouse Cloud support for assistance.

## Changes

- **2026-10-14** `6d8734780e00`: 2 info
  - added the optional property `items/labels/__meta_clickhouse_provider` to the response with the `200` status
  - added the optional property `items/labels/__meta_clickhouse_region` to the response with the `200` status

[Operation history](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud/changes/v1/organizations/:organizationId/prometheus/discovery/get.md)

---

[API](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud.md) - [All operations](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud/revisions/eac345053548?raw)
