Skip to content

feat(bedrock): implement emitting events in addition to current behavior #2885

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 4 commits into
base: main
Choose a base branch
from

Conversation

LuizDMM
Copy link

@LuizDMM LuizDMM commented May 5, 2025

✅ PR Requirements

  • I have added tests that cover my changes.
  • If adding a new instrumentation or changing an existing one, I've added screenshots from some observability platform showing the change.
  • PR name follows conventional commits format: feat(instrumentation): ... or fix(instrumentation): ....
  • (If applicable) I have updated the documentation accordingly.

📌 Issue Requirements

  • Make sure to keep the current way of emitting events and the new (event-based) way with the official semantic
  • Add a config to each instrumentation called use_legacy_attributes which defaults to true, and if set to false emit events instead of the prompt / completion attributes.
  • Propagate a new initialization parameter of the SDK called use_legacy_attributes that sets this config in all instrumentations.

LuizDMM added 2 commits May 3, 2025 08:14
…o current behavior

* Add "use_legacy_attributes" to Config and the Instrumentor constructor, defaulting to True;
* emit events for user prompts and AI responses, following [OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-events/\\\);
* introduce a privacy safeguard by checking the OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT environment variable to enable or disable content capture in events;
* implement comprehensive tests to verify the new functionality and ensure that, when use_legacy_attributes == True, the existing behavior remains unchanged;
- Introduce TypedDicts and dataclasses to standardize inputs for event handling;
- Move `event_logger` to Config to centralize configuration and reduce complexity;
- Add `emit_event` method to encapsulate all event emission logic via `Event` instances;
- Refactor instrumentation to use `emit_event`, improving clarity and maintainability.
Copy link
Contributor

ellipsis-dev bot commented May 5, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@LuizDMM LuizDMM changed the title feat(bedrock): implement emitting events in addition to current behaviour feat(bedrock): implement emitting events in addition to current behavior May 5, 2025
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.

1 participant