I’m trying to wrap every external API call made by our Data Actions in OpenTelemetry spans. Specifically, I need to disconnect a specific participant from an active conference call to simulate a “transfer on hold” flow while keeping the trace context alive.
The issue is that when I call the disconnect endpoint, the parent span ends prematurely, or the traceparent header seems to get stripped before the request hits the Genesys Cloud edge.
Here’s the Python snippet I’m using in the Data Action handler:
import requests
from opentelemetry import trace
from opentelemetry.propagate import inject
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("disconnect_participant") as span:
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
# Inject OTel context into headers
inject(headers)
url = f"https://api.mypurecloud.com/api/v2/conversations/calls/{conversation_id}/participants/{participant_id}"
# Using DELETE to remove participant
response = requests.delete(url, headers=headers)
span.set_attribute("http.status_code", response.status_code)
if response.status_code != 204:
span.record_exception(Exception(response.text))
I’m getting a 204 No Content back, which is correct for a successful disconnect. But in Jaeger, the child span for this request shows status: ERROR because the HTTP client library thinks the empty body is a failure, or maybe the context injection is failing silently.
Also, I noticed that if I use PATCH with "status": "disconnected" in the body instead of DELETE, the trace propagates correctly. Is there a specific reason the DELETE method on this endpoint drops the trace context? Or is this just a quirk of how the Genesys API handles idempotent deletes?
We’re using the opentelemetry-api version 1.24.0. The traceparent header is definitely present in the outgoing request when I log it locally, but the backend span never links to the parent in the UI.