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
Copy file name to clipboardExpand all lines: README.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,19 +63,21 @@ The following default metrics are exposed:
63
63
##### Common metrics
64
64
65
65
-`flagsmith_build_info`: Has the labels `version` and `ci_commit_sha`.
66
-
-`http_server_request_duration_seconds`: Histogram labeled with `method`, `route`, and `response_status`.
67
-
-`http_server_requests_total`: Counter labeled with `method`, `route`, and `response_status`.
68
-
-`task_processor_enqueued_tasks_total`: Counter labeled with `task_identifier`.
66
+
-`flagsmith_http_server_request_duration_seconds`: Histogram labeled with `method`, `route`, and `response_status`.
67
+
-`flagsmith_http_server_requests_total`: Counter labeled with `method`, `route`, and `response_status`.
68
+
-`flagsmith_task_processor_enqueued_tasks_total`: Counter labeled with `task_identifier`.
69
69
70
70
##### Task Processor metrics
71
71
72
-
-`task_processor_finished_tasks_total`: Counter labeled with `task_identifier` and `result` (`"success"`, `"failure"`).
73
-
-`task_processor_task_duration_seconds`: Histogram labeled with `task_identifier` and `result` (`"success"`, `"failure"`).
72
+
-`flagsmith_task_processor_finished_tasks_total`: Counter labeled with `task_identifier` and `result` (`"success"`, `"failure"`).
73
+
-`flagsmith_task_processor_task_duration_seconds`: Histogram labeled with `task_identifier` and `result` (`"success"`, `"failure"`).
74
74
75
75
##### Guidelines
76
76
77
77
Try to come up with meaningful metrics to cover your feature with when developing it. Refer to [Prometheus best practices][1] when naming your metric and labels.
78
78
79
+
As a reasonable default, Flagsmith metrics are expected to be namespaced with the `"flagsmith_"` prefix.
80
+
79
81
Define your metrics in a `metrics.py` module of your Django application — see [example][2]. Contrary to Prometheus Python client examples and documentation, please name a metric variable exactly as your metric name.
80
82
81
83
It's generally a good idea to allow users to define histogram buckets of their own. Flagsmith accepts a `PROMETHEUS_HISTOGRAM_BUCKETS` setting so users can customise their buckets. To honour the setting, use the `common.prometheus.Histogram` class when defining your histograms. When using `prometheus_client.Histogram` directly, please expose a dedicated setting like so:
@@ -84,8 +86,8 @@ It's generally a good idea to allow users to define histogram buckets of their o
0 commit comments