Skip to content

app/vlinsert/opentelemetry: fix field collisions after flattening#1379

Open
yagmurcicekdagi wants to merge 1 commit into
VictoriaMetrics:masterfrom
yagmurcicekdagi:fix_otel_field_collision
Open

app/vlinsert/opentelemetry: fix field collisions after flattening#1379
yagmurcicekdagi wants to merge 1 commit into
VictoriaMetrics:masterfrom
yagmurcicekdagi:fix_otel_field_collision

Conversation

@yagmurcicekdagi
Copy link
Copy Markdown

Changes

Fixes: #1371

  • Added -opentelemetry.enableFieldPrefixes flag (disabled by default). When enabled, fields are prefixed
    by their source before flattening:

  resource.attributes[\"service.name\"] -> resource.service.name
  logRecord.attributes[\"service.name\"] -> attributes.service.name
  logRecord.body (KV list) [\"service.name\"] -> body.service.name
  • Added tests covering prefix mode for all field sources and verify generated fields
    (trace_id, span_id, severity_number, severity_text) remain unprefixed.

  • Updated docs/victorialogs/data-ingestion/opentelemetry.md with a Field prefixes
    section and victoria_logs_common_flags.md with the new flag.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@yagmurcicekdagi
Copy link
Copy Markdown
Author

Hi, Can you review this pr ? @func25? I've fixed the field name collisions, haven't implemented the query/merge path duplicate name issue yet. Let me know what you think so I can adjust the code.

@yagmurcicekdagi yagmurcicekdagi force-pushed the fix_otel_field_collision branch from d6d6440 to b8779ba Compare May 4, 2026 12:33
@func25
Copy link
Copy Markdown
Member

func25 commented May 4, 2026

Hey, thank you for your interest in this issue.

haven't implemented the query/merge path duplicate name issue yet

I'd recommend starting with a few smaller issues first to get familiar with the logic, the code conventions and the contribution guidelines. As I skimmed through it, this PR appears to be a low-quality AI-generated contribution.

@yagmurcicekdagi
Copy link
Copy Markdown
Author

yagmurcicekdagi commented May 4, 2026

I did use AI to help me locate the issue and give me skeleton to work on, but if you mean the abstractions that I put , that was from me unfortunately -which breaks the contribution guidelines

Could you maybe guide me a bit to how to make this code better quality?

I'd still love to work on getting this to better quality code, but if you don't want that, that's totally understandable as well

Thanks for the reply @func25

Copy link
Copy Markdown
Member

@func25 func25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. I saw some improvements/bug fixes in this PR itself, it's not entirely AI-generated slop, so haven't closed it. Please see below comments.

Using AI to enhance quality and make small improvements is encouraged, but not for this kind of task (yet).

Comment thread app/vlinsert/opentelemetry/pb.go Outdated
Comment thread app/vlinsert/opentelemetry/pb.go Outdated
Comment thread app/vlinsert/opentelemetry/opentelemetry.go Outdated
Comment thread app/vlinsert/opentelemetry/pb.go Outdated
@func25
Copy link
Copy Markdown
Member

func25 commented May 12, 2026

Hey @yagmurcicekdagi, any updates?

Signed-off-by: Yağmur Çiçekdağı <ygmcicekdagi@gmail.com>
@yagmurcicekdagi yagmurcicekdagi force-pushed the fix_otel_field_collision branch from b8779ba to 8ced0d1 Compare May 12, 2026 08:14
@yagmurcicekdagi
Copy link
Copy Markdown
Author

Hey, I've updated the code @func25

@func25 func25 added the bug Something isn't working label May 14, 2026
@func25 func25 self-assigned this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

otel/ingestion: prevent OpenTelemetry field collisions after flattening

2 participants