diff --git a/app/vlinsert/opentelemetry/pb.go b/app/vlinsert/opentelemetry/pb.go index e85ceb5f20..64b56954a5 100644 --- a/app/vlinsert/opentelemetry/pb.go +++ b/app/vlinsert/opentelemetry/pb.go @@ -5,8 +5,10 @@ import ( "strconv" "time" - "github.com/VictoriaMetrics/VictoriaLogs/lib/logstorage" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" "github.com/VictoriaMetrics/easyproto" + + "github.com/VictoriaMetrics/VictoriaLogs/lib/logstorage" ) // the pushLogsHandler must store log entry with the given args. @@ -352,6 +354,10 @@ func decodeLogRecord(src []byte, fs *logstorage.Fields, fb *fmtBuffer) (string, return eventName, timestamp, nil } +// maxFieldNameSize is the maximum size in bytes for field name which VictoriaLogs can accept. +// See https://docs.victoriametrics.com/victorialogs/faq/#what-is-the-maximum-supported-field-name-length +const maxFieldNameSize = 128 + func decodeKeyValue(src []byte, fs *logstorage.Fields, fb *fmtBuffer, fieldNamePrefix string) error { // message KeyValue { // string key = 1; @@ -369,6 +375,10 @@ func decodeKeyValue(src []byte, fs *logstorage.Fields, fb *fmtBuffer, fieldNameP return nil } fieldName := fb.formatSubFieldName(fieldNamePrefix, key) + if len(fieldName) > maxFieldNameSize { + fieldNameTooLongLogger.Errorf("ignoring OpenTelemetry field %q as it exceeds the maximum length of %d bytes", fieldName, maxFieldNameSize) + return nil + } // Decode value valueData, ok, err := easyproto.GetMessageData(src, 2) @@ -387,6 +397,8 @@ func decodeKeyValue(src []byte, fs *logstorage.Fields, fb *fmtBuffer, fieldNameP return nil } +var fieldNameTooLongLogger = logger.WithThrottler("otel_field_name_too_log", time.Second*5) + func decodeAnyValue(src []byte, fs *logstorage.Fields, fb *fmtBuffer, fieldName string) (err error) { // message AnyValue { // oneof value { diff --git a/docs/victorialogs/CHANGELOG.md b/docs/victorialogs/CHANGELOG.md index 5b3518317e..b00effcd7a 100644 --- a/docs/victorialogs/CHANGELOG.md +++ b/docs/victorialogs/CHANGELOG.md @@ -31,12 +31,14 @@ according to the following docs: * FEATURE: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): rename field `Query time` to `Hits query` on the Hits chart panel. The change makes it clear duration of which query is displayed. * FEATURE: [dashboards/kubernetes-explorer](https://github.com/VictoriaMetrics/VictoriaLogs/blob/master/dashboards/victorialogs-kubernetes-explorer.json): add new dashboard for exploring Kubernetes logs via [VictoriaLogs datasource](https://docs.victoriametrics.com/victorialogs/integrations/grafana/) in Grafana. Thanks to @sias32 for [the contribution](https://github.com/VictoriaMetrics/VictoriaLogs/pull/1254)! +* BUGFIX: [OpenTelemetry data ingestion](https://docs.victoriametrics.com/victorialogs/data-ingestion/opentelemetry/): reject fields with names exceeding [128 bytes](https://docs.victoriametrics.com/victorialogs/faq/#what-is-the-maximum-supported-field-name-length) to prevent high memory consumption when processing deeply nested structures. See [#1321](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1321). * BUGFIX: [vlagent](https://docs.victoriametrics.com/victorialogs/vlagent/): hide sensitive values passed via `-remoteWrite.proxyURL` in `/metrics`, `/flags`, and startup logs. Previously these values could be exposed in plain text. See [#1320](https://github.com/VictoriaMetrics/VictoriaLogs/pull/1320). * BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): sanitize markdown URLs in logs rendered with `markdown parsing` enabled, allowing only `http`, `https`, `mailto`, and `tel` schemes for active links and images. See [#1313](https://github.com/VictoriaMetrics/VictoriaLogs/pull/1313). * BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): improve context view highlight visibility in dark theme. The selected log entry is now highlighted with a more visible blue tint instead of barely visible gray background. See [#1196](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1196). * BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): fix live tab ignoring selected stream filters. See [#1342](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1342). * BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): fix stream context view where the selected log overlapped transparently with content below when scrolling. See [#1185](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1185). * BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): fix browser navigation issues where the UI state didn't update on URL changes. See [#1056](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1056). +* BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): fix incorrect stream_context selection for logs with identical timestamps. See [#1199](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1199). * BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): remove extra empty value in `Stream fields` sidebar when selecting all values within a field. See [#1235](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1235). * BUGFIX: [web UI](https://docs.victoriametrics.com/victorialogs/querying/#web-ui): fix target log rendering in the `Log context` modal. See [#1199](https://github.com/VictoriaMetrics/VictoriaLogs/issues/1199).