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

Implement Result Code as required by OTLP #47

Conversation

tigrannajaryan
Copy link
Member

This change implements OTLP requirement of Result Code. OTLP describes
how it is used in the export responses:
https://github.com/open-telemetry/oteps/blob/master/text/0035-opentelemetry-protocol.md#result-code

@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/resultcode branch from ac96f4d to 0c4b764 Compare November 11, 2019 22:15
This change implements OTLP requirement of Result Code. OTLP describes
how it is used in the export responses:
https://github.com/open-telemetry/oteps/blob/master/text/0035-opentelemetry-protocol.md#result-code
@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/resultcode branch from 0c4b764 to f2f54b6 Compare November 11, 2019 22:17
@@ -95,3 +95,20 @@ message ServiceInfo {

// TODO(songya): add more fields as needed.
}

// ExportResultCode is the result code returned in the export responses.
enum ExportResultCode {
Copy link
Member

Choose a reason for hiding this comment

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

I remember you told me that this is controlled by the status we return from grpc not by the message.

Copy link
Member Author

Choose a reason for hiding this comment

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

grpc status is used for throttling purposes: https://github.com/open-telemetry/oteps/blob/master/text/0035-opentelemetry-protocol.md#throttling

ResultCode is different and is an explicit field in the response.

The reason I am using grpc code for throttling is that there is already clearly defined grpc code for this (Unavailable). As opposed to that there is no grpc code that allows to distinguish between FailedRetryable and FailedNotRetryable cases and I don't want to artificially model them using other grpc codes.

Copy link
Member

Choose a reason for hiding this comment

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

But from the Status you can determine if a retry is possible or not correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a clearly defined condition / set of status codes that allow client to make a decision about retrying or not retrying based just the grpc status code? If there is such a way then we can eliminate ResultCode.

At the moment I am not sure how a client should make such decision by looking at the returned gRPC code. For example if gRPC Status is Unknown is it retryable or no?

Perhaps instead of ResultCode we list here the status codes which must be interpreted by the client as Retryable and then make a recommendation for server to return specific errors codes to Retryable and NonRetryable cases? That could work.

Copy link
Member

Choose a reason for hiding this comment

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

FYI: So you always get a status, but I think you never get a response + an error status (if I remember correctly).

So the logic I would use retry if:

  • If the status contains the RetryInfo is a retryable
  • For some status codes without a RetryInfo (deadline exceeded, need to determine the full list) you may do retry.

Copy link
Member Author

Choose a reason for hiding this comment

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

FYI: So you always get a status, but I think you never get a response + an error status (if I remember correctly).

Yes, that is correct. A response only comes when status is success. Any other status is received without a response.

If the status contains the RetryInfo is a retryable

So you are saying RetryInfo with RetryDelay=0 would be equivalent to ResultCode=FailedRetryable. The same RetryInfo with RetryDelay>0 would be throttling indication (also retryable obviously, but after a delay).

For some status codes without a RetryInfo (deadline exceeded, need to determine the full list) you may do retry.

Make sense. Also, we need to decide which status code to return to indicate NotRetryable. Let me think though and submit an update.

Copy link
Member Author

Choose a reason for hiding this comment

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

I created open-telemetry/oteps#65
If it gets accepted I will discard this PR.

tigrannajaryan pushed a commit to tigrannajaryan/rfcs that referenced this pull request Nov 12, 2019
OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.
tigrannajaryan pushed a commit to tigrannajaryan/rfcs that referenced this pull request Nov 12, 2019
OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.
tigrannajaryan pushed a commit to tigrannajaryan/rfcs that referenced this pull request Nov 13, 2019
OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.
@tigrannajaryan
Copy link
Member Author

Reviewers, please have a look at open-telemetry/oteps#65 instead. This uses a different approach that Bogdan proposed and which I think is better.

tigrannajaryan pushed a commit to tigrannajaryan/rfcs that referenced this pull request Nov 15, 2019
OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.
@SergeyKanzhelev
Copy link
Member

Reviewers, please have a look at open-telemetry/oteps#65 instead. This uses a different approach that Bogdan proposed and which I think is better.

I'm assuming this have to be closed? I'm closing, please re-open if needed

tigrannajaryan pushed a commit to tigrannajaryan/rfcs that referenced this pull request Nov 20, 2019
OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.
@tigrannajaryan tigrannajaryan deleted the feature/tigran/resultcode branch November 20, 2019 00:49
tigrannajaryan pushed a commit to tigrannajaryan/rfcs that referenced this pull request Mar 12, 2020
OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.
tigrannajaryan pushed a commit to tigrannajaryan/rfcs that referenced this pull request Mar 18, 2020
OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.
yurishkuro added a commit to open-telemetry/oteps that referenced this pull request Mar 18, 2020
)

OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.

Co-authored-by: Yuri Shkuro <[email protected]>
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 21, 2024
…pen-telemetry#65)

OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.

Co-authored-by: Yuri Shkuro <[email protected]>
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
…pen-telemetry#65)

OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.

Co-authored-by: Yuri Shkuro <[email protected]>
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
…pen-telemetry#65)

OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.

Co-authored-by: Yuri Shkuro <[email protected]>
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 30, 2024
…pen-telemetry#65)

OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.

Co-authored-by: Yuri Shkuro <[email protected]>
carlosalberto pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Nov 8, 2024
…pen-telemetry/oteps#65)

OTLP proposal originally used a separate ResultCode enumeration for server
to tell the client whether the failed request can be retried or no.

After discussion here open-telemetry/opentelemetry-proto#47 (comment)
it became clear that the goal can be achieved using gRPC status codes without
a need for custom enumeration.

This change removes the ResultCode and explains how to use gRPC status codes.

Co-authored-by: Yuri Shkuro <[email protected]>
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.

4 participants