grafana / beyla

eBPF-based autoinstrumentation of web applications and network metrics
https://grafana.com/oss/beyla-ebpf/
Apache License 2.0
1.19k stars 77 forks source link

More span attributes for DB / SQL span #788

Closed minhvu178 closed 1 week ago

minhvu178 commented 2 weeks ago

I saw that all of my DB spans only include db.operation and db.sql.table span attributes. Is there a way to add more span attributes for db/sql spans. Or at least include db.statement like OTEL_GO_AUTO_INCLUDE_DB_STATEMENT=true since Beyla is built on top of opentelemetry-go-instrumentation

https://github.com/open-telemetry/opentelemetry-go-instrumentation/tree/main/examples/httpPlusdb

mariomac commented 2 weeks ago

Thanks for the request, @minhvu178 ! We will set the priority in our roadmap and come up to you when we solve the issue.

grcevski commented 1 week ago

Hi @minhvu178,

We've added this now in our main branch, although we don't have documentation yet on the new selective attributes feature which will come in the next release.

In the meantime, with our main branch you can now get the SQL statement with the following setting in the YAML configuration file:

attributes:
  select:
    traces:
      include:
      - db.statement