Populate span.db.link/span.db.instance
See original GitHub issueIs your feature request related to a problem? Please describe. The name/URL of the database is not stored in “db” events.
Describe the solution you’d like span.db.link and span.db.instance should be set accordingly.
Describe alternatives you’ve considered Using filters; this cannot be done reliably if more than one database is used (in mongodb case, at least), since the underlying database object cannot be obtained from within the filter.
As a side note, it would be nice to have exposed, monkey-patch-able methods that would allow users to access the underlying context and extend the reports if need be, e.g.
span = agent.startSpan(ns + '.' + name, 'db', 'mongodb', 'query')
could become something like
span = _startSpan(this, name);
module.exports._startSpan (context, name) {
return agent.startSpan(context.ns + '.' + name, 'db', 'mongodb', 'query');
}
Same applies for http-shared.js:traceOutgointRequest. This is obviously not as good as having the fields you need supported by the agent natively, and to some extent this approach is limited by apm-server’s schema, but still.
Additional context https://github.com/elastic/apm-server/blob/056276511a1f8327992302267b010ac4e9c04511/docs/data/elasticsearch/generated/spans.json#L194 https://github.com/elastic/apm-server/issues/2478
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
db.link
is meant to hold the database link name, e.g. https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_5005.htmWe’ll be adding a new field for capturing the destination address, which we would ideally populate with the database hostname: https://github.com/elastic/apm/issues/115
Cool, thanks. Although given what @axw said, I suppose db.link is not really relevant for mongo, right? Not sure about postgres.