-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[python O11Y] Implement OpenTelemetry #35292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a first batch. Not a full review yet.
src/python/grpcio_tests/tests/observability/_open_telemetry_observability_test.py
Outdated
Show resolved
Hide resolved
src/python/grpcio_tests/tests/observability/_open_telemetry_observability_test.py
Outdated
Show resolved
Hide resolved
src/python/grpcio_tests/tests/observability/_open_telemetry_observability_test.py
Outdated
Show resolved
Hide resolved
src/python/grpcio_observability/grpc_observability/server_call_tracer.cc
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've reviewed everything now. Mostly looks good.
GRPC_OTHER_LABEL_VALUE = "other" | ||
|
||
|
||
class LabelInjector(abc.ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a public interface? I think so because it's a part of the OpenTelemetryPluginOption
interface and OpenTelemetryPluginOption
is part of the OpenTelemetryPlugin
interface, which is definitely public. If so, we'll want to make sure that it's named in a way that indicates that is.
Currently, this is named grpc_observability._open_telemetry_plugin.LabelInjector
. The _open_telemetry_plugin
part implies that this is private. There are a couple of ways to address this:
- You could reexport this in
__init__py
asgrpc_observability.LabelInjector
. However, not it's not clear that this is OpenTelemetry-specific, so you might want to rename togrpc_observability.OpenTelemetryLabelInjector
. - Create a submodule called opentelemetry, so that this is
grpc_observability.opentelemetry.LabelInjector
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is a public interface. Since this LabelInjector is only used for OpenTelemetry, I'll rename it to OpenTelemetryLabelInjector
.
This is part of CSM observability, after reviewing the design, I found something that needs to be clarified. I'll reexport this once started working on CSM observability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please assign an issue against yourself to create a test similar to this one for the grpc_observability
package so that we can protect against regressions in the public API.
src/python/grpcio_observability/grpc_observability/_open_telemetry_plugin.py
Show resolved
Hide resolved
src/python/grpcio_observability/grpc_observability/_open_telemetry_plugin.py
Outdated
Show resolved
Hide resolved
src/python/grpcio_observability/grpc_observability/_open_telemetry_plugin.py
Outdated
Show resolved
Hide resolved
src/python/grpcio_observability/grpc_observability/_open_telemetry_plugin.py
Outdated
Show resolved
Hide resolved
src/python/grpcio_observability/grpc_observability/_open_telemetry_plugin.py
Show resolved
Hide resolved
src/python/grpcio_observability/grpc_observability/_open_telemetry_plugin.py
Outdated
Show resolved
Hide resolved
src/python/grpcio_observability/grpc_observability/_open_telemetry_plugin.py
Outdated
Show resolved
Hide resolved
src/python/grpcio_observability/grpc_observability/_open_telemetry_plugin.py
Show resolved
Hide resolved
src/python/grpcio_observability/grpc_observability/_open_telemetry_plugin.py
Show resolved
Hide resolved
This reverts commit d2da19e.
This reverts commit 96b9e8d. [Implement OpenTelemetry PR](#35292) was [reverted](96b9e8d) because some tests started failing after import the changes to g3. After investigation, we found root cause, it can be fixed both on our side and on gapic API side, we opened an issue to [gapic API team](googleapis/python-api-core#579), this PR will includes the fixes on our side. <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. --> Closes #35439 COPYBARA_INTEGRATE_REVIEW=#35439 from XuanWang-Amos:reapply_otel 0133564 PiperOrigin-RevId: 595746222
No description provided.