buildkit icon indicating copy to clipboard operation
buildkit copied to clipboard

cache: capture metrics related to cache records and pruning

Open jsternberg opened this issue 8 months ago • 5 comments

Fixes #4401.

jsternberg avatar Dec 08 '23 16:12 jsternberg

I guess this replaces https://github.com/moby/buildkit/pull/4464?

crazy-max avatar Dec 08 '23 17:12 crazy-max

I wasn't aware of that PR but yes I think this would likely replace the need for that PR.

jsternberg avatar Dec 08 '23 17:12 jsternberg

@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.

jsternberg avatar Dec 08 '23 19:12 jsternberg

@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.

jsternberg avatar Dec 27 '23 20:12 jsternberg

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.

jsternberg avatar Jan 04 '24 21:01 jsternberg