MCPcopy Index your code
hub / github.com/google/adk-python / ApiServerSpanExporter

Class ApiServerSpanExporter

src/google/adk/cli/api_server.py:313–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311
312
313class ApiServerSpanExporter(export_lib.SpanExporter):
314
315 def __init__(self, trace_dict):
316 self.trace_dict = trace_dict
317
318 def export(
319 self, spans: typing.Sequence[ReadableSpan]
320 ) -> export_lib.SpanExportResult:
321 for span in spans:
322 if (
323 span.name == "call_llm"
324 or span.name == "send_data"
325 or span.name.startswith("execute_tool")
326 ):
327 attributes = dict(span.attributes)
328 attributes["trace_id"] = span.get_span_context().trace_id
329 attributes["span_id"] = span.get_span_context().span_id
330 if attributes.get("gcp.vertex.agent.event_id", None):
331 self.trace_dict[attributes["gcp.vertex.agent.event_id"]] = attributes
332 return export_lib.SpanExportResult.SUCCESS
333
334 def force_flush(self, timeout_millis: int = 30000) -> bool:
335 return True
336
337
338class InMemoryExporter(export_lib.SpanExporter):

Callers 1

get_fast_api_appMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected