An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# carbon-schema-to-clickhouse [![Build Status](https://api.travis-ci.org/bzed/carbon-schema-to-clickhouse.svg?branch=master)](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.