Span Node¶
- class ibm_watsonx_gov.traces.span_node.SpanNode(service_name: str, agentic_app: AgenticApp | None, span)¶
Bases:
object
Class to represent the structure of a single span and its children.
- find_nodes_with_name(name: str) list[SpanNode] ¶
Depth First Search to find the nodes with span name provided.
- Parameters:
name (str) – The span name to find
- Returns:
The list of nodes matching the criteria.
- Return type:
list[SpanNode]
- get_conversation_id() str ¶
Returns the conversation id from this span
- Returns:
The conversation id
- Return type:
str
- get_interaction_id() str ¶
Returns the interaction id from this span
- Returns:
The interaction id
- Return type:
str
- get_mapping_value(mapping_item: MappingItem) Any | None ¶
Gets the mapping value specified by a single mapping item from the span.
- Parameters:
mapping_item (MappingItem) – The mapping item containing the json path etc.
- Raises:
ValueError –
If the mapping item is not correct. 2. When mapping item type is span, and more than one spans OR no spans match the criteria.
- Returns:
If found, the value from the span corresponding to the mapping item provided.
- Return type:
Any | None
- get_nodes_configuration() dict ¶