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

k6_http_req_failed is always 1 #77

Closed
Limess opened this issue Dec 2, 2022 · 2 comments
Closed

k6_http_req_failed is always 1 #77

Limess opened this issue Dec 2, 2022 · 2 comments

Comments

@Limess
Copy link

Limess commented Dec 2, 2022

The metric k6_http_req_failed is always 1, rather than a counter, so we can't see a count via increase or rate.

There's a good chance I've misunderstood this metric - is it supposed to be a gauge indicating a scenario failure? Should we add our own error rate metric?

image

Build command:

go install go.k6.io/xk6/cmd/xk6@latest
xk6 build \
    --with github.com/grafana/xk6-output-prometheus-remote@latest

Version:

xk6-output-prometheus-remote 0.06

go: downloading go.k6.io/k6 v0.41.1-0.20221116104224-5fa71b761185
@codebien
Copy link
Contributor

codebien commented Dec 3, 2022

Hi @Limess,
yes, a k6's rate like k6_http_req_failed is mapped to a gauge and, in this case, it is always expected to be one because you have expected_response, error_code and status tags that generate individual time series. You should aggregate them to get a unique representation.

For example, for average, you could use:

sum(sum_over_time(k6_http_req_failed_rate[1m])) by (name)
/
sum(count_over_time(k6_http_req_failed_rate[1m])) by (name)

Instead, if you don't care about these tags, you could disable them using the k6 option systemTags.

v0.0.7 is out, it has important updates. Please, upgrade.

@Limess
Copy link
Author

Limess commented Dec 4, 2022

Thanks, will close this.

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

No branches or pull requests

2 participants