Skip to content

chore(metrics): Add ability to free-text search for metric names

Ankit Bhatnagar requested to merge abhatnagar/metricnames-search into main

Related #2708 (closed)

This MR adds the support for searching free-text within metric names on the /autocomplete API, as warranted by the aforementioned issue.

Tested on a dev-cluster with:

➜  ~ curl --silent "http://localhost:8082/v3/query/51792562/metrics/autocomplete?limit=100&search=cpu" | jq -r '.metrics[].name'
process.runtime.cpython.cpu_time
process.runtime.jvm.cpu.utilization
process.runtime.jvm.system.cpu.load_1m
process.runtime.jvm.system.cpu.utilization
system.cpu.time
system.cpu.utilization

➜  ~ curl --silent "http://localhost:8082/v3/query/51792562/metrics/autocomplete?limit=100&search=network" | jq -r '.metrics[].name'
kafka.consumer.network_io_rate
kafka.consumer.network_io_total
kafka.network.io
system.network.connections
system.network.dropped_packets
system.network.errors
system.network.io
system.network.packets

➜  ~ curl --silent "http://localhost:8082/v3/query/51792562/metrics/autocomplete?limit=100&search=network&starts_with=kafka" | jq -r '.metrics[].name'
kafka.consumer.network_io_rate
kafka.consumer.network_io_total
kafka.network.io
Edited by Ankit Bhatnagar

Merge request reports