go-graphite / graphite-clickhouse

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

Fixed incorrect finder behaviour with extra-prefix specified #243

Closed lexx-bright closed 6 months ago

lexx-bright commented 1 year ago
extra-prefix = "extra"

# curl -s 'http://127.0.0.1:19010/metrics/find?query=*' | jq .
[
  {
    "allowChildren": 1,
    "expandable": 1,
    "leaf": 0,
    "id": "extra",
    "text": "extra",
    "context": {}
  }
]

# curl -s 'http://127.0.0.1:19010/metrics/find?query=extra.*' | jq .
[
  {
    "allowChildren": 1,
    "expandable": 1,
    "leaf": 0,
    "id": "extra.carbon",
    "text": "carbon",
    "context": {}
  },
  {
    "allowChildren": 1,
    "expandable": 1,
    "leaf": 0,
    "id": "extra.extra",
    "text": "extra",
    "context": {}
  }
]

# curl -s 'http://127.0.0.1:19010/metrics/find?query=extra.extra.*' | jq .
[
  {
    "allowChildren": 1,
    "expandable": 1,
    "leaf": 0,
    "id": "extra.extra.extra",
    "text": "extra",
    "context": {}
  }
]

# curl -s 'http://127.0.0.1:19010/metrics/find?query=extra.notexits.*' | jq .
[
  {
    "allowChildren": 1,
    "expandable": 1,
    "leaf": 0,
    "id": "extra.notexits.extra",
    "text": "extra",
    "context": {}
  }
]
msaf1980 commented 9 months ago

Wha't about add integration tests ? For example see https://github.com/go-graphite/graphite-clickhouse/blob/master/tests/find_cache/test.toml