-
Notifications
You must be signed in to change notification settings - Fork 1
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
back to GunicornPrometheusMetrics, CollectorRegistry, port 9200 #244
back to GunicornPrometheusMetrics, CollectorRegistry, port 9200 #244
Conversation
|
will need this too https://gitlab.met.no/tjenester/s-enda/-/merge_requests/2930 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. And merged. Le'ts hope this works now.
If not, I bet the issue is related to the wsgi.py
file. Since the gunicorn process loads wsgi:app
then in the wsgi.py
file, I am not sure if the lines after app = App()
is then loaded by gunicorn.
Also in the statefulset.yml
for dmci in the tjenester-repo. The gunicorn command from the Dockerfile is overrided, so you will probably need to add the -c /src/gunicorn_prometheus_config.py
to the command:
for the dmci container in the statefulset.yml
too. And make sure the 9200 is exposded and scraped
we got the flask metrics exposed correctly at the 9200 port tho initially, before I implemente the custom ones, so I think that the GunicornPrometheusMetrics() or variants of it in wsgi.py works, but the problem is having both those default ones and the custom one exposed at the same port and by the same collector |
mmh |
yeah. you probably not need this copy statement. and then the gunicorn command should work with:
Also I see no problem with our custom metrics (the failed dist) you implemented is exposed on different port than the other prometheus flask metrics. You can have multiple annotations for scraping in kubernetes I imagine. |
Also for the 9200 Port, you will probably have to add a special ingress in the ingress.yml in the dmci base folder.
|
the exposure of 9200 in the statefulset is already there, I had added it, removed it and added it back after last update |
gunicorn_prometheus_config.py is indeed in the root folder of the container so as you say we can skip the copy to src step |
w̶h̶i̶l̶e̶ ̶l̶o̶o̶k̶i̶n̶g̶ ̶a̶t̶ ̶t̶h̶e̶ ̶f̶e̶d̶e̶r̶a̶t̶e̶d̶ ̶m̶e̶t̶r̶i̶c̶s̶ ̶I̶ ̶s̶e̶e̶ ̶s̶o̶m̶e̶ ̶i̶n̶c̶o̶n̶s̶i̶s̶t̶e̶n̶c̶i̶e̶s̶.̶.̶ ̶I̶ ̶f̶e̶a̶r̶ ̶t̶h̶e̶ ̶e̶x̶p̶o̶s̶u̶r̶e̶ ̶m̶i̶g̶h̶t̶ ̶h̶a̶p̶p̶e̶n̶ ̶o̶n̶ ̶o̶n̶e̶ ̶i̶n̶s̶t̶a̶n̶c̶e̶ ̶o̶n̶l̶y̶ ̶:̶/̶ |
Summary: this again for me exposes all the metrics at port 9200 when I run the container with docker....
Related issue: #220
Suggested reviewer(s):
Reviewer checklist:
The checklist is based on the S-ENDA conventions and definition of done (see General Conventions). The above points are not necessarily relevant to all contributions. In that case, please add a short explanation to help the reviewer.