Skip to content

Commit 537d2f1

Browse files
committed
Add docs for org endpoint
1 parent f62f346 commit 537d2f1

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

docs/en/integrations/prometheus.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ To get started, [generate an API key](/en/cloud/manage/openapi).
1818

1919
| Method | Path | Description |
2020
| ------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ |
21-
| GET | https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/prometheus | Returns the full set of metrics |
22-
| GET | https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/prometheus?filtered_metrics=true | Returns a filtered list of metrics to reduce response payload size |
21+
| GET | https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/prometheus?filtered_metrics=[true | false] | Returns metrics for a specific service |
22+
| GET | https://api.clickhouse.cloud/v1/organizations/:organizationId/prometheus?filtered_metrics=[true | false] | Returns metrics for all services in an organization |
2323

2424
**Request Parameters**
2525

26-
| Name | Type |
27-
| ---------------- | ------------------ |
28-
| Organization ID | uuid |
29-
| Service ID | uuid |
30-
| filtered_metrics | boolean (optional) |
26+
| Name | Location | Type |
27+
| ---------------- | ------------------ |------------------ |
28+
| Organization ID | Endpoint address | uuid |
29+
| Service ID | Endpoint address | uuid (optional) |
30+
| filtered_metrics | Query param | boolean (optional) |
3131

3232

3333
### Authentication
@@ -41,8 +41,13 @@ Example request
4141
export KEY_SECRET=<key_secret>
4242
export KEY_ID=<key_id>
4343
export ORG_ID=<org_id>
44+
45+
# For all services in $ORG_ID
46+
curl --silent --user $KEY_ID:$KEY_SECRET https://api.clickhouse.cloud/v1/organizations/$ORG_ID/prometheus?filtered_metrics=true
47+
48+
# For a single service only
4449
export SERVICE_ID=<service_id>
45-
curl --silent --user $KEY_ID:$KEY_SECRET https://api.clickhouse.cloud/v1/organizations/$ORG_ID/services/$SERVICE_ID/prometheus
50+
curl --silent --user $KEY_ID:$KEY_SECRET https://api.clickhouse.cloud/v1/organizations/$ORG_ID/services/$SERVICE_ID/prometheus?filtered_metrics=true
4651
```
4752

4853
### Sample Response
@@ -113,14 +118,16 @@ scrape_configs:
113118
static_configs:
114119
- targets: ["api.clickhouse.cloud"]
115120
scheme: https
116-
metrics_path: "/v1/organizations/<ORG_ID>/services/<SERVICE_ID>/prometheus"
121+
params:
122+
filtered_metrics: ["true"]
123+
metrics_path: "/v1/organizations/<ORG_ID>/prometheus"
117124
basic_auth:
118125
username: <KEY_ID>
119126
password: <KEY_SECRET>
120127
honor_labels: true
121128
```
122129
123-
Note the `honor_labels` configuration parameter needs to be set to `true` for the instance label to be properly populated.
130+
Note the `honor_labels` configuration parameter needs to be set to `true` for the instance label to be properly populated. Additionally, `filtered_metrics` is set to `true` in the above example, but should be configured based on user preference.
124131

125132
## Integrating with Grafana
126133

@@ -178,8 +185,8 @@ The following shows an example configuration for Alloy with a `prometheus.scrape
178185
prometheus.scrape "clickhouse_cloud" {
179186
// Collect metrics from the default listen address.
180187
targets = [{
181-
__address__ = "https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/Prometheus",
182-
// e.g. https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/services/f7fefb6e-41a5-48fa-9f5f-deaaa442d5d8/prometheus
188+
__address__ = "https://api.clickhouse.cloud/v1/organizations/:organizationId/prometheus?filtered_metrics=true",
189+
// e.g. https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/prometheus?filtered_metrics=true
183190
}]
184191
185192
honor_labels = true
@@ -214,8 +221,8 @@ Self-managed users of Grafana can find the instructions for installing the Alloy
214221
prometheus.scrape "clickhouse_cloud" {
215222
// Collect metrics from the default listen address.
216223
targets = [{
217-
__address__ = "https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/Promethues",
218-
// e.g. https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/services/f7fefb6e-41a5-48fa-9f5f-deaaa442d5d8/prometheus
224+
__address__ = "https://api.clickhouse.cloud/v1/organizations/:organizationId/prometheus?filtered_metrics=true",
225+
// e.g. https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/services/f7fefb6e-41a5-48fa-9f5f-deaaa442d5d8/prometheus?filtered_metrics=true
219226
}]
220227
221228
honor_labels = true
@@ -249,7 +256,7 @@ You can use the Datadog [Agent](https://docs.datadoghq.com/agent/?tab=Linux) and
249256
init_config:
250257
251258
instances:
252-
- openmetrics_endpoint: 'https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/services/f7fefb6e-41a5-48fa-9f5f-deaaa442d5d8/prometheus'
259+
- openmetrics_endpoint: 'https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/prometheus?filtered_metrics=true'
253260
namespace: 'clickhouse'
254261
metrics:
255262
- '^ClickHouse.*'

0 commit comments

Comments
 (0)