but I’m getting errors like time="2023-07-10T20:53:18Z" level=error msg="Failed to send the time series data to the endpoint" error="got status code: 429 instead expected a 2xx successful status code" output="Prometheus remote write"
any idea what i’m doing wrong?
A 429 status code means too many requests and it tells that the Prometheus instance is hitting the limits and is pushing back not accepting these write requests.
I discussed this topic internally with the k6 developer team and, at this point, we do not think it’s related to the operator since you are using parallelism of 1.
Can you share a bit more information so we can further dig into this?
Is it possible to see a (sanitized) version of the test.js script? We’re especially interested in things that generate metrics like “custom metrics”, requests, etc.
We can then check how many requests you are pushing and how many time series are generating. To see if there are any improvements we can suggest.
If we don’t see anything in the script that can be improved, it might be time to look at the Prometheus side.
Is this a Prometheus instance used only for k6 or other services (not k6)?
Are you testing this solely with Grafana Cloud, or is a local Prometheus instance also causing the same issues?
Can you tell us what version of k6 you are running, is it one of the latest?
This issue is very interesting, as it might lead to considering implementing a retry mechanism for the 429 errors, for temporary situations/ traffic spikes on the Prometheus side. However, it’s best to initially look into the root cause and take it from there.
the Promoetheus instance I’m writing to is the prometheus instance from my free Grafana cloud account. I’m using an image I built using the following docker since I needed to have the browser also installed:
# Build the k6 binary with the extension
FROM golang:1.19-bullseye as builder
RUN go install go.k6.io/xk6/cmd/xk6@latest
RUN xk6 build --output /k6 --with github.com/grafana/xk6-output-prometheus-remote@latest \
--with github.com/grafana/xk6-browser
FROM debian:bullseye
RUN apt-get update && \
apt-get install -y chromium
COPY --from=builder /k6 /usr/bin/k6
USER root
ENV K6_BROWSER_ENABLED=true
ENTRYPOINT ["k6"]
if there’s any issue with that then also please do let me know.