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

[Question] Deserialize metrics from the file #537

Open
zavodnyuk opened this issue Jan 29, 2023 · 2 comments
Open

[Question] Deserialize metrics from the file #537

zavodnyuk opened this issue Jan 29, 2023 · 2 comments

Comments

@zavodnyuk
Copy link

Hi, in my app I don't use any kind of DB, but I want to serialize metrics to the file using getMetricsAsJSON every minute or after each event. Then in case I need to release a new version or restart my app I want read data from the file and continue count metrics. I found that I can use registerMetric and pass instance of Counter/Gauge/etc class but not the data from the file right away. Any elegant way I can de-serialize data on restart? Or the only option I have is read from the file, loop through the data and create instances and push them to registerMetric?
Thank you

@zbjornson
Copy link
Collaborator

There's indeed no way to do this current, and it sounds out of scope. Does pushGateway + using rates instead of absolute counts address your use case?

@zavodnyuk
Copy link
Author

I decided to revamp my app and to add db as well. So no longer a case, thank you

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