From 0e740c32fd43e54706cd70c40052658b105545a5 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Wed, 31 Jan 2024 22:15:51 +0000 Subject: [PATCH] A66: Add more python details --- A66-otel-stats.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/A66-otel-stats.md b/A66-otel-stats.md index d7e1efcf7..2573807d1 100644 --- a/A66-otel-stats.md +++ b/A66-otel-stats.md @@ -264,6 +264,10 @@ func ServerOption(mo MetricsOptions) grpc.ServerOption {} #### Python +Python provide `OpenTelemetryPlugin` as a base class which user can override to +have the desired behavior, we also provide an example of how to use this: [gRPC +Observability Example](https://github.com/grpc/grpc/tree/master/examples/python/observability#grpc-observability-example) + ```python from opentelemetry.sdk.metrics import MeterProvider @@ -289,7 +293,7 @@ class OpenTelemetryPlugin: self, target: str ) -> bool: """ - If set, this will be called per channel to decide whether to record the + If overridden, this will be called per channel to decide whether to record the target attribute on client or to replace it with "other". This helps reduce the cardinality on metrics in cases where many channels are created with different targets in the same binary (which might happen @@ -308,7 +312,7 @@ class OpenTelemetryPlugin: self, method: str ) -> bool: """ - If set, this will be called with a generic method type to decide whether to + If overridden, this will be called with a generic method type to decide whether to record the method name or to replace it with "other". Note that pre-registered methods will always be recorded no matter what this