Skip to content

Conversation

aabmass
Copy link
Member

@aabmass aabmass commented Sep 12, 2025

Description

Introduces an interface for the generic GenAI upload hook. See SemConv uploading content to external storage. It also adds an entry point and environment variable to load an upload hook.

Instrumentations should load the hook with load_upload_hook() and call it before ending the span as described in semconv.

The upload hook implementor is responsible for implementing batching and backpressure if they choose to do so.

Part of #3065, #3753

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added a unit test for the loading logic

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated -- would prefer to update changelogs once the feature is done
  • Unit tests have been added
  • Documentation has been updated

@aabmass aabmass marked this pull request as ready for review September 12, 2025 05:39
@aabmass aabmass requested a review from a team as a code owner September 12, 2025 05:40
Copy link
Member Author

@aabmass aabmass left a comment

Choose a reason for hiding this comment

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

Thanks for the reviews. I tweaked this a little to expect the entrypoint to return a UploadHook class instance which has an upload() method.

@aabmass aabmass added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Sep 15, 2025
@DylanRussell
Copy link
Contributor

LGTM

@aabmass aabmass merged commit 7eb9203 into open-telemetry:main Sep 15, 2025
632 of 633 checks passed
@aabmass aabmass deleted the genai-upload-defs branch September 15, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants