Skip to content

Commit

Permalink
Merge pull request #244 from assafad/timestamp-seconds-suffix
Browse files Browse the repository at this point in the history
metrics name linter: Remove timestamp_seconds suffix restriction
  • Loading branch information
avlitman authored May 20, 2024
2 parents 1586779 + 04c8b06 commit 61b487a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions test/metrics/prom-metrics-linter/custom_linter_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ func CustomLinterRules(problems []promlint.Problem, mf *dto.MetricFamily, operat
})
}

// Check "_timestamp_seconds" suffix for non-counter metrics
if *mf.Type != dto.MetricType_COUNTER && strings.HasSuffix(*mf.Name, "_timestamp_seconds") {
problems = append(problems, promlint.Problem{
Metric: *mf.Name,
Text: "non-counter metric should not have \"_timestamp_seconds\" suffix",
})
}

// If promlint fails on a "total" suffix, check also for "_timestamp_seconds" suffix. If it exists, do not fail
var newProblems []promlint.Problem
for _, problem := range problems {
Expand Down

0 comments on commit 61b487a

Please sign in to comment.