Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion app/vlinsert/opentelemetry/pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions docs/victorialogs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down