From 5a9e0625b08a6b6b922caf9638f1cbb4214e9101 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 6 Oct 2022 10:59:53 -0400 Subject: [PATCH] semgrep: add MeasureSinceWithLabels to FSM time rule (#14812) Metrics state is local to the server and needs to use time, which is normally forbidden in the FSM code. We have a bypass for this rule for `metrics.MeasureSince` but needed one for `metrics.MeasureSinceWithLabels` as well. --- .semgrep/fsm_time.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.semgrep/fsm_time.yml b/.semgrep/fsm_time.yml index 7e520f5b6..4c2e34daf 100644 --- a/.semgrep/fsm_time.yml +++ b/.semgrep/fsm_time.yml @@ -7,6 +7,10 @@ rules: - pattern-not-inside: | defer metrics.MeasureSince(...) + # Metric state is local to the server and therefore must use time. + - pattern-not-inside: | + defer metrics.MeasureSinceWithLabels(...) + # The timetable's whole point is to roughly track timestamps for Raft log # indexes, so it must use time. - pattern-not-inside: |