Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregation + group by on tagged custom counters don't seem to work properly #4100

Closed
trueneu opened this issue Dec 11, 2024 · 2 comments
Closed
Assignees

Comments

@trueneu
Copy link

trueneu commented Dec 11, 2024

Brief summary

The group by tags feature from Grafana Cloud doesn't seem to work if custom K6 counters are tagged (when using K6 as a datasource).

I'm not sure if the problem is on K6 side or Grafana Cloud side.

k6 version

0.55 with patch from #4050

OS

Ubuntu 22.04

Docker version and image (if applicable)

No response

Steps to reproduce the problem

  • Take this sample test:
import {Counter} from "k6/metrics";

const c = new Counter('test_counter');

export default () => {
    c.add(1, {mytag: "1"});
    c.add(1, {mytag: "2"});
};
  • Run it for 10 iterations
  • In Grafana Cloud, Explore the k6 datasource for the test metrics; metric is test_counter, aggregation is cumulative sum, with group by mytag

If I do not understand how the aggregation or grouping works, I apologize.

Expected behaviour

Both test_counter{mytag="1"} and test_counter{mytag="2"} have 10 as a value of cumulative sum. test_counter without grouping has 20 as a value.

Actual behaviour

Both test_counter{mytag="1"} and test_counter{mytag="2"} have 20 as a value of cumulative sum.

Image

If no grouping is applied, the value is still 20:

Image

This can be worked around with a tag filter, but this kinda defeats the idea of grouping:

Image
@mstoykov
Copy link
Contributor

Hi @trueneu, thanks for reporting this.

I tried to get this and while I did think I got it, it turned out that I had stacked lines on and that basically meants one of the dots was at 10 and the other at 20 (stacked on top of it). But the values were always 10, just the graph.

For the record I literally ran your script with k6 cloud -i 10 script.js and with k6 run -o cloud -i 10 script.js and both test worked as expected.

Given that I can't reproduce it and this seems to be a GCk6 thing - please contact support and they will be able to look at the exact test run you did.

I will close this for now, if it turns out it is a problem within k6 cli, please comment agani and we will reopen it.

@mstoykov mstoykov closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2024
@trueneu
Copy link
Author

trueneu commented Dec 12, 2024

Thank you @mstoykov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants