-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed esexporter serialized document to avoid conflicting keys #33454
Fixed esexporter serialized document to avoid conflicting keys #33454
Conversation
expectedDocFields := pcommon.NewMap() | ||
err = expectedDocFields.FromRaw(map[string]any{ | ||
"service.name": "foo.bar", | ||
"service.version": "1.1.0", | ||
"agent.name": "otlp", | ||
"host.os.platform": "darwin", | ||
"host.os.full": "Mac OS Mojave", | ||
"host.os.name": "Mac OS X", | ||
"host.os.version": "10.14.1", | ||
"host.os.type": "macos", | ||
"host.name": "localhost", | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing something obvious, but is expectedDocFields
being used in this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes they are not. leftovers
m := encodeModel{ | ||
mode: MappingECS, | ||
dedot: true, | ||
dedup: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this test testing de-duplication? I ran it with setting dedup: false
and it still passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you run it without a fix, resulting document is malformed.
the fix was really in calling Sort
or Dedup
before Serailize
…metry-collector-contrib into fix/esexp-mapping
…tor-contrib into fix/esexp-mapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, can you also undo the change in #32917 ?
|
…tor-contrib into fix/esexp-mapping
…metry-collector-contrib into fix/esexp-mapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, the fix is to sort the document fields before serializing when dedot
is enabled (the default).
Description:
Sort()
orDedup()
call was missing before runninSerialize()
with ECS mapping enabledLink to tracking Issue:
Fixes #33264
Testing: Added UT
Documentation: -