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

Remove accessors for deprecated status code, fix receiver logic #2521

Merged
merged 2 commits into from
Feb 22, 2021

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Feb 20, 2021

Updates #2488

The previous logic was to ignore deprecated if received non unset for new status code,
but if downstream a service is not upgraded it should see the deprecated status set correctly.

This change is to be consistent with SetCode.

Signed-off-by: Bogdan Drutu [email protected]

@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

Merging #2521 (c51d6a1) into main (9383e82) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2521   +/-   ##
=======================================
  Coverage   91.73%   91.73%           
=======================================
  Files         265      265           
  Lines       15081    15082    +1     
=======================================
+ Hits        13834    13836    +2     
+ Misses        865      864    -1     
  Partials      382      382           
Impacted Files Coverage Δ
consumer/pdata/generated_trace.go 100.00% <ø> (ø)
consumer/pdata/trace.go 100.00% <100.00%> (+2.77%) ⬆️
receiver/otlpreceiver/trace/otlp.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9383e82...c51d6a1. Read the comment docs.

Comment on lines +80 to +73
case otlptrace.Status_STATUS_CODE_OK:
// If status code is set then overwrites deprecated.
span.Status.DeprecatedCode = otlptrace.Status_DEPRECATED_STATUS_CODE_OK
case otlptrace.Status_STATUS_CODE_ERROR:
span.Status.DeprecatedCode = otlptrace.Status_DEPRECATED_STATUS_CODE_UNKNOWN_ERROR
Copy link
Member

Choose a reason for hiding this comment

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

Why these changes? The spec says that receivers MUST:

// If code!=STATUS_CODE_UNSET then the value of deprecated_code MUST be
// ignored, the code field is the sole carrier of the status.

This does not seem to match the spec anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

What does the spec says? Why does "SetCode" updates deprecated but in this case we don't?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated comments to SetCode as well as for the receiver to clarify when we are sender vs receiver.

Copy link
Member

Choose a reason for hiding this comment

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

Discussed offline, so yes, OTLP receiver is both a "receiver" and "sender" in the sense that the proto uses these words here: https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L239

The previous logic was to ignore deprecated if received non unset for new status code,
but if downstream a service is not upgraded it should see the deprecated status set correctly.

This change is to be consistent with `SetCode`.

Signed-off-by: Bogdan Drutu <[email protected]>
Signed-off-by: Bogdan Drutu <[email protected]>
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

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

LGTM

@bogdandrutu bogdandrutu merged commit a04feee into open-telemetry:main Feb 22, 2021
@bogdandrutu bogdandrutu deleted the rmsetter branch February 22, 2021 23:17
This was referenced Mar 8, 2021
This was referenced Mar 15, 2021
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.

2 participants