updateCurrentSpan()
Update name, status, attributes, and Respan params on the current span
Overview
updateCurrentSpan() allows you to modify the currently active span’s metadata, status, attributes, and Respan-specific parameters.
Signature
Basic Usage
Update Status
Custom Attributes
Respan Parameters
Dynamic Span Naming
Comprehensive Update
Parameters
respan_params
Respan-specific parameters for filtering and grouping
customer_identifier
Customer or user identifier for filtering traces by customer
trace_group_identifier
Group identifier for organizing related traces
metadata
Custom metadata for additional context
attributes
Custom OpenTelemetry attributes (key-value pairs)
status
Span status: "OK" or "ERROR"
name
New name for the span (useful for dynamic naming)
Best Practices
- Update spans with customer identifiers for user-specific filtering
- Set status to ERROR when operations fail
- Use attributes for technical details (HTTP status, DB queries, etc.)
- Use Respan metadata for business context (order IDs, ticket numbers, etc.)
- Update spans early in the function with identifying information
- Only call within an active span