brutasse / graphite-cyanite

A plugin for using graphite-web with the cassandra-based Cyanite storage backend.
BSD 3-Clause "New" or "Revised" License
85 stars 21 forks source link

Get proper one leaf node instead of getting all of them #24

Open pawellesniewski opened 7 years ago

pawellesniewski commented 7 years ago

This is because Cyanite API adds additional metric data like: max, min, sum and mean. You can access them by adding appropriate suffix to metric name, e.g. "my.sample.metric_mean". By default graphite-cyanite gets last of them which is "sum".

http://cyanite.localdomain/paths?query=my.sample.metric

returns:

[

    {
        "text": "metric",
        "id": "my.sample.metric",
        "path": "my.sample.metric",
        "allowChildren": false,
        "expandable": false,
        "leaf": true
    },
    {
        "text": "metric_min",
        "id": "my.sample.metric",
        "path": "my.sample.metric_min",
        "allowChildren": false,
        "expandable": false,
        "leaf": true
    },
    {
        "text": "metric_max",
        "id": "my.sample.metric",
        "path": "my.sample.metric_max",
        "allowChildren": false,
        "expandable": false,
        "leaf": true
    },
    {
        "text": "metric_mean",
        "id": "my.sample.metric",
        "path": "my.sample.metric_mean",
        "allowChildren": false,
        "expandable": false,
        "leaf": true
    },
    {
        "text": "metric_sum",
        "id": "my.sample.metric",
        "path": "my.sample.metric_sum",
        "allowChildren": false,
        "expandable": false,
        "leaf": true
    }

]

So graphite-cyanite is accessing "my.sample.metric_sum".