Skip to content
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

otlpjson/trace: skip unknown fields instead of error #5931

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Aug 17, 2022

Fixes #5312

Signed-off-by: Bogdan bogdandrutu@gmail.com

@bogdandrutu bogdandrutu requested review from a team and Aneurysm9 August 17, 2022 22:16
@bogdandrutu bogdandrutu changed the title otlpjson/trace: skip unknown fields instead of erroring otlpjson/trace: skip unknown fields instead of error Aug 17, 2022
@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Merging #5931 (d91c250) into main (22ca5e0) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #5931   +/-   ##
=======================================
  Coverage   91.94%   91.94%           
=======================================
  Files         199      199           
  Lines       12409    12409           
=======================================
  Hits        11409    11409           
  Misses        789      789           
  Partials      211      211           
Impacted Files Coverage Δ
pdata/ptrace/json.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

…entations (open-telemetry#5929)

* Added NewProtoSizer to instantiate Sizer implementations

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>

* Updated changelog with PR number

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>

* Refactored to create a MarshalSizer interface that is returned by NewProtoMarshaller

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>

* Updated NewProtoMarshaler comments to inidicate return interface

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>

* Corrected interface name

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>
@TylerHelmuth
Copy link
Member

TylerHelmuth commented Aug 18, 2022

Does this change allow the collector to receive any json payload intending to be an OTEL span without any errors? So if a user sent {"key": "value"}, which matches none of our fields, would the collector skip everything and then return a 200?

@bogdandrutu
Copy link
Member Author

bogdandrutu commented Aug 18, 2022

Yes, but there is no way otherwise to support adding of new fields correct? The collector behavior is not define by decoding, the decoding will not error, but the receiver can return error that body is empty.

@TylerHelmuth
Copy link
Member

Ya I guess we have to push that responsibility off to the receivers, otherwise the collector isn't forward/backwards compatible.

@TylerHelmuth
Copy link
Member

Maybe there could be an option when starting the collector to allow strict enforcement versus skipping unknown values? Some users might want the enforcement.

@bogdandrutu
Copy link
Member Author

@TylerHelmuth let's think about that, would you mind opening an issue for that? I do believe that by default we should not fail.

@TylerHelmuth
Copy link
Member

@TylerHelmuth let's think about that, would you mind opening an issue for that? I do believe that by default we should not fail.

Done: #5935

@dmitryax
Copy link
Member

Looks like link is the description is wrong

@bogdandrutu
Copy link
Member Author

@dmitryax good catch, PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http receiver drops JSON requests with extra keys
3 participants