This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
forked from captncraig/caddy-stats
-
Notifications
You must be signed in to change notification settings - Fork 26
429 status not reported from ratelimit middleware #29
Comments
Are you running that code as middleware in Caddy?
Can you test some some, i.e. does printing the status also say 429?
|
Yup, printing status comes back 429. |
Is it possible that the middleware chain was short circuited by the rate limit hit and prometheus plugin never gets called? |
[ Quoting <[email protected]> in "Re: [miekg/caddy-prometheus] 429 st..." ]
Is it possible that the middleware chain was short circuited by the rate limit hit and prometheus plugin never gets called?
depends on the order of our middleware... I've put this one first.
caddyhttp/httpserver/plugin.go seems to have it, using the default, will not
make it work, as "prometheus" is defined near the end.
|
Just to confirm, prometheus should be first? |
Yes. Early enough to catch all your middleware
…On Aug 1, 2017 4:58 PM, "Bob Aman" ***@***.***> wrote:
Just to confirm, prometheus *should* be first?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAVkW089ToajcJjnf4a-3LdJEelP2zbqks5sT0sVgaJpZM4OpEO0>
.
|
I have a similar issue with 304s. I've tried having prometheus as the first line for the servers to no avail. |
Hello, I have the same issue too. What about doing a PR on caddy to move |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The https://github.com/xuqingfeng/caddy-rate-limit plugin sends 429 responses when rate limits are hit, but as best as I can tell, the prometheus plugin doesn't report them. The middleware return value is here: https://github.com/xuqingfeng/caddy-rate-limit/blob/master/ratelimit.go#L84
And it seems like https://github.com/miekg/caddy-prometheus/blob/master/handler.go#L25-L35 ought to handle it correctly, but for reasons unknown, no "429" appears anywhere in our metrics even though they do appear in our logs and we've been able to successfully trigger them manually and observe that there is indeed a 429 response coming across the wire.
The text was updated successfully, but these errors were encountered: