Skip to content

Commit

Permalink
added RPC system as enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Corvin Lasogga committed Jul 20, 2022
1 parent 62e0a31 commit c04959e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from opentelemetry import trace
from opentelemetry.context import attach, detach
from opentelemetry.propagate import extract
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.semconv.trace import RpcSystemValues, SpanAttributes
from opentelemetry.trace.status import Status, StatusCode

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -206,7 +206,7 @@ def _start_span(

# standard attributes
attributes = {
SpanAttributes.RPC_SYSTEM: "grpc",
SpanAttributes.RPC_SYSTEM: RpcSystemValues.GRPC.value,
SpanAttributes.RPC_GRPC_STATUS_CODE: grpc.StatusCode.OK.value[0],
}

Expand All @@ -217,8 +217,8 @@ def _start_span(
)
attributes.update(
{
SpanAttributes.RPC_METHOD: method,
SpanAttributes.RPC_SERVICE: service,
SpanAttributes.RPC_METHOD: method,
}
)

Expand Down

0 comments on commit c04959e

Please sign in to comment.