Skip to content

chore(metrics): Add all possible attributes to searched metrics names response

Ankit Bhatnagar requested to merge abhatnagar/metricnames-all-attributes into main

backend changes for #2781 (closed)

Like warranted by the aforementioned issue, when searching for metric-names with filters used as well, the UI still needs access to all possible attributes for the given project to be able to continue searching for necessary metrics from there instead of having to back out all filters and start afresh. This MR does the necessary and adds a list of all possible attributes to the metrics names search response.

Tested on a dev-cluster with:

➜  ~  curl --silent "http://localhost:8082/v3/query/51792562/metrics/autocomplete?search=runtime.uptime" | jq .
{
  "metrics": [
    {
      "name": "runtime.uptime",
      "description": "Milliseconds since application was initialized",
      "attributes": [],
      "type": "Sum",
      "last_ingested_at": 1715584096717187950
    }
  ],
  "all_available_attributes": [
    "action",
    "app.ads.ad_request_type",
    "app.ads.ad_response_type",
    "app.payment.currency",
    "client-id",
    "count",
    "cpu",
    "currency_code",
    "daemon",
    "device",
    "direction",
    "dropped",
    "error.message",
    "family",
    "foo",
    "gc",
    "generation",
    "http.flavor",
    "http.host",
    "http.method",
    "http.route",
    "http.scheme",
    "http.status_class",
    "http.status_code",
    "http.url",
    "method",
    "net.host.name",
    "net.host.port",
    "net.peer.name",
    "net.peer.port",
    "node-id",
    "operation",
    "partition",
    "pool",
    "processor",
    "processorType",
    "protocol",
    "recommendation.type",
    "rpc.grpc.status_code",
    "rpc.method",
    "rpc.service",
    "rpc.system",
    "service.name",
    "span.kind",
    "span.name",
    "state",
    "status",
    "status.code",
    "success",
    "target",
    "topic",
    "type"
  ]
}
Edited by Daniele Rossetti

Merge request reports