[Agent Server] Add managed OTLP gRPC export support#48106
Open
Shivakishore14 wants to merge 12 commits into
Open
[Agent Server] Add managed OTLP gRPC export support#48106Shivakishore14 wants to merge 12 commits into
Shivakishore14 wants to merge 12 commits into
Conversation
Use in-process HTTP/protobuf and gRPC receivers to verify traces, metrics, and logs through the public observability setup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2ddb2a79-14d1-4372-a29d-8a0c65a55b7b
Add Agent Server-managed OTLP gRPC exporter setup when customers configure OTEL_EXPORTER_OTLP_PROTOCOL=grpc, while leaving HTTP/protobuf export delegated to the Microsoft OpenTelemetry distro. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0c368201-b3c0-4a22-8311-2c288cbd374c
Apply Foundry enrichment during on_end and update the private attribute workaround for immutable BoundedAttributes so exported spans retain Agent Server metadata. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0c368201-b3c0-4a22-8311-2c288cbd374c
Keep span enrichment compatible with newer OpenTelemetry SDKs and tighten the OTLP gRPC exporter dependency to avoid slow resolver installs in apistub. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0c368201-b3c0-4a22-8311-2c288cbd374c
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Disable apistub for azure-ai-agentserver-core because the package has no public API surface changes and the gRPC exporter dependency causes the apistub wheel install to exceed the check timeout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0c368201-b3c0-4a22-8311-2c288cbd374c
Align the package version with the unreleased changelog entry and add Azure SDK docstring metadata for the OTLP gRPC helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0c368201-b3c0-4a22-8311-2c288cbd374c
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0c368201-b3c0-4a22-8311-2c288cbd374c
Shivakishore14
marked this pull request as ready for review
July 17, 2026 08:14
Shivakishore14
requested review from
RaviPidaparthi,
ankitbko and
vangarp
as code owners
July 17, 2026 08:14
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Shivakishore14
marked this pull request as draft
July 17, 2026 08:17
Keep apistub enabled for azure-ai-agentserver-core; the dependency constraint fix allows the check to complete. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0c368201-b3c0-4a22-8311-2c288cbd374c
…y' into otlp-protocol-regression-tests-copy
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Agent Server-managed OTLP/gRPC telemetry export while preserving the existing HTTP/protobuf path.
Changes:
- Configures gRPC exporters for traces, metrics, and logs.
- Adds loopback protocol regression tests and dependencies.
- Updates documentation, changelog, and package version.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
_tracing.py |
Implements managed gRPC export and enrichment handling. |
test_otlp_protocol.py |
Tests HTTP/protobuf and gRPC signal export. |
README.md |
Documents gRPC configuration. |
pyproject.toml |
Adds exporter dependency and build configuration. |
dev_requirements.txt |
Adds test dependencies. |
CHANGELOG.md |
Records the feature and tests. |
_version.py |
Bumps the package to 2.0.0b8. |
Comments suppressed due to low confidence (1)
sdk/agentserver/azure-ai-agentserver-core/pyproject.toml:64
- This disables ApiStubGen for the whole package, even though this package already tracks
api.md/api.metadata.ymland the repository requires the analyze job to produce a reviewable public API stub (doc/eng_sys_checks.md:336). The OTLP implementation only changes private internals, so this opt-out is unrelated and would allow future API changes to bypass APIView validation. Keep the check enabled.
Comment on lines
+5
to
+8
| ### Other Changes | ||
|
|
||
| - Added local OTLP HTTP/protobuf and gRPC protocol regression tests covering traces, metrics, and logs without requiring external collector infrastructure. | ||
| - Added Agent Server-managed OTLP/gRPC export when `OTEL_EXPORTER_OTLP_PROTOCOL=grpc` is configured. |
Constrain Agent Server OpenTelemetry dependencies to the microsoft-opentelemetry-compatible 1.43 line so apistub can install the wheel without resolver backtracking timeouts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0c368201-b3c0-4a22-8311-2c288cbd374c
Add Agent Server runtime dependencies to dev requirements so CI preinstalls them before apistub installs the package wheel. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0c368201-b3c0-4a22-8311-2c288cbd374c
Shivakishore14
marked this pull request as ready for review
July 17, 2026 10:13
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Comment on lines
+222
to
+224
| context = _without_otlp_env() if suppress_distro_otlp else nullcontext() | ||
| with context: | ||
| _setup_distro_export( |
Comment on lines
+347
to
+350
| def _resolve_otlp_protocol() -> str: | ||
| protocol = os.environ.get(_OTLP_PROTOCOL) or _OTLP_HTTP_PROTOBUF | ||
| normalized = protocol.strip().lower() | ||
| if normalized not in (_OTLP_HTTP_PROTOBUF, _OTLP_GRPC): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds Agent Server-managed OTLP/gRPC export support while keeping the default OTLP HTTP/protobuf path delegated to
microsoft-opentelemetry.OTEL_EXPORTER_OTLP_PROTOCOL=grpcand configures gRPC trace, metric, and log exporters from Agent Server.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines
Validation
azpysdk mindependency .: passesazpysdk devtest . --pytest-args tests/test_otlp_protocol.py tests/test_tracing.py::TestFoundryEnrichmentSpanProcessor: 15 passed