[gRPC-Python] tracing for retries

95 views
Skip to first unread message

Kyle Strand

unread,
Apr 25, 2024, 3:01:23 PM4/25/24
to grpc.io
How can I enable tracing for retries in Python? The retry-stats gRFC, A46, says:

> The gRPC tracing module should create a tracing span for each call from the perspective of the application, and create a child span for each individual call attempt, including transparent retry attempts.

I don't see any such spans created by the opentelemetry-instrumentation-grpc contrib package (I only see a single span created per gRPC call), so I tried adding the `grpcio-observability` package and enabling it as follows:

```python
grpcio_plugin = grpc_observability.OpenTelemetryPlugin()
grpcio_plugin.register_global()
```

This didn't seem to result in any new traces. I see that there's also an `OpenTelemetryObservability` class, which has a function called `create_client_call_tracer`, but it doesn't appear to be re-exported by `grpc_observability/__init__.py`, which makes me think it might not be intended for public consumption; and it also isn't used in the observability example code.

How can tracing for retries be collected and exported?

Thanks,

Kyle Strand

Xuan Wang

unread,
Apr 25, 2024, 6:01:43 PM4/25/24
to Kyle Strand, grpc.io
Hi Kyle, 

The gRFC you mentioned above was not implemented in Python yet. We have a new gRFC for OpenTelemtry Tracing in progress which will be implemented in Python once it's finished.

Our `grpcio-observability` package currently only works for metrics, it does have some functions for tracing but it's not fully implemented yet.


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/3cd70ae9-cf10-4576-bcc7-13380e6d3c28n%40googlegroups.com.

Kyle Strand

unread,
Apr 25, 2024, 7:12:09 PM4/25/24
to grpc.io
Okay, thank you for explaining.
Reply all
Reply to author
Forward
0 new messages