Files
Carles GarciaandGitHub 7c8b1bd83f generator: extract validation to reusable package (#5854)
* generator: extract validation to reusable package

We will also use these functions for the config Controller

* wip

* update deprecated label validation

* fix intrinsic dimensions

* add span metrics subprocessor comments
2025-11-12 13:43:50 +01:00

44 lines
664 B
Go

package spanmetrics
import (
"strings"
"github.com/grafana/tempo/modules/generator/processor"
)
type Subprocessor int
const (
Latency Subprocessor = iota
Count
Size
)
var SupportedSubprocessors = []Subprocessor{
Latency,
Count,
Size,
}
func (s Subprocessor) String() string {
switch s {
case Latency:
return processor.SpanMetricsLatencyName
case Count:
return processor.SpanMetricsCountName
case Size:
return processor.SpanMetricsSizeName
default:
return "unsupported"
}
}
func ParseSubprocessor(s string) bool {
for _, p := range SupportedSubprocessors {
if strings.EqualFold(p.String(), s) {
return true
}
}
return false
}