Skip to content

Logging for better visibility when using the exporter#26

Merged
nikhilNava merged 8 commits intomainfrom
nikhilc/logging
Nov 7, 2025
Merged

Logging for better visibility when using the exporter#26
nikhilNava merged 8 commits intomainfrom
nikhilc/logging

Conversation

@nikhilNava
Copy link
Contributor

Task
Logging for better visibility when using the exporter

Copilot AI review requested due to automatic review settings November 6, 2025 17:13
@nikhilNava nikhilNava requested a review from a team as a code owner November 6, 2025 17:13
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 adds comprehensive logging capabilities to the observability core library, improving debuggability and monitoring of telemetry operations. The changes replace the generic "agent365" logger name with the Python module name convention for better log organization.

Key changes:

  • Added debug and error logging to span lifecycle events in OpenTelemetry scopes
  • Added detailed logging to the Agent365 exporter for export operations, HTTP requests, and error scenarios
  • Updated default logger name from "agent365" to use __name__ following Python best practices
  • Added comprehensive test coverage for logging functionality

Reviewed Changes

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

Show a summary per file
File Description
opentelemetry_scope.py Added logger initialization and logging for span start/end events and failures
agent365_exporter.py Added extensive logging for export operations, HTTP requests/responses, token resolution, and error handling
config.py Changed default logger name from "agent365" to module name (__name__) and updated documentation
test_record_attributes.py Added tests for OpenTelemetry scope logging behavior including success and error scenarios
test_agent365_exporter.py Added tests verifying exporter logging for successful exports and error conditions

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 6, 2025 17:16
Copy link
Contributor

Copilot AI commented Nov 6, 2025

@nikhilNava I've opened a new pull request, #27, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Nov 6, 2025

@nikhilNava I've opened a new pull request, #28, to work on those changes. Once the pull request is ready, I'll request review from you.

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 5 changed files in this pull request and generated 3 comments.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 6, 2025 17:20
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 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (5)

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/opentelemetry_scope.py:1

  • The copyright header does not match the required Microsoft format. It should be:\npython\n# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n
# Copyright (c) Microsoft. All rights reserved.

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py:1

  • The copyright header does not match the required Microsoft format. It should be:\npython\n# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n
# Copyright (c) Microsoft. All rights reserved.

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/config.py:1

  • The copyright header does not match the required Microsoft format. It should be:\npython\n# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n
# Copyright (c) Microsoft. All rights reserved.

tests/observability/core/test_record_attributes.py:1

  • The copyright header does not match the required Microsoft format. It should be:\npython\n# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n
# Copyright (c) Microsoft. All rights reserved.

tests/observability/core/test_agent365_exporter.py:1

  • The copyright header does not match the required Microsoft format. It should be:\npython\n# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n
# Copyright (c) Microsoft. All rights reserved.

Copilot AI and others added 2 commits November 6, 2025 14:01
…thod (#27)

* Initial plan

* Extract duplicated truncation logic into helper function

Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
* Initial plan

* Remove print statements from unit tests

Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 6, 2025 21:02
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 no new comments.

Comments suppressed due to low confidence (3)

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/opentelemetry_scope.py:1

  • The copyright header format is incorrect. According to the repository's coding guidelines, it should be # Copyright (c) Microsoft Corporation. followed by # Licensed under the MIT License. on a separate line. Please update to the standard two-line format.
# Copyright (c) Microsoft. All rights reserved.

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py:1

  • The copyright header format is incorrect. According to the repository's coding guidelines, it should be # Copyright (c) Microsoft Corporation. followed by # Licensed under the MIT License. on a separate line. Please update to the standard two-line format.
# Copyright (c) Microsoft. All rights reserved.

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/config.py:1

  • The copyright header format is incorrect. According to the repository's coding guidelines, it should be # Copyright (c) Microsoft Corporation. followed by # Licensed under the MIT License. on a separate line. Please update to the standard two-line format.
# Copyright (c) Microsoft. All rights reserved.

Copy link
Contributor

@juliomenendez juliomenendez left a comment

Choose a reason for hiding this comment

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

Should all these logger.debug be logger.info instead?

@nikhilNava
Copy link
Contributor Author

Should all these logger.debug be logger.info instead?

@copilot - implement the suggestion in PR comment

Copy link
Contributor

Copilot AI commented Nov 6, 2025

@nikhilNava I've opened a new pull request, #29, to work on those changes. Once the pull request is ready, I'll request review from you.

…perations (#29)

* Initial plan

* Change logger.debug to logger.info for better visibility

Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
@nikhilNava nikhilNava merged commit f763477 into main Nov 7, 2025
8 checks passed
@nikhilNava nikhilNava deleted the nikhilc/logging branch November 7, 2025 05:29
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