diff --git a/docs/victorialogs/CHANGELOG.md b/docs/victorialogs/CHANGELOG.md index fb3f947509..7877c143e7 100644 --- a/docs/victorialogs/CHANGELOG.md +++ b/docs/victorialogs/CHANGELOG.md @@ -22,6 +22,8 @@ according to the following docs: ## tip +* BUGFIX: [cluster ingestion](https://docs.victoriametrics.com/victorialogs/cluster/): relax validation for logs received via the internal protocol by accepting rows where stream fields don't match same-named regular log fields. This helps avoid dropping OpenTelemetry logs with resource and log record field name collisions. + ## [v1.50.0](https://github.com/VictoriaMetrics/VictoriaLogs/releases/tag/v1.50.0) Released at 2026-04-14 diff --git a/lib/logstorage/log_rows.go b/lib/logstorage/log_rows.go index 4615c103eb..4b7d3e6a19 100644 --- a/lib/logstorage/log_rows.go +++ b/lib/logstorage/log_rows.go @@ -320,7 +320,7 @@ func (lr *LogRows) MustAddInsertRow(r *InsertRow) { var invalidStreamTagsLogger = logger.WithThrottler("invalid_stream_tags", 5*time.Second) -func verifyStreamTagsCanonical(streamTagsCanonical string, fields []Field) error { +func verifyStreamTagsCanonical(streamTagsCanonical string, _ []Field) error { st := GetStreamTags() defer PutStreamTags(st) @@ -332,7 +332,7 @@ func verifyStreamTagsCanonical(streamTagsCanonical string, fields []Field) error if len(tail) > 0 { return fmt.Errorf("unexpected tail left after unmarshaling streamTagsCanonical; len(tail)=%d; streamTags: %s", len(tail), st) } - return st.verifyCanonicalFieldValues(fields) + return nil } func (lr *LogRows) mustAdd(tenantID TenantID, timestamp int64, fields []Field) { diff --git a/lib/logstorage/log_rows_test.go b/lib/logstorage/log_rows_test.go index 7037b7dc4e..98a0f602ef 100644 --- a/lib/logstorage/log_rows_test.go +++ b/lib/logstorage/log_rows_test.go @@ -434,35 +434,8 @@ func TestVerifyStreamTagsCanonical_Success(t *testing.T) { f(`{a="b"}`, `x=y a=b q=w`) f(`{a="b",c="d"}`, `c=d x=y a=b`) f(`{a="b"}`, `a=b x=y a=b`) -} - -func TestVerifyStreamTagsCanonical_Failure(t *testing.T) { - f := func(streamTags, fieldsStr string) { - t.Helper() - - st := GetStreamTags() - if err := st.unmarshalStringInplace(streamTags); err != nil { - t.Fatalf("cannot unmarshal stream tags: %s", err) - } - streamTagsCanonical := st.MarshalCanonical(nil) - PutStreamTags(st) - - p := getLogfmtParser() - defer putLogfmtParser(p) - p.parse(fieldsStr) - - if err := verifyStreamTagsCanonical(string(streamTagsCanonical), p.fields); err == nil { - t.Fatalf("expecting non-nil error") - } - } - - // missing value f(`{a="b"}`, ``) f(`{a="b"}`, `x=y`) - - // value mismatch f(`{a="b"}`, `a=c`) - - // multiple fields with the same name f(`{a="b"}`, `a=b x=y a=c`) }