Signature
Copy
set_context_value(key: str, value: Any) -> bool
True if the value was set successfully.
Example
Copy
from respan_tracing import RespanTelemetry, workflow, get_client
telemetry = RespanTelemetry(api_key="your-api-key")
@workflow(name="set_context")
def set_context():
client = get_client()
client.set_context_value("session.id", "abc-123")
client.set_context_value("user.tier", "premium")
# Read it back
session = client.get_context_value("session.id")
print(session) # "abc-123"
return True
set_context()