Skip to content

Commit af242bf

Browse files
authored
chore(metrics): don't write the histogram timing metrics (#7616)
This PR switches the default timing metric type to datadog histograms. A runtime config is used to switch off the writing of old histogram metrics (which are written to veneur)
1 parent 8c3d2d9 commit af242bf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

snuba/utils/metrics/backends/dualwrite.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ def _use_sentry(self) -> bool:
2929
return bool(random.random() < settings.DDM_METRICS_SAMPLE_RATE)
3030
return False
3131

32-
def _write_timings_as_distributions(self) -> bool:
32+
def _write_timings_as_histograms(self) -> bool:
3333
from snuba import state
3434

35-
return str(state.get_config("write_timings_as_distributions", "0")) == "1"
35+
return str(state.get_config("write_timings_as_histograms", "1")) == "1"
3636

3737
def increment(
3838
self,
@@ -67,11 +67,11 @@ def timing(
6767
# would then calculate percentiles. datadog now supports direct aggregations of percentiles
6868
# we keep the veneur timing metric to maintain historical data, this should be removed by
6969
# 02/15/2026 once we have enough historical data already
70-
self.datadog.timing(name, value, tags, unit)
70+
self.datadog.distribution(f"{name}.distribution", value, tags, unit)
71+
if self._write_timings_as_histograms():
72+
self.datadog.timing(name, value, tags, unit)
7173
if self._use_sentry():
7274
self.sentry.timing(name, value, tags, unit)
73-
if self._write_timings_as_distributions():
74-
self.datadog.distribution(f"{name}.distribution", value, tags, unit)
7575

7676
def distribution(
7777
self,

0 commit comments

Comments
 (0)