Prometheus

Get Prometheus service discovery targets

Changed on

Returns one Prometheus scrape target per service in the organization, in the HTTP service discovery (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 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 for more on the exported metrics.

get/v1/organizations/{organizationId}/prometheus/discovery

Request

  • Base URL
    https://api.clickhouse.cloud
  • Auth
    HTTP basic

Path parameters

organizationId, string uuid required

ID of the requested organization.

Query parameters

filtered_metrics, string boolean
Example:true

Whether discovered targets scrape a filtered list of metrics. Sets the filtered_metrics parameter on each discovered target. Defaults to true.

Response

Successful response

PrometheusDiscoveryTargetGroup[] required
targets, string[]

Host (and port) of the ClickHouse Cloud API.

labels, PrometheusDiscoveryLabels

Example response

[
  {
    "labels": {
      "__param_filtered_metrics": "true"
    }
  }
]

Changes

    • info

      added the optional property items/labels/__meta_clickhouse_provider to the response with the status

    • info

      added the optional property items/labels/__meta_clickhouse_region to the response with the status