Class TelemetryReader
TelemetryReader provides access to OpenTelemetry spans collected by the in-memory span exporter during integration tests. This allows you to verify workflow execution, agent interactions, and other instrumented operations.
-
Constructor Summary
ConstructorsConstructorDescriptionTelemetryReader(akka.runtime.sdk.spi.tracing.InMemorySpanExporter inMemorySpanExporter) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the list of agents that were invoked during an operation.getAgentTools(String debugId) Retrieves the list of tools used by agents during an operation.getWorkflowSteps(Class<? extends akka.javasdk.workflow.Workflow<?>> workflow, String workflowId) Retrieves the sequence of workflow steps executed for a specific workflow instance.getWorkflowSteps(String debugId) Retrieves the sequence of workflow steps executed for an operation traced by a debug ID.
-
Constructor Details
-
TelemetryReader
public TelemetryReader(akka.runtime.sdk.spi.tracing.InMemorySpanExporter inMemorySpanExporter)
-
-
Method Details
-
getWorkflowSteps
@ApiMayChange public List<String> getWorkflowSteps(Class<? extends akka.javasdk.workflow.Workflow<?>> workflow, String workflowId) Retrieves the sequence of workflow steps executed for a specific workflow instance.Returns a list of step names in the order they were executed, based on telemetry data collected during the workflow execution. This is useful for verifying that workflows execute the expected steps in the correct order.
- Parameters:
workflow- The workflow class to queryworkflowId- The unique identifier of the workflow instance- Returns:
- A list of step names in execution order, or an empty list if no steps were found
-
getAgents
Retrieves the list of agents that were invoked during an operation.Returns a list of agent IDs in the order they were invoked, based on telemetry data collected during test execution. This is useful for verifying that the expected agents were called during a test scenario.
- Parameters:
debugId- The debug identifier used to trace the operation- Returns:
- A list of agent IDs in invocation order, or an empty list if no agents were found
-
getAgentTools
Retrieves the list of tools used by agents during an operation.Returns a list of tool names in the order they were invoked, based on telemetry data collected during test execution. This is useful for verifying that agents used the expected tools to accomplish their tasks.
- Parameters:
debugId- The debug identifier used to trace the operation- Returns:
- A list of tool names in invocation order, or an empty list if no tools were found
-
getWorkflowSteps
Retrieves the sequence of workflow steps executed for an operation traced by a debug ID.Returns a list of step names in the order they were executed, based on telemetry data collected during workflow execution. This method uses the debug ID to find all spans associated with the traced operation, making it useful when you don't have direct access to the workflow class or workflow ID.
- Parameters:
debugId- The debug identifier used to trace the workflow execution- Returns:
- A list of step names in execution order, or an empty list if no steps were found
-