kibana/x-pack/plugins/fleet/dev_docs/tracing.md
2020-11-09 11:07:04 -05:00

2.6 KiB

Using APM for server traces

Kibana ships with the Elastic APM Node.js Agent built-in for debugging purposes. We don't currently merge this to release builds, but it can be very helpful to diagnose or confirm the flow & timing of a request traveling through multiple services.

To use it in Fleet,

  1. Import the shared apm instance as needed (HTTP handler, service layer, etc) import { apm } from '../path/to/ingest_manager/server'
  2. add apm.startTransaction and/or apm.startSpan
  3. start Kibana with APM enabled (as described in Instrumenting with Elastic APM)
    • via env variable or config/apm.dev.js ELASTIC_APM_ACTIVE=true yarn start

      or module.exports = { active: true, };

    • By default traces are sent to a remote server, but you can send to a local APM by setting the serverUrl value in config/apm.dev.js
    • TODO: document default server & credentials
  4. Run the code where you added the annotations e.g. make an HTTP request
  5. Go to /app/apm#/traces and see your trace search filter by host, transaction result, etc
    example screenshotScreen Shot 2020-05-19 at 9 06 15 PM