-
Notifications
You must be signed in to change notification settings - Fork 14
feat: add inventory collectors #31
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
Conversation
|
@AP-Hunt, I just realized that the metrics for containers which are deleted still show up in Grafana. That's what the 'metric dropper' is for, right? |
|
I believe that's right, yes. @featheredtoast added that, but reading after reading it I've got the same conclusion. The metric dropper is, if I understand it right, there to stop reporting values things that no longer exist. It's probable though that Grafana is showing old labels because Prometheus is giving it metrics with that label because they exist within the time frame being queried. The metric dropper doesn't purge anything in Prometheus. |
|
Yeah - that's it exactly. For a concrete example, at 10am, report If the buffer is deleted or moved... we probably want to stop reporting that there is Prometheus itself doesn't drop any data, so if you check in at 11:30 and go "hey what are my buffers in the last two hours?" prometheus can still report "oh yes, there was 80 iron plates at some buffer at 0,0 then". Label queries are asking the above to give what's where. That's probably why Grafana still shows old labels. Hope that makes sense. |
|
Makes sense - and a good thing to know (and keep in mind) when working with Prometheus. Tried it out and it worked flawlessly. ATM I'm still messing around with machine and player inventories but I'll update the PRs soon™. |
|
Hi @AP-Hunt, |
|
I added one more change. Now storage containers and factory buildings use the "ID" field for the metric dropper, since I had problems with metrics not being dropped for buildings with near identical coordinates. Btw. before you merge this I would like to do a clean up of the commit history - I just dont want to rewrite the history during a review. |
|
Happy for you to rewrite history before merging 👍 Seems the tests aren't happy. I wonder if that's related to code that got merged in the intervening time? |
This commit adds collectors for the four inventory endpoints: /getCloudInv /getCrateInv /getStorageInv /getWorldInv
08979ad to
3299fff
Compare
|
Ok, I cleaned up the history and fixed the tests. Ready to merge if you are :) |
|
@AP-Hunt after merging you could also run the docker build pipeline to create the first image on ghcr.io (and check whether the pipeline actually works 😆 ) |
|
I shall merge now, test, and cut a release |
This PR adds collectors for the four inventory endpoints:
/getCloudInv/getCrateInv/getStorageInv/getWorldInvOpen tasks:
Consider using the/getResearchTreesendpoint to figure out the storage capacity of the dimensional depot and expose it as an additional metricConsider player inventories (Ficsit does not guarantee player privacy)Fixes #30