Skip to content

Fix A365 review issues: wire processors into distro, fix types - #22

Merged
Hector Hernandez (hectorhdzg) merged 2 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg/a365-review-fixes
Apr 18, 2026
Merged

Hector Hernandez (hectorhdzg) merged 2 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg/a365-review-fixes

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member
  • Wire A365SpanProcessor (baggage enrichment) and PerRequestSpanProcessor into distro.ts when A365 is enabled, replacing SimpleSpanProcessor
  • Fix PerRequestSpanProcessor.onStart to accept Span instead of ReadableSpan per the OTel SpanProcessor interface contract
  • Remove 'implements Disposable' from OpenTelemetryScope and BaggageScope (ES2022 lib does not include esnext.disposable)
  • Widen isParentSpanRef parameter type from ParentContext to unknown
  • Add trim() to parseEnvBoolean for whitespace-resilient env var parsing
  • Remove unwired A365_OBSERVABILITY_LOG_LEVEL from docs and config
  • Add attribute assertions to A365SpanProcessor tests
  • Add OutputScope unit tests (creation, tenantId validation, message recording, overwrite, raw dict, user details)

…ve tests

- Wire A365SpanProcessor (baggage enrichment) and PerRequestSpanProcessor
  into distro.ts when A365 is enabled, replacing SimpleSpanProcessor
- Fix PerRequestSpanProcessor.onStart to accept Span instead of ReadableSpan
  per the OTel SpanProcessor interface contract
- Remove 'implements Disposable' from OpenTelemetryScope and BaggageScope
  (ES2022 lib does not include esnext.disposable)
- Widen isParentSpanRef parameter type from ParentContext to unknown
- Add trim() to parseEnvBoolean for whitespace-resilient env var parsing
- Remove unwired A365_OBSERVABILITY_LOG_LEVEL from docs and config
- Add attribute assertions to A365SpanProcessor tests
- Add OutputScope unit tests (creation, tenantId validation, message
  recording, overwrite, raw dict, user details)

Copilot AI 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.

Pull request overview

This PR addresses several A365 observability integration and typing issues by properly wiring A365 span processors into the distro setup, aligning SpanProcessor typings with the OpenTelemetry contract, and tightening documentation/config consistency. It also expands unit test coverage around A365 span enrichment and OutputScope behavior.

Changes:

  • Wire A365SpanProcessor (baggage→attribute enrichment) and PerRequestSpanProcessor (per-trace buffered export) into src/distro/distro.ts when A365 is enabled.
  • Fix PerRequestSpanProcessor.onStart typing to accept Span (per OTel SpanProcessor contract) and adjust root-span detection.
  • Remove Disposable interface usage from A365 scopes, improve env var boolean parsing (trim()), update docs/config, and add/extend unit tests (A365SpanProcessor + OutputScope).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/internal/unit/a365/scopes.test.ts Adds unit tests for OutputScope creation, validation, and output message serialization.
test/internal/unit/a365/a365SpanProcessor.test.ts Updates A365SpanProcessor tests to assert tenant/agent attributes and other enrichment behavior.
src/distro/distro.ts Wires A365 processors into the distro span processor pipeline when A365 is enabled.
src/a365/scopes/OpenTelemetryScope.ts Removes implements Disposable from the base scope type.
src/a365/processors/PerRequestSpanProcessor.ts Updates onStart signature to Span and adds context-based root detection.
src/a365/middleware/BaggageBuilder.ts Removes implements Disposable from BaggageScope.
src/a365/context.ts Widens isParentSpanRef parameter type to unknown and adjusts internal typing.
src/a365/configuration/A365Configuration.ts Makes boolean env parsing whitespace-resilient and removes the unwired log level env var constant.
README.md Removes mention of unwired A365_OBSERVABILITY_LOG_LEVEL.
MIGRATION_A365.md Removes mention of unwired A365_OBSERVABILITY_LOG_LEVEL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/distro/distro.ts
Comment thread test/internal/unit/a365/a365SpanProcessor.test.ts Outdated
@hectorhdzg
Hector Hernandez (hectorhdzg) merged commit ebcdaa0 into microsoft:main Apr 18, 2026
5 checks passed
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.

3 participants