Skip to content
Merged
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)

### Features Added
- Add manual `sessionId` propagation to `ExecuteToolScope` and `InferenceScope`, plus opt-in custom baggage enrichment for recognized GenAI spans through `BaggageBuilder.customAttribute()` and `customAttributes()`. [#242](https://github.com/microsoft/opentelemetry-distro-javascript/pull/242)
- Add GenAI v1.42 InvokeAgent request, response, cache-token, and provider attribute capture for manual A365 scopes. [#239](https://github.com/microsoft/opentelemetry-distro-javascript/pull/239)
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 @@ -28,7 +28,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 @@ -59,7 +60,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 @@ -1003,8 +1003,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