https://github.com/bzed/carbon-schema-to-clickhouse
Converts storage-schema.conf from graphite/carbon to clickhouse graphite_rollup XML
https://github.com/bzed/carbon-schema-to-clickhouse
carbon-clickhouse clickhouse graphite graphite-carbon
Last synced: 4 months ago
JSON representation
Converts storage-schema.conf from graphite/carbon to clickhouse graphite_rollup XML
- Host: GitHub
- URL: https://github.com/bzed/carbon-schema-to-clickhouse
- Owner: bzed
- License: mit
- Created: 2017-03-24T15:22:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-24T16:12:23.000Z (about 9 years ago)
- Last Synced: 2025-10-12T11:28:01.283Z (8 months ago)
- Topics: carbon-clickhouse, clickhouse, graphite, graphite-carbon
- Language: Go
- Size: 5.86 KB
- Stars: 15
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# carbon-schema-to-clickhouse [](https://travis-ci.org/bzed/carbon-schema-to-clickhouse/)
Converts storage-schema.conf from graphite/carbon to clickhouse graphite_rollup XML
Migrating our `storage-schemas.conf` from an older graphite implementation to
the XML snippet needed for [ClickHouse](https://github.com/yandex/ClickHouse)
would have needed much more time than hacking this small piece of go code.
## Usage:
```
% cat storage-schemas-example.conf [carbon]
pattern = ^carbon\.
retentions = 60:90d,60m:120d,360m:400d,720m:2y,1d:3y,7d:10y
[collectd]
pattern = ^collectd\..*
retentions = 10s:12h,1m:10d,15m:20d,30m:40d,60m:120d,360m:400d,720m:2y,1d:3y,7d:10y
[netapp.capacity]
pattern = ^netapp\.capacity\.*
retentions = 15m:100d, 1d:5y
[default]
pattern = .*
retentions = 1m:10d,15m:20d,30m:40d,60m:120d,360m:400d,720m:2y,1d:3y,7d:10y
```
```
% ./carbon-schema-to-clickhouse -h
Usage of ./carbon-schema-to-clickhouse:
-rollupfunction string
clickhouse rollup function (default "any")
-schemafile string
storage schema file to convert (default "/etc/carbon/storage-schemas.conf")
```
```
% ./carbon-schema-to-clickhouse -schemafile storage-schemas-example.conf -rollupfunction avg
^carbon\.
avg
0
60
7776000
3600
10368000
21600
34560000
43200
63072000
86400
94608000
604800
^collectd\..*
avg
0
10
43200
60
864000
900
1728000
1800
3456000
3600
10368000
21600
34560000
43200
63072000
86400
94608000
604800
^netapp\.capacity\.*
avg
0
900
8640000
86400
avg
0
60
864000
900
1728000
1800
3456000
3600
10368000
21600
34560000
43200
63072000
86400
94608000
604800
```
## Thanks
Thanks to Roman Lomonosov for his [go-carbon](https://github.com/lomik/go-carbon) code - I'm reusing the storage schema parser here.