https://github.com/metrico/promcasa
ClickHouse Custom Query / Metrics Exporter for Prometheus
https://github.com/metrico/promcasa
clickhouse cloki metrics prometheus prometheus-exporter
Last synced: 2 months ago
JSON representation
ClickHouse Custom Query / Metrics Exporter for Prometheus
- Host: GitHub
- URL: https://github.com/metrico/promcasa
- Owner: metrico
- License: agpl-3.0
- Created: 2022-02-12T11:23:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-19T07:08:39.000Z (almost 2 years ago)
- Last Synced: 2025-03-26T12:51:10.386Z (3 months ago)
- Topics: clickhouse, cloki, metrics, prometheus, prometheus-exporter
- Language: Go
- Homepage:
- Size: 63.7 MB
- Stars: 29
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PromCasa
_Query, Aggregate and Publish_ anything from **ClickHouse** to **Prometheus** metrics in _zero time_
Unlike other exporters limited to internal metrics, **PromCasa** is designed to unleash data from *any query*
#### :star: Functionality
- Execute recurring Clickhouse `queries`
- Exctract mapped `labels` and `values`
- Aggregate results using `metric buckets`
- Publish as `prometheus` metrics---
### Instructions
Download a [binary release](https://github.com/metrico/promcasa/releases/) or build from source#### 📦 Download Binary
```
curl -fsSL github.com/metrico/promcasa/releases/latest/download/promcasa -O && chmod +x promcasa
```#### :page_facing_up: Configuration
**PromCasa** acts according to the query bucket parameters configured in `/etc/promcasa.json`
##### ▶️ Query Buckets
To provision and publish a new metrics bucket, extend the configuration with a query set:
```javascript
{
"_info": "Custom Metrics from Clickhouse",
"name": "my_status", // must be unique
"help": "My Status",
"query": "SELECT status, group, count(*) as counter FROM my_index FINAL PREWHERE (datetime >= toDateTime(now()-60)) AND (datetime < toDateTime(now()) ) group by status, group",
"labels": ["status","group"], // must match columns
"counter_name": "counter",
"refresh": "60s", // Refesh takes unit sign: (ns, ms, s, m, h)
"type":"gauge" // gauge, histogram, counter
}
```For a complete usage example, check out the [wiki](https://github.com/metrico/promcasa/wiki)
## License
©️ [qxip/metrico](https://metrico.in) Licensed under AGPLv3 as part of [qryn](https://qryn.dev)