Actions6
- Dataset Actions
- Span Actions
- Feedback Actions
- Guardrail Actions
- Trace Actions
- Prompt Actions
Overview
This node interacts with the Opik API to log a span within a specified project and trace. It allows users to provide detailed information about the span, including its name, input and output data, metadata, usage statistics, error information, and tags. This is useful for tracking and analyzing operations within distributed tracing systems, especially in scenarios involving performance monitoring, debugging, and cost estimation of processes.
Use Case Examples
- Logging a span with custom start and end times to monitor a specific operation's duration.
- Adding metadata and tags to a span for easier filtering and analysis in the Opik system.
- Capturing LLM usage token counts within a span to track AI model usage and associated costs.
Properties
| Name | Meaning |
|---|---|
| Project Name or ID | Select the project to which the span belongs, either by choosing from a list or specifying an ID. |
| Trace ID | Identifier of the trace that the span is part of. |
| Span Name | Human-friendly name to identify the span. |
| Input Entries | Key-value pairs representing the input data for the span. |
| Output Key/Value Pairs | Key-value pairs representing the output data from the span. |
| Metadata Entries | Additional metadata key-value pairs associated with the span. |
| Additional Options | Various optional settings including cost version, custom start/end times, error details, model, parent span ID, provider, span ID, span type, tags, total estimated cost, and usage metrics. |
| Tags | Searchable tags added to the span for filtering. |
| LLM Usage | Token counts for prompt and completion tokens related to LLM calls. |
Output
JSON
trace_id- Identifier of the trace the span belongs to.name- Human-friendly name of the span.input- Input data key-value pairs for the span.output- Output data key-value pairs from the span.metadata- Metadata key-value pairs associated with the span.usageprompt_tokens- Number of prompt tokens used in LLM calls.completion_tokens- Number of completion tokens used in LLM calls.
error_info- Error information including message, type, and code.totalEstimatedCostVersion- Version identifier for the total estimated cost.endTime- Custom end time of the span.startTime- Custom start time of the span.model- Model identifier related to the span.parentSpanId- ID of the parent span to build a hierarchy.provider- Provider information related to the span.spanId- Custom or auto-generated span ID.spanType- Category of work performed within the span.tags- Tags for filtering the span.totalEstimatedCost- Cost associated with the span.
Dependencies
- An API key credential for Opik API authentication
Troubleshooting
- Ensure the Project Name or ID is correctly specified and accessible with the provided credentials.
- Verify that the Trace ID is valid and corresponds to an existing trace in the Opik system.
- Check that required fields like Span Name and Trace ID are not empty to avoid request failures.
- If using custom Span ID, ensure it is unique to prevent conflicts.
- When using custom start and end times, verify the date-time format is correct.
- If SSL certificate validation issues occur, consider enabling the option to ignore SSL issues, but be aware of security implications.
Links
- n8n Expressions Documentation - Documentation on how to use expressions in n8n node parameters.