Skip to content

OTel Web SDK Phase 1#2715

Open
hectorhdzg wants to merge 4 commits intomicrosoft:otel-sdkfrom
hectorhdzg:hectorhdzg/phase1
Open

OTel Web SDK Phase 1#2715
hectorhdzg wants to merge 4 commits intomicrosoft:otel-sdkfrom
hectorhdzg:hectorhdzg/phase1

Conversation

@hectorhdzg
Copy link
Member

Phase 1: SDK Foundation (Critical)
Component Location Description
createOTelWebSdk() src/otel/sdk/ Main SDK entry point factory
IOTelWebSdkConfig src/interfaces/otel/config/ SDK configuration interface
Deprecate OTelSdk class src/otel/sdk/OTelSdk.ts Remove DynamicProto usage
Deliverable: Functional SDK that can be instantiated with trace+log providers.

@hectorhdzg hectorhdzg requested a review from a team as a code owner March 7, 2026 00:09
Copilot AI review requested due to automatic review settings March 7, 2026 00:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements the Phase 1 “SDK Foundation” for the OTel Web SDK by introducing a new factory-based createOTelWebSdk() entry point and associated interfaces, while removing the legacy OTelSdk dynamicProto-based class and wiring in unit tests.

Changes:

  • Added createOTelWebSdk() factory and new IOTelWebSdk / IOTelWebSdkConfig public interfaces.
  • Removed legacy OTelSdk + related interfaces/exports and updated shared/otel-core public exports accordingly.
  • Fixed createContext().setValue() to return a new context instance and added extensive unit coverage for the new SDK.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
shared/otel-core/src/utils/DataCacheHelper.ts Changes cache namespace versioning behavior (currently hardcodes a version string).
shared/otel-core/src/otel/sdk/OTelWebSdk.ts Adds the new SDK factory implementation (tracer + logger access, lifecycle APIs).
shared/otel-core/src/otel/sdk/OTelSdk.ts Removes the legacy dynamicProto-based SDK class.
shared/otel-core/src/otel/api/context/context.ts Fixes context immutability behavior for setValue().
shared/otel-core/src/interfaces/otel/trace/IOTelTracerCtx.ts Updates interface documentation wording.
shared/otel-core/src/interfaces/otel/config/IOTelWebSdkConfig.ts Introduces SDK configuration interface for dependency injection.
shared/otel-core/src/interfaces/otel/IOTelWebSdk.ts Introduces the main SDK interface (tracer/logger/lifecycle/config).
shared/otel-core/src/interfaces/otel/IOTelSdkCtx.ts Removes legacy SDK context interface.
shared/otel-core/src/interfaces/otel/IOTelSdk.ts Removes legacy SDK interface.
shared/otel-core/src/index.ts Updates public exports to expose the new SDK API and remove the old one.
shared/otel-core/Tests/Unit/src/sdk/OTelWebSdk.Tests.ts Adds unit tests covering construction, tracing, logging, flush/shutdown, and config.
shared/otel-core/Tests/Unit/src/index.tests.ts Registers the new OTelWebSdk test suite.

Comment on lines +109 to +111
if (!config.performanceNow) {
handleError(_handlers, "createOTelWebSdk: performanceNow must be provided");
}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

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

The code validates performanceNow as a required config dependency, but the value is never used anywhere in OTelWebSdk.ts. Either wire performanceNow into span/log timing (or wherever it’s intended to be used) or make it optional so consumers aren’t forced to pass a dead field.

Suggested change
if (!config.performanceNow) {
handleError(_handlers, "createOTelWebSdk: performanceNow must be provided");
}

Copilot uses AI. Check for mistakes.
hectorhdzg and others added 3 commits March 6, 2026 16:37
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants