go-graphite / graphite-clickhouse

Graphite cluster backend with ClickHouse support
MIT License
213 stars 52 forks source link

Question: Skip Aggregation on the first retention policy #246

Closed ikosenn closed 11 months ago

ikosenn commented 11 months ago

Does it make sense to skip aggregation on the first retention policy to closely match what graphite-whisper does. In my case I have the following retention policy

<graphite_rollup>
    <pattern>
        <regexp>^metric\.</regexp>
        <function>avg</function>
        <retention>
            <age>0</age>
            <precision>60</precision>
        </retention>
        <retention>
            <age>3456000</age>
            <precision>300</precision>
        </retention>
        <retention>
            <age>8640000</age>
            <precision>1800</precision>
        </retention>
    </pattern>
</graphite_rollup>

The service that sends metrics sends a single point every minute. If I use the rollup config above on graphite-clickhouse it performs an avgResample on the first bucket with age=0. This causes some points to be displayed as fractions instead of whole numbers. Does it make sense to disable aggregation on the first retention policy or use anyResample regardless of what the rollup function is?

ikosenn commented 11 months ago

This was filled erroneously. After a little more digging I found the graphite rollup wasn't being applied due to missing database name in the data_table configuration