Skip to content

LLO Handler Setup w/ Lazy Initialization #394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

yiyuan-he
Copy link
Contributor

What does this pull request do?

Sets up our new LLOHandler which will be used extract input/output prompt data from spans and send them to the logs pipeline.

We choose lazy loading because it solves an initialization order issue where OTLPAwsSpanExporter initialization may fail when AGENT_OBSERVABILITY_ENABLED=true because the logger provider is not ready yet.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@yiyuan-he yiyuan-he requested a review from a team as a code owner June 12, 2025 23:11
@yiyuan-he yiyuan-he force-pushed the setup-llo-handler branch from 8f2777d to 9e4c375 Compare June 12, 2025 23:17
@yiyuan-he yiyuan-he force-pushed the setup-llo-handler branch from 9e4c375 to 2a9672c Compare June 12, 2025 23:48
try:
self._logger_provider = get_logger_provider()
except Exception: # pylint: disable=broad-exception-caught
return False
Copy link
Member

@mxiamxia mxiamxia Jun 20, 2025

Choose a reason for hiding this comment

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

Please add a debug log when the logger provider can't be retrieved. this will help us diagnose cases where GenAI events don't appear because of it."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense - added a debug log here

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.

2 participants