Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrument the @elastic/elasticsearch module #968

Closed
watson opened this issue Apr 1, 2019 · 1 comment · Fixed by #1877
Closed

Instrument the @elastic/elasticsearch module #968

watson opened this issue Apr 1, 2019 · 1 comment · Fixed by #1877
Assignees
Labels
agent-nodejs Make available for APM Agents project planning. enhancement
Milestone

Comments

@watson
Copy link
Contributor

watson commented Apr 1, 2019

The new Elasticsearch client has been moved to the @elastic npm namespace, so its name is now @elastic/elasticsearch.

This is a complete rewrite of the client and I therefore assume the old instrumentation code doesn't work with it. So this is essentially a new instrumentation.

@gingerwizard
Copy link

gingerwizard commented Nov 2, 2020

Kibana has now been instrumented using the node APM agent. Currently, Kibana uses a the old client but is migrating to this new @elastic/elasticsearch module.

The ES performance team are looking to use Kibana's instrumentation data to capture the requests made to Elasticsearch. Without this auto-instrumentation, we will need to instrument Kibana ourselves as the _search and _async_search endpoints (the primary ones of interest) are already using this new client.

trentm added a commit that referenced this issue Dec 16, 2020
This adds automatic instrumentation of the new (for a while now) Elasticsearch
client for node.js.

The instrumentation of the legacy "elasticsearch" package has also changed
slightly to commonalize:
* "span.context.destination" is set on all Elasticsearch spans, not just a
  subset of query-like API endpoints.
* For query-like API endpoints (e.g. `/_search`), the capturing of query details
  on "span.context.db.statement" has changed (a) to include *both* the
  query params and the request body if both exist (separated by `\n\n`) and
  (b) to *URL encode* the query params, rather than JSON encoding.
* Add _sql and _eql to set of endpoints capturing the query.

Also, fix 'error.exception.module' heuristic to correctly handle @-namespaced
modules.

Fixes: #968
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
@zube zube bot removed the [zube]: Done label Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning. enhancement
Projects
None yet
4 participants