Skip to content

fix(tracing): upgrade to Otel 2.0+#3863

Open
MichaelDoyle wants to merge 1 commit intomainfrom
otel-two
Open

fix(tracing): upgrade to Otel 2.0+#3863
MichaelDoyle wants to merge 1 commit intomainfrom
otel-two

Conversation

@MichaelDoyle
Copy link
Copy Markdown
Contributor

@MichaelDoyle MichaelDoyle commented Nov 27, 2025

Key Changes:

  1. Core Telemetry Fixes (js/core)

    • Initialization Race Condition: Updated enableTelemetry in tracing.ts to correctly store and await the actual initialization promise. This prevents spans from being created before the SDK is fully ready.
    • Improved Test Reliability: Added await flushTracing() to beforeEach and relevant test cases in action_test.ts and flow_test.ts. This ensures all asynchronously emitted spans are captured before assertions are made.
    • Version-Agnostic Span Processing: Implemented a MultiSpanProcessor in node-telemetry-provider.ts to reliably handle multiple span processors across different OpenTelemetry versions.
    • SDK Re-initialization: Refined the enableTelemetry logic to properly shut down existing SDK instances before re-initializing, avoiding duplicate instrumentation and resource leaks.
  2. OpenTelemetry 2.0 Compatibility (js/plugins/google-cloud)

    • Traces Test: Updated traces_test.ts to use parentSpanContext?.spanId instead of the deprecated parentSpanId property, which was removed in OTel 2.0.
    • Metrics Test:
      • Updated metrics_test.ts to use the InstrumentType enum for metric type comparisons.
      • Addressed the removal of the type property from the MetricDescriptor interface.

Checklist (if applicable):

AIM

image

Dev UI

image

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.

1 participant