You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[processor/attributes] validate metrics configuration parameters before processing (#37435)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add validation for metrics-only configuration parameters
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes#36077
---------
Signed-off-by: odubajDT <[email protected]>
Copy file name to clipboardExpand all lines: internal/filter/filterconfig/config.go
+38-8
Original file line number
Diff line number
Diff line change
@@ -126,9 +126,11 @@ type MatchProperties struct {
126
126
}
127
127
128
128
var (
129
-
ErrMissingRequiredField=errors.New(`at least one of "attributes", "libraries", or "resources" field must be specified`)
130
-
ErrInvalidLogField=errors.New("services, span_names, and span_kinds are not valid for log records")
131
-
ErrMissingRequiredLogField=errors.New(`at least one of "attributes", "libraries", "span_kinds", "resources", "log_bodies", "log_severity_texts" or "log_severity_number" field must be specified`)
129
+
ErrMissingRequiredSpanField=errors.New(`at least one of "attributes", "libraries", or "resources" field must be specified`)
130
+
ErrInvalidLogField=errors.New("services, span_names, span_kinds and metric_names are not valid for log records")
131
+
ErrMissingRequiredLogField=errors.New(`at least one of "attributes", "libraries", "span_kinds", "resources", "log_bodies", "log_severity_texts" or "log_severity_number" field must be specified`)
132
+
ErrMissingRequiredMetricField=errors.New(`at least one of "metric_names" or "resources" field must be specified`)
133
+
ErrInvalidMetricField=errors.New(`"span_names", "span_kinds", "log_bodies", "log_severity_texts", "log_severity_number", "services", "attributes" and "libraries" are not valid for metrics`)
0 commit comments