Grafana Dashbaord Row Variable Reference

  • What Grafana version and what operating system are you using?
    Grafana v10.4.18

  • What are you trying to achieve?
    I have panels that show response times for each endpoint in my k6 test. The way my test is setup is each scenario has a serviceName tag. That is essentially the name of the overall app endpoints im testing. Then each http request made inside that scenario has a serviceEndpoint tag which references the name of the endpoint that I am testing inside the service name. I am trying to setup my grafana dashboard so that I can select any number of service names and then it will create a new row for each service name selected and then inside each row hav a new panel created for each serice endpoint inside that rows serviceName.

  • How are you trying to achieve it?
    To try and achieve this I have my rows set to repeat for every serviceName and then I have panels set to repeat for each serviceEndpoint. This works when there is only one ServiceName selected however when more than one name gets selected the panels break because since in my query I am using serviceEndpoint, that variable is no longer a single variable so the panels switch to “all” instead of the serviceendpoint they were originally for. Example image shows when one serviceName is selected vs when multiple serviceNames are selected


  • What happened?
    The panels did not reference the row name and instead are referencing the overall service name causing them to not duplicate correctly

  • What did you expect to happen?
    I expected the panels to reference the specific rows service name and create the panels inside the row based on that

  • Can you copy/paste the configuration(s) that you are having problems with?
    Panel Query
    from(bucket: “k6_metrics”)
    |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
    |> filter(fn: (r) => r[“envName”] =~ /${envName:regex}$/)
    |> filter(fn: (r) => r[“serviceName”] =~ /${serviceName:regex}$/)
    |> filter(fn: (r) => r[“serviceEndpoint”] == “${serviceEndpoint}”)
    |> filter(fn: (r) => r[“_measurement”] == “http_req_duration”)
    |> filter(fn: (r) => r.status =~ /204|200/)
    |> filter(fn: (r) => r[“_field”] == “value”)

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No :frowning:

  • Did you follow any online instructions? If so, what is the URL?
    Nothing I could find was similiar to this issue. I essentially need a variable name I can use that references the row name

Could this be the issue?


|> filter(fn: (r) => r[“serviceEndpoint”] == “${serviceEndpoint}”)

should it also be something like this?

|> filter(fn: (r) => r[“serviceEndpoint”] =~ /${serviceEndpoint:regex}$/)