You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Prometheus metrics for using_database_replica #98
As we're adding a fairly critical database utility in #95, we'd like to be able to effectively monitor its operation with Prometheus.
Implementation
Add the following counter:
flagsmith_db_selected_replica_count_total, labeled with result (success/failure) and replica_name.
Inside using_database_replica:
On each successful ensure_connection() call, increment the counter: flagsmith_db_selected_replica_count_total.labels(result="success", replica_name= chosen_replica).inc()
In each OperationalError exception handling branch, increment the counter: flagsmith_db_selected_replica_count_total.labels(result="failure", replica_name=attempted_replica).inc()
Check how existing metrics are used and defined by searching for an existing metric, e.g. flagsmith_task_processor_enqueued_tasks_total.
Activity