The OpenDistro docs here show that you can attach an X-Opaque-Id header to a request and the response headers should return it. This is not happening on my AWS Elasticsearch Service (v 7.9). The headers are sometimes showing up in the task list, but not in the response headers. I’m unable to use the task cancellation API because my searches do not retain the X-Opaque-Id headers. By contrast, our cluster running vanilla Elasticsearch (not OpenDistro) on EC2 handles this just fine.
❮ curl -i --http1.1 -H 'X-Opaque-Id: 12345' --basic -u "${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" "${ELASTICSEARCH_URL}/_tasks?group_by=parents"
HTTP/1.1 200 OK
Date: Wed, 18 Aug 2021 02:27:56 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 19373
Connection: keep-alive
Access-Control-Allow-Origin: *