Skip to content

Commit 04e3577

Browse files
committed
standardise
1 parent e9f91fe commit 04e3577

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ The following default metrics are exposed:
7676

7777
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.
7878

79+
As a reasonable default, Flagsmith metrics are expected to be namespaced with the `"flagsmith_"` prefix.
80+
7981
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.
8082

8183
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
8486
import prometheus_client
8587
from django.conf import settings
8688

87-
distance_from_earth_au = prometheus.Histogram(
88-
"distance_from_earth_au",
89+
flagsmith_distance_from_earth_au = prometheus.Histogram(
90+
"flagsmith_distance_from_earth_au",
8991
"Distance from Earth in astronomical units",
9092
buckets=settings.DISTANCE_FROM_EARTH_AU_HISTOGRAM_BUCKETS,
9193
)

0 commit comments

Comments
 (0)