Skip to content

BREAKING: Change span statuses for gRPC server spans#3333

Merged
carlosalberto merged 18 commits intoopen-telemetry:mainfrom
pellared:align-grpc-semcov-with-http
Apr 3, 2023
Merged

BREAKING: Change span statuses for gRPC server spans#3333
carlosalberto merged 18 commits intoopen-telemetry:mainfrom
pellared:align-grpc-semcov-with-http

Conversation

@pellared
Copy link
Copy Markdown
Member

@pellared pellared commented Mar 22, 2023

Fixes #3110

Changes

The idea behind the PR is to make the spam statuses gRPC convention similar to HTTP semantic conventions.
The gRPC statuses -> HTTP status codes mapping is not anywhere strictly defined.
However, there is are some approximations which can be found:

I got confused if we should treat INTERNAL as Error for SpanKind.SERVER because of:

On the other hand, the description of INTERNAL says:

Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors.

Therefore, I decided to leave it as Error. Also because this is backwards compatible (at least for this gRPC status).

@pellared pellared marked this pull request as ready for review March 22, 2023 11:15
@pellared pellared requested review from a team March 22, 2023 11:16
@pellared pellared changed the title Refine Span Status sementic convention for gRPC Server BREAKING: Change span statuses for gRPC server spans Mar 22, 2023
@pellared pellared requested review from MrAlias and tigrannajaryan and removed request for MrAlias and tigrannajaryan March 22, 2023 17:15
@pellared pellared requested a review from tigrannajaryan March 22, 2023 17:41
Copy link
Copy Markdown
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, with one minor comment remaining.

@pellared pellared requested review from carlosalberto, tigrannajaryan and trask and removed request for tigrannajaryan and trask March 30, 2023 08:15
@carlosalberto
Copy link
Copy Markdown
Contributor

@tigrannajaryan Any opinion on getting this merged for the upcoming April Release?

@tigrannajaryan
Copy link
Copy Markdown
Member

@tigrannajaryan Any opinion on getting this merged for the upcoming April Release?

I think we can merge.

@tigrannajaryan
Copy link
Copy Markdown
Member

@pellared can you resolve the conflicts?

@pellared
Copy link
Copy Markdown
Member Author

pellared commented Apr 3, 2023

@tigrannajaryan @carlosalberto Done. The PR is ready to be merged 😉

@carlosalberto carlosalberto merged commit f5a269f into open-telemetry:main Apr 3, 2023
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
…3333)

Fixes open-telemetry#3110

## Changes

The idea behind the PR is to make the spam statuses gRPC convention
similar to HTTP semantic conventions.
The gRPC statuses -> HTTP status codes mapping is not anywhere strictly
defined.
However, there is are some approximations which can be found:

-
grpc/grpc@bb04e07#diff-c94ff143c8f378e6925a985fa18528a8254a6d7fc34bc855e1de13f1e7f3e464
-
https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto

I got confused if we should treat `INTERNAL` as `Error` for
`SpanKind.SERVER` because of:

-
https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
-
https://github.com/grpc/grpc-go/blob/a02aae6168aa683a1f106e285ec10eb6bc1f6ded/internal/transport/handler_server.go#L90C8-L92
-
https://github.com/grpc/grpc-go/blob/a02aae6168aa683a1f106e285ec10eb6bc1f6ded/internal/transport/http_util.go#L73

On the other hand, [the
description](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
of `INTERNAL` says:

> Internal errors. This means that some invariants expected by the
underlying system have been broken. This error code is reserved for
serious errors.

Therefore, I decided to leave it as `Error`. Also because this is
backwards compatible (at least for this gRPC status).

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
schmikei pushed a commit to schmikei/opentelemetry-specification that referenced this pull request Apr 17, 2025
…3333)

Fixes open-telemetry#3110

## Changes

The idea behind the PR is to make the spam statuses gRPC convention
similar to HTTP semantic conventions.
The gRPC statuses -> HTTP status codes mapping is not anywhere strictly
defined.
However, there is are some approximations which can be found:

-
grpc/grpc@bb04e07#diff-c94ff143c8f378e6925a985fa18528a8254a6d7fc34bc855e1de13f1e7f3e464
-
https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto

I got confused if we should treat `INTERNAL` as `Error` for
`SpanKind.SERVER` because of:

-
https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
-
https://github.com/grpc/grpc-go/blob/a02aae6168aa683a1f106e285ec10eb6bc1f6ded/internal/transport/handler_server.go#L90C8-L92
-
https://github.com/grpc/grpc-go/blob/a02aae6168aa683a1f106e285ec10eb6bc1f6ded/internal/transport/http_util.go#L73

On the other hand, [the
description](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
of `INTERNAL` says:

> Internal errors. This means that some invariants expected by the
underlying system have been broken. This error code is reserved for
serious errors.

Therefore, I decided to leave it as `Error`. Also because this is
backwards compatible (at least for this gRPC status).

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:semantic-conventions Related to semantic conventions spec:trace Related to the specification/trace directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent error status for gRPC and HTTP

8 participants