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 0187240e7c
commit 0e1f8cd803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

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