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.
This commit is contained in:
Tim Gross
2022-10-06 10:59:53 -04:00
committed by GitHub
parent a0b9af4165
commit 5a9e0625b0

View File

@@ -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: |