Skip to content
Merged
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
3 changes: 3 additions & 0 deletions tests/test_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def test_local_cache_limits_preserve_cloud_spans_annotations_and_dumps(
token = context_api.attach(context_api.Context())
try:
with otel_tracer.start_as_current_span("invocation") as invocation:
assert invocation.attributes["era.span_type"] == "root"
assert (
context_api.get_value("suppress_language_model_instrumentation") is True
)
Expand All @@ -119,6 +120,8 @@ def test_local_cache_limits_preserve_cloud_spans_annotations_and_dumps(
assert spans[2].attributes["gen_ai.output"] == payload
assert spans[3].attributes["gen_ai.span.kind"] == "agent"
assert spans[4].attributes["gen_ai.span.kind"] == "workflow"
assert spans[4].attributes["era.span_type"] == "root"
assert all("era.span_type" not in span.attributes for span in spans[:4])
assert spans[4].attributes["gen_ai.usage.total_tokens"] == 0
assert tracer.trace_id == format(invocation.context.trace_id, "032x")
cache = tracer._inmemory_exporter._exporter
Expand Down
1 change: 1 addition & 0 deletions veadk/tracing/telemetry/exporters/inmemory_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def on_start(self, span, parent_context) -> None:
"""
annotate_request_start(span)
if span.name.startswith("invocation"):
span.set_attribute("era.span_type", "root")
span.set_attribute("gen_ai.operation.name", "chain")
span.set_attribute("gen_ai.span.kind", "workflow")
span.set_attribute("gen_ai.usage.total_tokens", 0)
Expand Down
Loading