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?
with Elastic agent API: create a span and store it as a context field, then use an ingest pipeline to modify the stored document with the appropriate span.db.statement field value.
with OpenTelemetry API: create a span and follow the semantic conventions for databases, use the db.statement attribute to store the query.
Disclamer: I haven't tried it myself, and some experimentation might be needed here.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.