We’re trying to stitch together the full distributed trace for a CXone Studio flow that hits an internal SQL database via the DBConnector action. The goal is to have the span created in Studio continue into our backend service, which processes the DB results.
Currently, the Studio script executes the DBConnector action to run a stored procedure. The action succeeds, and we get the result set in result.Data. The problem is the traceparent header we’re injecting into the Studio context isn’t making it to the backend service that the DBConnector talks to.
Here’s the snippet logic:
ASSIGN traceContext = GetContext("otel.traceparent")
// Attempt to pass it as a parameter to the DBConnector
ASSIGN dbParams = {
"queryId": "lookupCustomer",
"params": {
"customerId": ${contact.Id},
"_traceContext": ${traceContext}
}
}
DBConnector.Execute(dbParams)
The backend service expects the trace context in the HTTP headers of the request coming from the CXone platform, not as a SQL parameter. I’ve looked at the DBConnector action definition, and there’s no obvious way to inject custom HTTP headers into the outbound call that the connector makes to our API gateway.
Is there a way to configure the DBConnector endpoint to accept and forward custom headers? Or should we be using a GetRESTProxy action instead to manually handle the HTTP request and span propagation?
We’ve tried setting the header in the Studio flow context, but that only persists within the Studio runtime, not across the network boundary to our DB middleware.
Any ideas on how to bridge this gap without rewriting the Studio flow to use pure REST calls? We need the performance of the DBConnector but the observability of OTel.