Prometheus protocols
Exposing metrics
Note
If you are using ClickHouse Cloud, you can expose metrics to Prometheus using the Prometheus Integration.
ClickHouse can expose its own metrics for scraping from Prometheus:
Settings:
| Name | Default | Description | 
|---|---|---|
| port | none | Port for serving the exposing metrics protocol. | 
| endpoint | /metrics | HTTP endpoint for scraping metrics by prometheus server. Starts with /. Should not be used with the<handlers>section. | 
| url/headers/method | none | Filters used to find a matching handler for a request. Similar to the fields with the same names in the <http_handlers>section. | 
| metrics | true | Expose metrics from the system.metrics table. | 
| asynchronous_metrics | true | Expose current metrics values from the system.asynchronous_metrics table. | 
| events | true | Expose metrics from the system.events table. | 
| errors | true | Expose the number of errors by error codes occurred since the last server restart. This information could be obtained from the system.errors as well. | 
| histograms | true | Expose histogram metrics from system.histogram_metrics | 
| dimensional_metrics | true | Expose dimensional metrics from system.dimensional_metrics | 
Check (replace 127.0.0.1 with the IP addr or hostname of your ClickHouse server):
Remote-write protocol
ClickHouse supports the remote-write protocol. Data are received by this protocol and written to a TimeSeries table (which should be created beforehand).
Settings:
| Name | Default | Description | 
|---|---|---|
| port | none | Port for serving the remote-writeprotocol. | 
| url/headers/method | none | Filters used to find a matching handler for a request. Similar to the fields with the same names in the <http_handlers>section. | 
| table | none | The name of a TimeSeries table to write data received by the remote-writeprotocol. This name can optionally contain the name of a database too. | 
| database | none | The name of a database where the table specified in the tablesetting is located if it's not specified in thetablesetting. | 
Remote-read protocol
ClickHouse supports the remote-read protocol. Data are read from a TimeSeries table and sent via this protocol.
Settings:
| Name | Default | Description | 
|---|---|---|
| port | none | Port for serving the remote-readprotocol. | 
| url/headers/method | none | Filters used to find a matching handler for a request. Similar to the fields with the same names in the <http_handlers>section. | 
| table | none | The name of a TimeSeries table to read data to send by the remote-readprotocol. This name can optionally contain the name of a database too. | 
| database | none | The name of a database where the table specified in the tablesetting is located if it's not specified in thetablesetting. | 
Configuration for multiple protocols
Multiple protocols can be specified together in one place:
