Skip to content

Commit d119ebb

Browse files
committed
add buckets setting
1 parent ef2b8ec commit d119ebb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

settings/dev.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
]
3737
LOG_FORMAT = "json"
3838
PROMETHEUS_HISTOGRAM_BUCKETS = prometheus_client.Histogram.DEFAULT_BUCKETS
39+
PROMETHEUS_HTTP_SERVER_RESPONSE_SIZE_HISTOGRAM_BUCKETS = PROMETHEUS_HISTOGRAM_BUCKETS
3940
ROOT_URLCONF = "common.core.urls"
4041
TIME_ZONE = "UTC"
4142
USE_TZ = True

src/common/gunicorn/metrics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import prometheus_client
2+
from django.conf import settings
23

34
from common.prometheus import Histogram
45

@@ -12,8 +13,9 @@
1213
"HTTP request duration in seconds",
1314
["route", "method", "response_status"],
1415
)
15-
flagsmith_http_server_response_size_bytes = prometheus_client.Histogram(
16+
flagsmith_http_server_response_size_bytes = Histogram(
1617
"flagsmith_http_server_response_size_bytes",
1718
"HTTP response size in bytes",
1819
["route", "method"],
20+
buckets=settings.PROMETHEUS_HTTP_SERVER_RESPONSE_SIZE_HISTOGRAM_BUCKETS,
1921
)

0 commit comments

Comments
 (0)