Skip to content

fix(pubsub): upgrade @opentelemetry/core to address vulnerability#8783

Open
Gribesh wants to merge 1 commit into
googleapis:mainfrom
Gribesh:fix/pubsub-otel-upgrade
Open

fix(pubsub): upgrade @opentelemetry/core to address vulnerability#8783
Gribesh wants to merge 1 commit into
googleapis:mainfrom
Gribesh:fix/pubsub-otel-upgrade

Conversation

@Gribesh

@Gribesh Gribesh commented Jun 30, 2026

Copy link
Copy Markdown

Upgrades @opentelemetry/core and @opentelemetry/sdk-trace-base to version ^2.8.0 to address GHSA-8988-4f7v-96qf.

Updates tracing tests initialization and span parent reference properties to comply with the OpenTelemetry 2.x API changes. (refered to the OpenTelemetry 2.x Migration Guide).

Rest are autogenerated protos and formatting.

Upgrades @opentelemetry/core and @opentelemetry/sdk-trace-base to version ^2.8.0 to address GHSA-8988-4f7v-96qf.

Updates tracing tests initialization and span parent reference properties to comply with the OpenTelemetry 2.x API changes.
@Gribesh Gribesh requested a review from a team as a code owner June 30, 2026 11:23
@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the Pub/Sub API. label Jun 30, 2026
@google-cla

google-cla Bot commented Jun 30, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades OpenTelemetry dependencies to version 2.8.0 and updates the test suite to align with the new API, such as using parentSpanContext?.spanId. However, in handwritten/pubsub/test/tracing.ts, the BasicTracerProvider constructor does not accept spanProcessors in its configuration object, which will cause the span processor to be ignored and tests to fail. It is recommended to revert to using provider.addSpanProcessor() as suggested.

Comment on lines +40 to +42
export const provider: BasicTracerProvider = new BasicTracerProvider({
spanProcessors: [new SimpleSpanProcessor(exporter)],
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The BasicTracerProvider constructor in @opentelemetry/sdk-trace-base does not accept spanProcessors in its configuration object. Passing it here will result in the span processor being ignored, which will cause the tracing tests to fail because no spans will be exported to the InMemorySpanExporter. Instead, use provider.addSpanProcessor() to register the span processor.

export const provider: BasicTracerProvider = new BasicTracerProvider();
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the 2.x SDK release, addSpanProcessor() method was removed
Instead, registering span processors is now constructor-only option in 2.x. Details in OpenTelemetry JS 2.x Upgrade Guide.

@Gribesh

Gribesh commented Jun 30, 2026

Copy link
Copy Markdown
Author

@gemini-code-assist review this PR against the OpenTelemetry 2.x Migration Guide. also a comprehensive audit of the pubsub layer flag any deviation from the migration spec, deprecated API surface, or compat shims masking incompleteness. Do not defer to legacy code patterns; push back on any pragmatic workarounds that defer the full migration. Document breaking changes and require explicit remediation rather than backwards-compatibility theater.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the OpenTelemetry dependencies (@opentelemetry/core and @opentelemetry/sdk-trace-base) to version ^2.8.0. It also formats several logging statements, updates the test assertions to access parentSpanContext?.spanId instead of the deprecated parentSpanId, and adjusts the global tracer provider registration in the test suite. There are no review comments, so I have no feedback to provide.

@Gribesh

Gribesh commented Jun 30, 2026

Copy link
Copy Markdown
Author

@feywind / @codyoss Could I please get a review on this? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant