Skip to content

feat: propagate OTel context in async ops and fix TransportProtocol config injection#707

Open
ehsavoie wants to merge 1 commit intoa2aproject:mainfrom
ehsavoie:issue_698
Open

feat: propagate OTel context in async ops and fix TransportProtocol config injection#707
ehsavoie wants to merge 1 commit intoa2aproject:mainfrom
ehsavoie:issue_698

Conversation

@ehsavoie
Copy link
Collaborator

@ehsavoie ehsavoie commented Mar 5, 2026

  • Replace direct TransportProtocol enum injection in AgentCardProducer with String injection + TransportProtocol.fromString() to avoid SmallRye Config's HyphenateEnumConverter failing on "HTTP+JSON" values passed via -D flags
  • Add AsyncManagedExecutorProducer to the OpenTelemetry extras module, using MicroProfile ManagedExecutor to propagate OTel trace context across async boundaries (priority 20, overrides default AsyncExecutorProducer)
  • Add microprofile-context-propagation-api dependency to opentelemetry/server

Fixes #698 🦕

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the A2A framework by improving configuration flexibility and adding OpenTelemetry context propagation for asynchronous operations. It addresses an issue with enum conversion and introduces a managed executor to ensure proper tracing in asynchronous environments.

Highlights

  • Transport Protocol Configuration: Replaced direct TransportProtocol enum injection with String injection and TransportProtocol.fromString() to handle hyphenated enum values passed via command-line flags.
  • OpenTelemetry Context Propagation: Added AsyncManagedExecutorProducer to the OpenTelemetry extras module to propagate OTel trace context across asynchronous boundaries using MicroProfile ManagedExecutor.
  • Dependency Update: Added microprofile-context-propagation-api dependency to the opentelemetry/server module.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces two main changes. First, it addresses a configuration issue with TransportProtocol enums containing a '+' by changing the injection from an enum to a String and parsing it manually. This is a solid workaround. Second, it enhances the OpenTelemetry integration by adding an alternative AsyncExecutorProducer that uses a ManagedExecutor to ensure OTel context propagation across async operations. This is a significant improvement for observability in asynchronous code. The changes are well-implemented, documented in a new README, and accompanied by a comprehensive set of unit tests. My only suggestion is a minor correction in the new README file to ensure the documented error message matches the one in the code.

…onfig injection

- Replace direct TransportProtocol enum injection in AgentCardProducer with
  String injection + TransportProtocol.fromString() to avoid SmallRye Config's
  HyphenateEnumConverter failing on "HTTP+JSON" values passed via -D flags
- Add AsyncManagedExecutorProducer to the OpenTelemetry extras module, using
  MicroProfile ManagedExecutor to propagate OTel trace context across async
  boundaries (priority 20, overrides default AsyncExecutorProducer)
- Add microprofile-context-propagation-api dependency to opentelemetry/server

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
@salaboy
Copy link

salaboy commented Mar 7, 2026

@ehsavoie amazing stuff!

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.

[Feat]: Propagate open telemetry context to agent execution for consolidated tracing

2 participants