Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

### Bugs Fixed
- Default `InvokeAgentScope` spans to `SpanKind.INTERNAL` while preserving explicit span-kind overrides. [#241](https://github.com/microsoft/opentelemetry-distro-javascript/pull/241)

### Other Changes
- Consolidate Dependabot updates for Vitest 4.1.11, Hono 4.13.7, qs 6.16.0, fast-uri 3.1.7, actions/deploy-pages 5.0.1, and actions/checkout 7.0.1.

Expand Down
5 changes: 3 additions & 2 deletions src/a365/scopes/InvokeAgentScope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export class InvokeAgentScope extends OpenTelemetryScope {
* @param invokeScopeDetails Scope-level details (endpoint).
* @param agentDetails The agent identity. `tenantId` is required.
* @param callerDetails Optional caller information (human, agent, or both for A2A).
* @param spanDetails Optional span configuration.
* @param spanDetails Optional span configuration. Defaults the span kind to
* `SpanKind.INTERNAL` when omitted.
*/
public static start(
request: Request,
Expand Down Expand Up @@ -56,7 +57,7 @@ export class InvokeAgentScope extends OpenTelemetryScope {

const resolvedSpanDetails: SpanDetails = {
...spanDetails,
spanKind: spanDetails?.spanKind ?? SpanKind.CLIENT,
spanKind: spanDetails?.spanKind ?? SpanKind.INTERNAL,
};

super(
Expand Down
4 changes: 2 additions & 2 deletions test/internal/unit/a365/scopes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,8 @@ describe("Scopes", () => {
});

it.each([
["CLIENT (default)", undefined, SpanKind.CLIENT],
["SERVER", SpanKind.SERVER, SpanKind.SERVER],
["INTERNAL (default)", undefined, SpanKind.INTERNAL],
["SERVER (override)", SpanKind.SERVER, SpanKind.SERVER],
])("InvokeAgentScope spanKind: %s", (_label, input, expected) => {
const scope = InvokeAgentScope.start(
testRequest,
Expand Down
Loading