Open discordianfish opened 1 year ago
Restarting the app helped, so maybe it only detects the unapplied migrations once and doesn't reset the value when you run the migrations?
I'd suggest turning
into a custom collector as documented here: https://github.com/prometheus/client_python#custom-collectors
In collect
it would execute the same as in ExportMigrationsForDatabase and return a GaugeMetricFamily directly. That would cause it to get the unapplied migrations on every scrape. I'm not entirely sure about the costs associated but this is what you'd do in general for such use cases.
Alternatively maybe this could be implemented as a mixin but dunno if there is a way to hook that up to the django in a way similar like you do with the models..
Hi,
django_migrations_unapplied_total is 1 even after we applied the migration: