The Elastic Java agent is able to automatically capture "database" statement e.g. when firing a request to Elastic Search:
This happens in the Elastic Java agent instrumentation using the span.db.statement field. The main benefit over context fields is that this is nicely highlighted and more visible.
We're using our own GraphQL server implementation so no automatic instrumentation. While manually instrumenting our application I can only access transaction and span labels and context fields.
Is there any way I can set the span.db.statement field when manually instrumenting?
