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

A66 update: Add more python details #415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions A66-otel-stats.md
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down