Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for using a Service-to-Service (S2S) endpoint in the Agent365 exporter. The change allows the exporter to route telemetry data through a different API path when the S2S endpoint is enabled.
- Adds a new
use_s2s_endpointboolean parameter to control endpoint routing - Implements conditional path selection based on the S2S endpoint flag
- Adds comprehensive test coverage for both S2S and default endpoint scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| agent365_exporter.py | Adds use_s2s_endpoint parameter and implements conditional endpoint path logic |
| config.py | Passes through the use_s2s_endpoint parameter from kwargs to the exporter |
| test_agent365_exporter.py | Adds two new test cases validating S2S and default endpoint path behavior |
Comments suppressed due to low confidence (1)
libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py:40
- The docstring comment on line 39 needs to be updated to reflect that the endpoint path can now vary based on the
use_s2s_endpointparameter. The documentation should mention both possible paths: the default/maven/agent365/agents/{agentId}/tracesand the S2S path/maven/agent365/service/agents/{agentId}/traces.
Agent365 span exporter for Agent365:
* Partitions spans by (tenantId, agentId)
* Builds OTLP-like JSON: resourceSpans -> scopeSpans -> spans
* POSTs per group to https://{endpoint}/maven/agent365/agents/{agentId}/traces?api-version=1
* Adds Bearer token via token_resolver(agentId, tenantId)
.../microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/config.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 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/exporters/agent365_exporter.py:1
- The copyright header format is inconsistent with the required format. It should be 'Copyright (c) Microsoft Corporation.' followed by 'Licensed under the MIT License.' on separate lines per coding guidelines.
# Copyright (c) Microsoft. All rights reserved.
libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py:41
- The class docstring should be updated to reflect the conditional endpoint path logic. Line 39 states it always POSTs to '/maven/agent365/agents/{agentId}/traces', but with the new
use_s2s_endpointparameter, it can also POST to '/maven/agent365/service/agents/{agentId}/traces'.
"""
Agent365 span exporter for Agent365:
* Partitions spans by (tenantId, agentId)
* Builds OTLP-like JSON: resourceSpans -> scopeSpans -> spans
* POSTs per group to https://{endpoint}/maven/agent365/agents/{agentId}/traces?api-version=1
* Adds Bearer token via token_resolver(agentId, tenantId)
"""
tests/test_agent365_exporter.py:1
- The copyright header format is inconsistent with the required format. It should be 'Copyright (c) Microsoft Corporation.' followed by 'Licensed under the MIT License.' on separate lines per coding guidelines.
# Copyright (c) Microsoft. All rights reserved.
task
Support S2S