Skip to content

[WIP/Draft] Change OpenAI, Botocore instrumentors to pass whole SpanContext to Logs/Events API #3528

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3474](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3474))
- `opentelemetry-instrumentation-fastapi`: Drop support for FastAPI versions earlier than `0.92`
([#3012](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3012))
- `opentelemetry-instrumentation-botocore`, `opentelemetry-instrumentation-openai-v2`: Update Events API usage
([#3528](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3528))

## Version 1.33.0/0.54b0 (2025-05-09)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
server_attributes as ServerAttributes,
)
from opentelemetry.trace import Span, SpanKind, Tracer
from opentelemetry.trace.span import SpanContext

from .instruments import Instruments
from .utils import (
Expand Down Expand Up @@ -404,9 +405,7 @@ def cleanup(self):
name="gen_ai.choice",
attributes=event_attributes,
body=body,
trace_id=span_ctx.trace_id,
span_id=span_ctx.span_id,
trace_flags=span_ctx.trace_flags,
span_context=span_ctx,
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,7 @@ def _converse_on_success(
span_ctx = span.get_span_context()
event_logger.emit(
choice.to_choice_event(
trace_id=span_ctx.trace_id,
span_id=span_ctx.span_id,
trace_flags=span_ctx.trace_flags,
span_context=span_ctx,
)
)

Expand Down
Loading