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

/metrics server not working #201

Closed
1 task done
mogoman opened this issue Aug 6, 2020 · 5 comments
Closed
1 task done

/metrics server not working #201

mogoman opened this issue Aug 6, 2020 · 5 comments
Assignees
Labels

Comments

@mogoman
Copy link

mogoman commented Aug 6, 2020

#71 # Prerequisites

Description

-m or --enablemetrics or PROM2TEAMS_PROMETHEUS_METRICS=true all appear to have no effect

Steps to Reproduce

v2.5.7
1.

docker run -it -d --rm --name prom2teams -e PROM2TEAMS_LOGLEVEL=DEBUG -e PROM2TEAMS_GROUP_ALERTS_BY="summary" -e PROM2TEAMS_CONNECTOR="https://foo.bar" -e PROM2TEAMS_PROMETHEUS_METRICS=true -p 8089:8089 idealista/prom2teams:2.5.7

curl localhost:8089/metrics

<title>404 Not Found</title>

same for 2.5.6, 2.5.5 and 2.4.0

Expected behavior: [What you expect to happen]

curl to /metrics should produce some data and not 404

Actual behavior: [What actually happens]

receive 404

Reproduces how often: [What percentage of the time does it reproduce?]

100%

Versions

2.5.7, 2.5.6, 2.5.5, 2.4.0 were tested

Additional Information

none

@rdoering
Copy link

This a problem for me, too.

@mogoman Dit you found a working version?

@mogoman
Copy link
Author

mogoman commented Aug 12, 2020

No solution yet. Looking at the code it should work, I'll try and track down the problem.

@rdoering
Copy link

I tried to debug the problem, too. But it is very bad to use pdb with just little knowledge of python.

@vicsufer
Copy link
Collaborator

Hey there @rdoering @mogoman, can you try setting the environment variable DEBUG_METRICS=true ?

It seems to be a problem with an imported library when running flask on debug mode. However this seems to happen in prom2teams even in production mode, I'll have a look into this, but this workaround should work for now.

In your example it should be something like this:

docker run -it -d --rm --name prom2teams -e PROM2TEAMS_LOGLEVEL=DEBUG -e PROM2TEAMS_GROUP_ALERTS_BY="summary" -e PROM2TEAMS_CONNECTOR="https://foo.bar" -e PROM2TEAMS_PROMETHEUS_METRICS=true -e DEBUG_METRICS=true -p 8089:8089 idealista/prom2teams:2.5.7

@rdoering
Copy link

@vicfran Thanks for your workaround, it is working with the env DEBUG_METRICS=true.

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

No branches or pull requests

3 participants