Skip to content

Commit ec5d9cf

Browse files
committed
Revert "Add filtered metrics request param to prom endpoint"
This reverts commit 844505a.
1 parent 844505a commit ec5d9cf

File tree

1 file changed

+81
-83
lines changed

1 file changed

+81
-83
lines changed

docs/en/integrations/prometheus.md

Lines changed: 81 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ slug: /en/integrations/prometheus
33
sidebar_label: Prometheus
44
title: Prometheus
55
description: Export ClickHouse metrics to Prometheus
6-
keywords: [prometheus, grafana, monitoring, metrics, exporter]
6+
keywords: [prometheus, grafana, monitoring, metrics, exporter]
77
---
88

99
# Prometheus Integration
@@ -16,18 +16,16 @@ To get started, [generate an API key](/en/cloud/manage/openapi).
1616

1717
### API Reference
1818

19-
| Method | Path | Description |
20-
| ------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ |
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 |
19+
|Method|Path|
20+
|---|---|
21+
|GET|https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/prometheus|
2322

2423
**Request Parameters**
2524

26-
| Name | Type |
27-
| ---------------- | ------------------ |
28-
| Organization ID | uuid |
29-
| Service ID | uuid |
30-
| filtered_metrics | boolean (optional) |
25+
|Name|Type|
26+
|---|---|
27+
|Organization ID|uuid|
28+
|Service ID|uuid|
3129

3230
### Authentication
3331

@@ -41,7 +39,7 @@ export KEY_SECRET=<key_secret>
4139
export KEY_ID=<key_id>
4240
export ORG_ID=<org_id>
4341
export SERVICE_ID=<service_id>
44-
curl --silent --user $KEY_ID:$KEY_SECRET https://api.clickhouse.cloud/v1/organizations/$ORG_ID/services/$SERVICE_ID/prometheus
42+
curl --silent --user $KEY_ID:$KEY_SECRET https://api.clickhouse.cloud/v1/organizations/$ORG_ID/services/$SERVICE_ID/prometheus
4543
```
4644

4745
### Sample Response
@@ -76,23 +74,23 @@ ClickHouseProfileEvents_Seek{clickhouse_org="c2ba4799-a76e-456f-a71a-b021b1fafe6
7674

7775
All metrics have the following labels:
7876

79-
| Label | Description |
80-
| ----------------------- | --------------- |
81-
| clickhouse_org | Organization ID |
82-
| clickhouse_service | Service ID |
83-
| clickhouse_service_name | Service name |
77+
|Label|Description|
78+
|---|---|
79+
|clickhouse_org|Organization ID|
80+
|clickhouse_service|Service ID|
81+
|clickhouse_service_name|Service name|
8482

8583
### Information Metrics
8684

8785
ClickHouse Cloud provides a special metric `ClickHouse_ServiceInfo` which is a `gauge` that always has the value of `1`. This metric contains all the **Metric Labels** as well as the following labels:
8886

89-
| Label | Description |
90-
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
91-
| clickhouse_cluster_status | Status of the service. Could be one of the following: [`awaking` \| `running` \| `degraded` \| `idle` \| `stopped`] |
92-
| clickhouse_version | Version of the ClickHouse server that the service is running |
93-
| scrape | Indicates the status of the last scrape. Could be either `full` or `partial` |
94-
| full | Indicates that there were no errors during the last metrics scrape |
95-
| partial | Indicates that there were some errors during the last metrics scrape and only `ClickHouse_ServiceInfo` metric was returned. |
87+
|Label|Description|
88+
|---|---|
89+
|clickhouse_cluster_status|Status of the service. Could be one of the following: [`awaking` \| `running` \| `degraded` \| `idle` \| `stopped`]|
90+
|clickhouse_version|Version of the ClickHouse server that the service is running|
91+
|scrape|Indicates the status of the last scrape. Could be either `full` or `partial`|
92+
|full|Indicates that there were no errors during the last metrics scrape|
93+
|partial|Indicates that there were some errors during the last metrics scrape and only `ClickHouse_ServiceInfo` metric was returned.|
9694

9795
Requests to retrieve metrics will not resume an idled service. In the case that a service is in the `idle` state, only the `ClickHouse_ServiceInfo` metric will be returned.
9896

@@ -107,7 +105,7 @@ global:
107105
scrape_configs:
108106
- job_name: "prometheus"
109107
static_configs:
110-
- targets: ["localhost:9090"]
108+
- targets: ["localhost:9090"]
111109
- job_name: "clickhouse"
112110
static_configs:
113111
- targets: ["api.clickhouse.cloud"]
@@ -137,35 +135,35 @@ We provide instructions on using these options below, focusing on the details sp
137135
- Configure the Scrape URL to point to the Prometheus endpoint and use basic auth to configure your connection with the API key/secret
138136
- Test the connection to ensure you are able to connect
139137

140-
<img src={require('./images/prometheus-grafana-metrics-endpoint.png').default}
141-
class='image'
142-
alt='Configure Grafana Metrics Endpoint'
143-
style={{width: '600px'}} />
138+
<img src={require('./images/prometheus-grafana-metrics-endpoint.png').default}
139+
class='image'
140+
alt='Configure Grafana Metrics Endpoint'
141+
style={{width: '600px'}} />
144142

145143
<br />
146144

147145
Once configured, you should see the metrics in the drop-down that you can select to configure dashboards:
148146

149-
<img src={require('./images/prometheus-grafana-dropdown.png').default}
150-
class='image'
151-
alt='Grafana Metrics Explorer Drop-down'
152-
style={{width: '400px'}} />
147+
<img src={require('./images/prometheus-grafana-dropdown.png').default}
148+
class='image'
149+
alt='Grafana Metrics Explorer Drop-down'
150+
style={{width: '400px'}} />
153151

154152
<br />
155153

156-
<img src={require('./images/prometheus-grafana-chart.png').default}
157-
class='image'
158-
alt='Grafana Metrics Explorer Chart'
159-
style={{width: '800px'}} />
154+
<img src={require('./images/prometheus-grafana-chart.png').default}
155+
class='image'
156+
alt='Grafana Metrics Explorer Chart'
157+
style={{width: '800px'}} />
160158

161159
### Grafana Cloud with Alloy
162160

163161
If you are using Grafana Cloud, Alloy can be installed by navigating to the Alloy menu in Grafana and following the onscreen instructions:
164162

165-
<img src={require('./images/prometheus-grafana-alloy.png').default}
166-
class='image'
167-
alt='Grafana Alloy'
168-
style={{width: '600px'}} />
163+
<img src={require('./images/prometheus-grafana-alloy.png').default}
164+
class='image'
165+
alt='Grafana Alloy'
166+
style={{width: '600px'}} />
169167

170168
<br />
171169

@@ -175,31 +173,31 @@ The following shows an example configuration for Alloy with a `prometheus.scrape
175173

176174
```yaml
177175
prometheus.scrape "clickhouse_cloud" {
178-
// Collect metrics from the default listen address.
179-
targets = [{
180-
__address__ = "https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/Promethues",
176+
// Collect metrics from the default listen address.
177+
targets = [{
178+
__address__ = "https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/Promethues",
181179
// e.g. https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/services/f7fefb6e-41a5-48fa-9f5f-deaaa442d5d8/prometheus
182-
}]
180+
}]
183181
184-
honor_labels = true
182+
honor_labels = true
185183
186-
basic_auth {
187-
username = "KEY_ID"
188-
password = "KEY_SECRET"
189-
}
184+
basic_auth {
185+
username = "KEY_ID"
186+
password = "KEY_SECRET"
187+
}
190188
191-
forward_to = [prometheus.remote_write.metrics_service.receiver]
192-
// forward to metrics_service below
189+
forward_to = [prometheus.remote_write.metrics_service.receiver]
190+
// forward to metrics_service below
193191
}
194192
195193
prometheus.remote_write "metrics_service" {
196-
endpoint {
197-
url = "https://prometheus-prod-10-prod-us-central-0.grafana.net/api/prom/push"
198-
basic_auth {
199-
username = "<Grafana API username>"
200-
password = "<grafana API token>"
201-
}
202-
}
194+
endpoint {
195+
url = "https://prometheus-prod-10-prod-us-central-0.grafana.net/api/prom/push"
196+
basic_auth {
197+
username = "<Grafana API username>"
198+
password = "<grafana API token>"
199+
}
200+
}
203201
}
204202
```
205203

@@ -211,30 +209,30 @@ Self-managed users of Grafana can find the instructions for installing the Alloy
211209

212210
```yaml
213211
prometheus.scrape "clickhouse_cloud" {
214-
// Collect metrics from the default listen address.
215-
targets = [{
216-
__address__ = "https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/Promethues",
212+
// Collect metrics from the default listen address.
213+
targets = [{
214+
__address__ = "https://api.clickhouse.cloud/v1/organizations/:organizationId/services/:serviceId/Promethues",
217215
// e.g. https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/services/f7fefb6e-41a5-48fa-9f5f-deaaa442d5d8/prometheus
218-
}]
216+
}]
219217
220-
honor_labels = true
218+
honor_labels = true
221219
222-
basic_auth {
223-
username = "KEY_ID"
224-
password = "KEY_SECRET"
225-
}
220+
basic_auth {
221+
username = "KEY_ID"
222+
password = "KEY_SECRET"
223+
}
226224
227-
forward_to = [prometheus.remote_write.metrics_service.receiver]
228-
// forward to metrics_service. Modify to your preferred receiver
225+
forward_to = [prometheus.remote_write.metrics_service.receiver]
226+
// forward to metrics_service. Modify to your preferred receiver
229227
}
230228
```
231229

232230
Once configured, you should see ClickHouse related metrics in your metrics explorer:
233231

234-
<img src={require('./images/prometheus-grafana-metrics-explorer.png').default}
235-
class='image'
236-
alt='Grafana Metrics Explorer'
237-
style={{width: '800px'}} />
232+
<img src={require('./images/prometheus-grafana-metrics-explorer.png').default}
233+
class='image'
234+
alt='Grafana Metrics Explorer'
235+
style={{width: '800px'}} />
238236

239237
<br />
240238

@@ -248,17 +246,17 @@ You can use the Datadog [Agent](https://docs.datadoghq.com/agent/?tab=Linux) and
248246
init_config:
249247
250248
instances:
251-
- openmetrics_endpoint: "https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/services/f7fefb6e-41a5-48fa-9f5f-deaaa442d5d8/prometheus"
252-
namespace: "clickhouse"
253-
metrics:
254-
- "^ClickHouse.*"
255-
username: username
256-
password: password
249+
- openmetrics_endpoint: 'https://api.clickhouse.cloud/v1/organizations/97a33bdb-4db3-4067-b14f-ce40f621aae1/services/f7fefb6e-41a5-48fa-9f5f-deaaa442d5d8/prometheus'
250+
namespace: 'clickhouse'
251+
metrics:
252+
- '^ClickHouse.*'
253+
username: username
254+
password: password
257255
```
258256

259257
<br />
260258

261-
<img src={require('./images/prometheus-datadog.png').default}
262-
class='image'
263-
alt='Prometheus Datadog Integration'
264-
style={{width: '600px'}} />
259+
<img src={require('./images/prometheus-datadog.png').default}
260+
class='image'
261+
alt='Prometheus Datadog Integration'
262+
style={{width: '600px'}} />

0 commit comments

Comments
 (0)