question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Populate span.db.link/span.db.instance

See original GitHub issue

Is 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:open
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
axwcommented, Oct 31, 2019

db.link is the hostname

db.link is meant to hold the database link name, e.g. https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_5005.htm

We’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

0reactions
AE777F63commented, Nov 1, 2019

I can start with mongo and postgres to make sure we cover your case first, then get to the others later.

Cool, thanks. Although given what @axw said, I suppose db.link is not really relevant for mongo, right? Not sure about postgres.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing High-Performance Code Using Span<T> and Memory ...
The following code snippet shows how you can create a byte array in the managed memory and then create a span instance out...
Read more >
Populating span/div with database record - Stack Overflow
I want to be able to query a database and if there is a record in it to show the record in the...
Read more >
Traces | OpenTelemetry
A client span represents a synchronous outgoing remote call such as an outgoing HTTP request or database call. Note that in this context,...
Read more >
instana-java-sdk/Span.java at master - GitHub
A span can either capture an exit, where this. * process currently communicates with an external resource such as a database, or an...
Read more >
Tutorial: Create a VPC for use with a DB instance (IPv4 only)
Create a virtual private cloud (VPC) with public and private subnets to host a public web server and a private DB instance.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found