querybook
querybook copied to clipboard
feat: Added support for sending custom datadog metrics from querybook
This PR includes the setup of dogstatsd
, a python library used for sending metrics to Datadog as well as the creation of a new stats logger, DatadogStatsLogger
.
In addition, it includes 5 metrics: celery.active_workers
, celery.active_tasks
, task.received
, task.failures
, and task.successes
The first 2 metrics are sent to datadog every 5 seconds by opening a new thread which continuously runs the send_stats_logger_metrics
function. The other 3 metrics are triggered by event handlers so they are sent whenever a task is received by a worker, a task fails, or a task succeeds.
Datadog is now an optional dependency
@czgu can you help to look the PR again?