Skip to content

Commit

Permalink
chore: imports
Browse files Browse the repository at this point in the history
Signed-off-by: Manik Rana <[email protected]>
  • Loading branch information
Maniktherana committed Oct 4, 2024
1 parent e574544 commit 7bce0a2
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions model/textparse/openmetricsparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,20 +350,6 @@ func (p *OpenMetricsParser) resetCTParseValues(resetLexer *openMetricsLexer) {
p.skipCTSeries = true
}

// findBaseMetricName returns the metric name without reserved suffixes such as "_created",
// "_sum", etc. based on the OpenMetrics specification found at
// https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md.
// If no suffix is found, the original name is returned.
func findBaseMetricName(name string) string {
suffixes := []string{"_created", "_count", "_sum", "_bucket", "_total", "_gcount", "_gsum", "_info"}
for _, suffix := range suffixes {
if strings.HasSuffix(name, suffix) {
return strings.TrimSuffix(name, suffix)
}
}
return name
}

// typeRequiresCT returns true if the metric type requires a _created timestamp.
func typeRequiresCT(t model.MetricType) bool {
switch t {
Expand Down

0 comments on commit 7bce0a2

Please sign in to comment.