MCPcopy
hub / github.com/grafana/tempo / Validate

Method Validate

cmd/tempo/app/overrides_validation.go:95–213  ·  view source on GitHub ↗

Validate validates user-configurable overrides

(limits *client.Limits)

Source from the content-addressed store, hash-verified

93
94// Validate validates user-configurable overrides
95func (v *overridesValidator) Validate(limits *client.Limits) error {
96 if forwarders, ok := limits.GetForwarders(); ok {
97 for _, f := range forwarders {
98 if _, ok := v.validForwarders[f]; !ok {
99 return fmt.Errorf("forwarder \"%s\" is not a known forwarder, contact your system administrator", f)
100 }
101 }
102 }
103
104 if processors, ok := limits.GetMetricsGenerator().GetProcessors(); ok {
105 for p := range processors.GetMap() {
106 if err := validation.ValidateProcessor(p); err != nil {
107 return err
108 }
109 }
110 }
111
112 if filterPolicies, ok := limits.GetMetricsGenerator().GetProcessor().GetSpanMetrics().GetFilterPolicies(); ok {
113 if err := validation.ValidateFilterPolicies(filterPolicies); err != nil {
114 return err
115 }
116 }
117
118 if collectionInterval, ok := limits.GetMetricsGenerator().GetCollectionInterval(); ok {
119 if err := validation.ValidateCollectionInterval(collectionInterval); err != nil {
120 return err
121 }
122 }
123
124 if traceIDLabelName, ok := limits.GetMetricsGenerator().GetTraceIDLabelName(); ok {
125 if err := validation.ValidateTraceIDLabelName(traceIDLabelName); err != nil {
126 return err
127 }
128 }
129
130 if ingestionSlack, ok := limits.GetMetricsGenerator().GetIngestionSlack(); ok {
131 if err := validation.ValidateIngestionTimeRangeSlack(ingestionSlack); err != nil {
132 return err
133 }
134 }
135
136 if factor, ok := limits.GetMetricsGenerator().GetNativeHistogramBucketFactor(); ok {
137 if err := validation.ValidateNativeHistogramBucketFactor(factor); err != nil {
138 return err
139 }
140 }
141
142 if buckets, ok := limits.GetMetricsGenerator().GetProcessor().GetServiceGraphs().GetHistogramBuckets(); ok {
143 if err := validation.ValidateHistogramBuckets(buckets, "metrics_generator.processor.service_graphs.histogram_buckets"); err != nil {
144 return err
145 }
146 }
147
148 if buckets, ok := limits.GetMetricsGenerator().GetProcessor().GetSpanMetrics().GetHistogramBuckets(); ok {
149 if err := validation.ValidateHistogramBuckets(buckets, "metrics_generator.processor.span_metrics.histogram_buckets"); err != nil {
150 return err
151 }
152 }

Callers

nothing calls this directly

Tested by

no test coverage detected