Grafana dashboard for filtering k6 result by test case

Hi,
How do I add custom measurements to InfluxDB to be able to create filter based on tags on Grafana side to filter k6 test result based on test case? I am using the dashboard shared in the documentation. It works fine with single test case. However, if I have results from multiple test cases, how do I filter them out as I don’t find a measurement that I can use as filter in the default output to InfluxDB as below:
image

Hi Zhang,

I’ve been speaking with you over email but figured I’d contribute here for the sake of informing the community (and @oleiade!) :slight_smile:

The pre-configured dashboard I believe you are using that we also show a screenshot of in the blog article, is not capable of filtering metrics by a given test. This is likely because we don’t emit any kind of test identifier tags/fields (or whatever InfluxDB calls it!) by default.

One way to achieve this would be to:

  1. Set a test-wide tag, e.g. called testName where you can set a user-friendly name for the test
  2. Create a “Query” Dashboard Variable on the Grafana side that returns a list of all of the testName values (i.e. show tag values from http_reqs with key="testName")
  3. Update the panels so that the WHERE clauses filter by the testName variable

I’ve now done this but unfortunately I can’t upload the dashboard JSON here, and it is too big to include in a forum post. I’ll see if we can change our forum to accept JSON file uploads.

Here is the dashboard JSON. Note that this is for InfluxDB v1.
dashboard-influxdbv1.json (42.2 KB)