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
Unable to authenticate with the /v1/metrics
endpoint
#1937
Comments
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏 |
Hello @radeklat, I'm facing exactly the same issue. I fiddled in the same way, without any success. Did you find any way around that to make it work in the end? |
@e7d Unfortunately I didn't :( I'm not collecting any metrics at the moment. |
Describe the bug
I am trying to configure
prometheus
2.45.3 to scrape metrics made available fromwatchtower
from the/v1/metrics
endpoint. I ran into a dead end whenprometheus
keeps getting a 401 Unauthorized HTTP error.Steps to reproduce
prometheus
andwatchtower
from docker-composewatchtower
target to fail with a 401 HTTP errorExpected behavior
No authorization error, metrics are scraped.
Screenshots
No response
Environment
Your logs
Additional context
I used the guide from https://containrrr.dev/watchtower/metrics/ to configure both
watchtower
andprometheus
. However, it seems thatbearer_token: demo_token
is no longer supported in the latest LTS version ofprometheus
(2.45). I couldn't find any documentation of it. What is documented instead is:(Note that I'm using and actual long random alphanum string, not
demo_token
.)I checked what
prometheus
actually sends as header with this configuration and it isauthorization: Bearer demo_token
. So that seem correct. I usedwget
from theprometheus
container to simulate a request towatchtower
with the same header:and get the data back successfully. So I don't understand where this authorization error comes from. I tried to increase logging to trace level but I'm not seeing anything after start up.
Is there anything else I can try to see why the authorization fails? It would be great if I could disable the authorization althogether. Both
prometheus
andwatchtower
run on the same internal docker network, so the 8080 port doesn't even have to be exposed to the internet.Here's how I'm running
watchtower
from docker-compose:And here is the
prometheus
config:The text was updated successfully, but these errors were encountered: