Skip to content

Commit 0978b57

Browse files
committed
add comment to explain why we need logger in span exporter for ai agent observability
1 parent 8256c85 commit 0978b57

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_configurator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ def _customize_span_exporter(span_exporter: SpanExporter, resource: Resource) ->
361361

362362
if isinstance(span_exporter, OTLPSpanExporter):
363363
if is_agent_observability_enabled():
364+
# Span exporter needs an instance of logger provider in ai agent
365+
# observability case because we need to split input/output prompts
366+
# from span attributes and send them to the logs pipeline per
367+
# the new Gen AI semantic convention from OTel
368+
# ref: https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-events/
364369
span_exporter = OTLPAwsSpanExporter(endpoint=traces_endpoint, logger_provider=get_logger_provider())
365370
else:
366371
span_exporter = OTLPAwsSpanExporter(endpoint=traces_endpoint)

0 commit comments

Comments
 (0)