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:
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.
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!