Skip to content

Conversation

@JianH
Copy link
Contributor

@JianH JianH commented Nov 4, 2025

examples:
1.
{
"name": "chat gpt-4o-mini",
"context": {
"trace_id": "0x391f1d4e13c285bce547e03a4eb6e019",
"span_id": "0x2c2d04e20edb73b1",
"trace_state": "[]"
},
"kind": "SpanKind.INTERNAL",
"parent_id": "0x0089408c54e3007d",
"start_time": "2025-11-05T04:03:02.720236Z",
"end_time": "2025-11-05T04:03:13.922298Z",
"status": {
"status_code": "UNSET"
},
"attributes": {
"gen_ai.operation.name": "chat",
"gen_ai.request.choice.count": 1,
"gen_ai.provider.name": "azure.ai.openai",
"gen_ai.request.model": "gpt-4o-mini",
"server.address": "https://a365-hw-openai-sentinel.openai.azure.com/openai/deployments/gpt-4o-mini/",
"gen_ai.response.id": "chatcmpl-CYP1bPQBRWECwF5ush924IBTgC3gj",
"gen_ai.response.finish_reasons": "["stop"]",
"gen_ai.response.model": "gpt-4o-mini-2024-07-18",
"gen_ai.usage.input_tokens": 25,
"gen_ai.usage.output_tokens": 564,
"gen_ai.client.operation.duration": 11.20091659999889
},
"events": [],
"links": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.38.0",
"service.namespace": "agent365-tests",
"service.name": "integration-test-service"
},
"schema_url": ""
}
}
2.
{
"name": "invoke_agent 412a6822-5aad-4863-a11e-4fa51ca5765d",
"context": {
"trace_id": "0x391f1d4e13c285bce547e03a4eb6e019",
"span_id": "0x0089408c54e3007d",
"trace_state": "[]"
},
"kind": "SpanKind.INTERNAL",
"parent_id": null,
"start_time": "2025-11-05T04:03:02.719208Z",
"end_time": "2025-11-05T04:03:13.922298Z",
"status": {
"status_code": "UNSET"
},
"attributes": {
"gen_ai.operation.name": "invoke_agent",
"gen_ai.request.choice.count": 1,
"gen_ai.provider.name": "microsoft.agent_framework",
"gen_ai.request.model": "unknown",
"gen_ai.agent.id": "412a6822-5aad-4863-a11e-4fa51ca5765d",
"gen_ai.agent.name": "412a6822-5aad-4863-a11e-4fa51ca5765d",
"gen_ai.response.id": "chatcmpl-CYP1bPQBRWECwF5ush924IBTgC3gj",
"gen_ai.response.finish_reasons": "["stop"]",
"gen_ai.usage.input_tokens": 25,
"gen_ai.usage.output_tokens": 564
},
"events": [],
"links": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.38.0",
"service.namespace": "agent365-tests",
"service.name": "integration-test-service"
},
"schema_url": ""
}
}
3.
{
"name": "execute_tool add_numbers",
"context": {
"trace_id": "0xee7d1f03ab5d91dd20768ab6f3c88d55",
"span_id": "0xf59bddb6084efa0a",
"trace_state": "[]"
},
"kind": "SpanKind.INTERNAL",
"parent_id": "0x643e1b7e3b4c4de6",
"start_time": "2025-11-05T04:03:16.482169Z",
"end_time": "2025-11-05T04:03:16.482169Z",
"status": {
"status_code": "UNSET"
},
"attributes": {
"gen_ai.operation.name": "execute_tool",
"gen_ai.tool.name": "add_numbers",
"gen_ai.tool.call.id": "call_6PWwum9FD353331ImN4NoZKl",
"gen_ai.tool.type": "function",
"gen_ai.tool.description": "Add two numbers together.\n\n Args:\n a: First number\n b: Second number\n\n Returns:\n The sum of a and b\n ",
"agent_framework.function.invocation.duration": 3.719999949680641e-05
},
"events": [],
"links": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.38.0",
"service.namespace": "agent365-tests",
"service.name": "integration-test-service"
},
"schema_url": ""
}
}

Copilot AI review requested due to automatic review settings November 4, 2025 16:32
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

This PR introduces a new Python library for Agent Framework observability and tracing extensions for Microsoft Agents A365. The library provides OpenTelemetry-based instrumentation capabilities specifically for the Agent Framework, including custom span processing for tool execution operations.

  • Establishes package structure with dynamic versioning using PEP 440 compliant timestamp-based versions
  • Implements Agent Framework instrumentation using OpenTelemetry BaseInstrumentor
  • Adds custom span processor to enrich telemetry data for tool execution operations

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
setup.py Implements dynamic versioning with UTC timestamp-based version numbers, supporting CI/CD override via environment variable
pyproject.toml Defines package metadata, dependencies, and build configuration for the observability extensions library
trace_instrumentor.py Provides AgentFrameworkInstrumentor class that registers custom span processor with OpenTelemetry tracer provider
span_processor.py Implements custom span processor to enrich tool execution spans with event content attributes
init.py Empty module initialization file with copyright header
Comments suppressed due to low confidence (2)

libraries/microsoft-agents-a365-observability-extensions-agentframework/microsoft_agents_a365/observability/extensions/agentframework/span_processor.py:8

  • Import of 'InferenceOperationType' is not used.
from microsoft_agents_a365.observability.core.inference_operation_type import InferenceOperationType

libraries/microsoft-agents-a365-observability-extensions-agentframework/microsoft_agents_a365/observability/extensions/agentframework/span_processor.py:9

  • Import of 'extract_model_name' is not used.
from microsoft_agents_a365.observability.core.wrappers.utils import extract_model_name

Copilot AI review requested due to automatic review settings November 4, 2025 16:59
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

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

Copilot AI review requested due to automatic review settings November 4, 2025 17:38
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

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Copy link
Contributor

@nikhilNava nikhilNava left a comment

Choose a reason for hiding this comment

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

Can you add integration tests instead of sample app?
please refer to https://github.com/microsoft/Agent365-python/blob/main/tests/integration/test_openai_trace_processor.py

Copilot AI review requested due to automatic review settings November 4, 2025 20:48
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

Copilot reviewed 6 out of 8 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

libraries/microsoft-agents-a365-observability-extensions-agentframework/setup.py:1

  • Copyright header format is inconsistent with other packages in the repository. All other similar packages use '# Copyright (c) Microsoft. All rights reserved.' format. Please update to match the established pattern for consistency.
# Copyright (c) Microsoft Corporation.

libraries/microsoft-agents-a365-observability-extensions-agentframework/setup.py:1

  • Version management implementation differs from other packages in the repository. All similar packages (e.g., observability-core, observability-extensions-langchain) use a build_version() function that generates date-based versions with UTC timestamps and checks the 'A365_SDK_VERSION' environment variable. This package uses a simpler approach with 'AGENT365_PYTHON_SDK_PACKAGE_VERSION'. Please align with the established pattern for consistency.
# Copyright (c) Microsoft Corporation.

Copilot AI review requested due to automatic review settings November 5, 2025 04:07
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

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

Copilot AI review requested due to automatic review settings November 5, 2025 04:19
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

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

mrunalhirve128
mrunalhirve128 previously approved these changes Nov 5, 2025
Copilot AI review requested due to automatic review settings November 5, 2025 14:11
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

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

@JianH JianH requested a review from nikhilNava November 5, 2025 17:23
@mrunalhirve128
Copy link
Contributor

Would you update "microsoft-agents-a365-runtime >= 0.1.0" in pyproject.toml file of
microsoft-agents-a365-observability-core package.

There is some package versioning conflict.

Please get this reviewed from Rahul as well.

Copy link
Contributor

@mrunalhirve128 mrunalhirve128 left a comment

Choose a reason for hiding this comment

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

Check my previous comment

Copilot AI review requested due to automatic review settings November 5, 2025 18:41
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

Copilot reviewed 9 out of 11 changed files in this pull request and generated no new comments.

@mrunalhirve128 mrunalhirve128 self-requested a review November 5, 2025 19:01
nikhilNava
nikhilNava previously approved these changes Nov 5, 2025
Copy link
Contributor

@nikhilNava nikhilNava left a comment

Choose a reason for hiding this comment

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

Does the inference or invoke agent spans track input or output messages?

Copilot AI review requested due to automatic review settings November 5, 2025 21:27
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

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

@JianH JianH requested a review from nikhilNava November 6, 2025 01:50
@JianH JianH dismissed mrunalhirve128’s stale review November 6, 2025 01:51

microsoft-agents-a365-runtime >= 0.1.0 is already updated in there, from other merged branch

@JianH JianH merged commit c07a8cd into main Nov 6, 2025
8 checks passed
@pontemonti pontemonti deleted the user/jianhan/ob_af_extension branch December 5, 2025 17:14
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.

5 participants