grafana / k6

A modern load testing tool, using Go and JavaScript - https://k6.io
GNU Affero General Public License v3.0
24.93k stars 1.23k forks source link

Include group in check metrics #2980

Closed michael-sw-id closed 1 week ago

michael-sw-id commented 1 year ago

Feature Description

Currently metrics for checks are generated as k6.check.expected_Expect_HttpStatus_to_equal_201.pass

It would be great if metrics include the group e.g.

k6.check.group_create_customer.expected_Expect_HttpStatus_to_equal_201.pass

Ideally should also support nested groups e.g.

Suggested Solution (optional)

Given this is a breaking change for existing dashboards or consumers of these metrics, would probably need to put it behind some feature flag/configuration.

Already existing or connected issues / PRs (optional)

No response

imiric commented 1 year ago

Hi there, thanks for opening this issue.

Judging by the metric name, I assume you're using the statsd output, right? Are you sending metrics to Datadog or New Relic?

While this seems like a useful suggestion, it needs some evaluation, so we're unlikely to implement it anytime soon.

For one, it would be a breaking change for users who don't expect to have group names in check metrics. This could be mitigated by making the behavior optional, but we wouldn't want to complicate the configuration any further.

Also, we're currently evaluating the status and future of StatsD outputs, and we might decide to make individual backend extensions, or deprecate support for it altogether. Since it's in a state of flux, it's unlikely we'll make any changes to it while it remains part of k6.

So we'll keep this issue open and look into it, but no guarantees it will be implemented.

michael-sw-id commented 1 year ago

yep, statsd with datadog

nilesh05apr commented 1 year ago

Hi @imiric can i try this?

To implement this change, we can introduce a new configuration option in k6 that enables this feature. For example, we can add a flag like --enable-check-groups that would modify the metric names to include the group information.

I am not sure about the nested subgroups right now. But we can proceed similarly for them as well. Please let me know what are your thoughts on this.

imiric commented 1 year ago

@nilesh05apr Thanks for offering to help, and feel free to work on it in your k6 fork, but we're not likely to merge any changes to the statsd output because of what I mentioned above. Adding a new CLI flag would also be problematic because of #883.

LeonAdato commented 1 week ago

Per @olegbespalov and @javaducky, this issue should probably be part of the StatsD project. Feel free to transfer it here:

https://github.com/LeonAdato/xk6-output-statsd

olegbespalov commented 1 week ago

Closing in favor of https://github.com/LeonAdato/xk6-output-statsd/issues/23