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

[python O11Y] Implement OpenTelemetry #35292

Closed
wants to merge 8 commits into from

Conversation

XuanWang-Amos
Copy link
Contributor

No description provided.

@XuanWang-Amos XuanWang-Amos marked this pull request as ready for review December 14, 2023 00:27
Copy link
Contributor

@gnossen gnossen left a 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.

Copy link
Contributor

@gnossen gnossen left a 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):
Copy link
Contributor

@gnossen gnossen Dec 20, 2023

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:

  1. You could reexport this in __init__py as grpc_observability.LabelInjector. However, not it's not clear that this is OpenTelemetry-specific, so you might want to rename to grpc_observability.OpenTelemetryLabelInjector.
  2. Create a submodule called opentelemetry, so that this is grpc_observability.opentelemetry.LabelInjector.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@copybara-service copybara-service bot closed this in d2da19e Jan 2, 2024
XuanWang-Amos added a commit to XuanWang-Amos/grpc that referenced this pull request Jan 3, 2024
copybara-service bot pushed a commit that referenced this pull request Jan 4, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants