Add metrics for request/task counting

This commit is contained in:
Raphael Michel
2017-03-25 21:17:12 +01:00
parent c932892dbd
commit e0e3a72268
5 changed files with 57 additions and 3 deletions

View File

@@ -146,5 +146,7 @@ def metric_values():
"""
Provided metrics
"""
http_requests_total = Counter("http_requests_total", "Total number of HTTP requests made.", ["code", "handler", "method"])
# usage: http_requests_total.inc(code="200", handler="/foo", method="GET")
http_view_requests = Counter("http_view_requests", "Total number of HTTP requests made.",
["status_code", "method", "url_name"])
celery_task_runs = Counter("celery_task_runs", "Total calls to a celery task",
["task_name", "status"])