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

prometheus_client.generate_latest() #986

Open
GeluConstantin opened this issue Dec 12, 2023 · 1 comment
Open

prometheus_client.generate_latest() #986

GeluConstantin opened this issue Dec 12, 2023 · 1 comment

Comments

@GeluConstantin
Copy link

Hi,

I use this method in combination with fastAPI in order to expose metrics over the API. The data come from a JSON file saved on Linux system (where the service runs).

When changing the values in the file in order to create metrics the metric value does not change, only when restarting the web server (Uvicorn).

Why are the changed values not recalculated?

For opening the file I use the standard command with open('filename.json', mode = 'r') as f:

Thank you in advance for the feedback!

@csmarchbanks
Copy link
Member

Would you be able to provide more details? If you are not re-reading (and possibly re-opening) the file on each request I can imagine the file in the Python process not being updated.

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

No branches or pull requests

2 participants