app/vlinsert/loki: handle empty structured metadata - #1757
Open
jwmay2012 wants to merge 2 commits into
Open
Conversation
jwmay2012
marked this pull request as ready for review
September 1, 2026 15:48
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/victorialogs/CHANGELOG.md">
<violation number="1" location="docs/victorialogs/CHANGELOG.md:38">
P3: This new BUGFIX entry has no references link, unlike every other FEATURE/BUGFIX line in the changelog, which ends with a `See [#NNNN](...)` link (e.g. lines 39-41, or line 293 for the prior Loki ingestion fix). Add a references link using the current PR as the reference.</violation>
</file>
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.
Re-trigger cubic
jwmay2012
force-pushed
the
fix/loki-empty-structured-metadata
branch
from
September 1, 2026 15:58
6bd1263 to
4340ec7
Compare
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Signed-off-by: Jordan May <jwmay2012@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grafana Alloy can send structured metadata whose extracted value is empty. Loki's
LabelPairAdapteruses implicit-presence proto3 string fields, so generated encoders do not serializenameorvaluewhen the corresponding string is empty. VictoriaLogs currently treats that normal proto3 omission as malformed and rejects the complete push withmissing nameormissing value.The resulting error is:
This appears to be an unintended side effect of the streaming protobuf parser optimization, released in v1.40.0. A sibling OpenTelemetry decoder introduced by the same optimization pattern was subsequently changed to skip attributes with omitted keys rather than reject the request. The Loki decoder already intentionally ignores a metadata pair after decoding when either its name or value is empty.
Treat omitted fields as their empty-string defaults and continue ignoring metadata pairs unless both values are non-empty. Malformed encoded fields still return errors.
Adds an end-to-end protobuf regression test covering an omitted name, an omitted value, an empty pair, and a valid pair in the same request, plus a changelog entry.
Tested with:
go test ./app/vlinsert/loki -count=1make check-allmake test-fullmake apptest