Logging for better visibility when using the exporter#26
Conversation
There was a problem hiding this comment.
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 |
...5-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@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. |
|
@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. |
...5-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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:\n
python\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:\n
python\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:\n
python\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:\n
python\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:\n
python\n# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n
# Copyright (c) Microsoft. All rights reserved.
…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>
There was a problem hiding this comment.
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.
juliomenendez
left a comment
There was a problem hiding this comment.
Should all these logger.debug be logger.info instead?
@copilot - implement the suggestion in PR comment |
|
@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>
Task
Logging for better visibility when using the exporter