Plays videos using Prometheus, e.g. Bad Apple.
A while back I thought this blog post and the corresponding source code were kind of fun. After seeing some of kevinjycui's bad apple videos I thought combining these two ideas could be an interesting (and hilariously terrible) idea.
How to use
- Download a video e.g.
- Figure out the output resolution, you should scale 1:1 with height being the number of time series you want.
- Get a png sequence
ffmpeg -i bad_apple.mkv -vf "scale=180:135" -vsync 0 frames\out%06d.png
- If you would like to make sure that the y axis doesn't change, you can add 1px white bars to each frame. e.g.
go run main.go
- Loop over the files and send them to
promtool tsdb create-blocks-from openmetrics
docker compose up
- Wait for Prometheus to compact etc. so it doesn't take 20 years to render.
prom_record.ahkor some other script to record all the frames from the UI.
cdto wherever you stored your screenshots.
- Generate the video file
ffmpeg -framerate 30 -i '%06d.png' -c:v libx264 -pix_fmt yuv420p out.mp4