buildkit
buildkit copied to clipboard
cache: capture metrics related to cache records and pruning
Fixes #4401.
I guess this replaces https://github.com/moby/buildkit/pull/4464?
I wasn't aware of that PR but yes I think this would likely replace the need for that PR.
@crazy-max I took a look at it again and it seems that PR is trying to do something different. It seems like they're trying to find the information about a single build based on the progress writer and output that as JSON. This PR is more about the overall system itself. So this PR would capture how many times and how long we spent in pruning the cache and also would show how many cache entries there are.
@tonistiigi yes I think updating the docs would be helpful. I've also been considering adapting the local docker compose I use for development and adapting it to be a little more general just to help facilitate some workflows. I was thinking something like having the compose file launch buildkit while including configuration for the debugger, jaeger (for tracing), grafana (for viewing metrics), and then something to store the metrics outputs. If there's some interest there, I'll try some stuff out.
For the build resource metrics, I do think it likely makes sense to convert some of those to OTLP metrics or to have OTLP metrics be mimicked along with those. I think it might be worth discussing more of what this might look like as I'm not really sure what the best way is.
Converting this back to a draft for a little bit. I want to iterate on the format of the metric before this would get merged.