Repository navigation
Add A365 manual scopes, processors, baggage and context propagation - #21
Merged
Hector Hernandez (hectorhdzg) merged 1 commit intoApr 17, 2026
Conversation
Hector Hernandez (hectorhdzg)
requested a review
from Jackson Weber (JacksonWeber)
as a code owner
April 17, 2026 23:19
Hector Hernandez (hectorhdzg)
requested review from
Nev (MSNev),
Leighton Chen (lzchen) and
Radhika Gupta (rads-1996)
as code owners
April 17, 2026 23:19
Copilot started reviewing on behalf of
Hector Hernandez (hectorhdzg)
April 17, 2026 23:20
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new A365 “manual telemetry” API surface (scopes + context propagation + baggage + processors) and updates configuration/documentation to match upstream Agent365-nodejs conventions.
Changes:
- Introduces A365 manual scopes (
InvokeAgentScope,InferenceScope,ExecuteToolScope,OutputScope) plus message normalization/serialization helpers. - Adds context propagation utilities (
ParentSpanRef+ W3C traceparent inject/extract) and a per-request token context + per-request span processor. - Updates A365 env var names/parsing and adds samples + migration/docs + unit tests.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test/internal/unit/a365/scopes.test.ts | New unit tests for manual scopes behavior (attributes, serialization, timing, cancellation). |
| test/internal/unit/a365/perRequestSpanProcessor.test.ts | New unit tests for per-request buffering/export behavior and env var parsing. |
| test/internal/unit/a365/messageUtils.test.ts | New unit tests for message normalization/serialization helpers. |
| test/internal/unit/a365/contextPropagation.test.ts | New unit tests for W3C context inject/extract and ParentSpanRef parenting. |
| test/internal/unit/a365/baggageBuilder.test.ts | New unit tests for BaggageBuilder/BaggageScope baggage propagation. |
| test/internal/unit/a365/a365SpanProcessor.test.ts | New unit tests for baggage→span enrichment processor and registries. |
| test/internal/unit/a365/a365Configuration.test.ts | Updates tests for new env var names + auth scopes parsing behavior. |
| src/index.ts | Re-exports newly added A365 APIs from package root. |
| src/distro/distro.ts | Updates A365 enablement env var name in distro docs. |
| src/a365/scopes/index.ts | Barrel export for manual scopes. |
| src/a365/scopes/OutputScope.ts | Implements OutputScope for output message spans. |
| src/a365/scopes/OpenTelemetryScope.ts | Adds base scope with span lifecycle, tagging, message recording, parent context support. |
| src/a365/scopes/InvokeAgentScope.ts | Implements invoke-agent span + request/caller/endpoint tagging. |
| src/a365/scopes/InferenceScope.ts | Implements inference span tagging (model/provider/tokens/finish reasons/etc.). |
| src/a365/scopes/ExecuteToolScope.ts | Implements tool-execution span tagging + args/result serialization. |
| src/a365/processors/util.ts | Defines attribute allowlists for baggage→span enrichment. |
| src/a365/processors/index.ts | Barrel export for A365 processors and attribute registries. |
| src/a365/processors/PerRequestSpanProcessor.ts | Implements per-trace buffering + export under saved Context + concurrency limits. |
| src/a365/processors/A365SpanProcessor.ts | Implements baggage→span attribute enrichment on span start. |
| src/a365/middleware/index.ts | Barrel export for baggage middleware. |
| src/a365/middleware/BaggageBuilder.ts | Implements fluent BaggageBuilder and BaggageScope context carrier. |
| src/a365/message-utils.ts | Adds message wrapper detection, normalization, serialization, and safe JSON serialization helper. |
| src/a365/index.ts | Aggregates/exports new A365 public surface (scopes/constants/contracts/context/middleware/processors). |
| src/a365/contracts.ts | Defines A365 message schema types, scope contracts, and span details/parent refs. |
| src/a365/context/tokenContext.ts | Adds per-request export token context helpers (runWithExportToken, etc.). |
| src/a365/context.ts | Adds ParentSpanRef utilities + W3C trace context inject/extract helpers. |
| src/a365/constants.ts | Introduces A365 OTel attribute keys + operation names + SDK identity constants. |
| src/a365/configuration/A365Configuration.ts | Updates env var names and parsing (booleans, scopes splitting, domain trimming). |
| samples/src/a365ManualScopes.ts | New sample demonstrating manual scopes + cross-service context propagation. |
| samples/src/a365Export.ts | Updates sample docs for new A365 env var names. |
| samples/README.md | Adds sample entry/link for manual scopes sample. |
| README.md | Updates documented A365 env vars (and adds log level env var mention). |
| MIGRATION_A365.md | New migration guide from @microsoft/agents-a365-observability to @microsoft/opentelemetry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Radhika Gupta (rads-1996)
approved these changes
Apr 17, 2026
Hector Hernandez (hectorhdzg)
merged commit Apr 17, 2026
6fee946
into
microsoft:main
9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.