Provide support for creating "traces" during the execution of indexing and search queries, so that users can get collect that data and get insights into the behavior of their application ("what is taking so long?"/"which of my business operations are the most resource-intensive?"/...)
The hope is that it would replace Hibernate Search 5's JMX statistics support advantageously.
One challenge will be to forward the tracing context to background threads, since most indexing (and ES querying) is done in a different thread than the client thread.
Regarding the forwarding of tracing contexts to background threads, at least with opentracing it seems possible.
OpenTracing has a concept of “references” between spans. See https://opentracing.io/specification/
At the moment there are two types of references: “child of” (~ method call, the parent waits for the child span to finish) and “forwards” (~ notification, the parent doesn’t care about the child span).
Interestingly, it would seem that a given span can have multiple references of the same type. So hopefully, when a bulk request is created that groups multiple indexing requests from multiple threads, we will be able to create a new span that references spans from all these threads? That would fit our use case perfectly…