Jaeger integration

edit

This documentation refers to the standalone (legacy) method of running APM Server. This method of running APM Server will be deprecated and removed in a future release. Please consider upgrading to the Elastic APM integration. If you’ve already upgraded, please see Integrate with Jaeger instead.

Elastic APM integrates with Jaeger, an open-source, distributed tracing system. This integration allows users with an existing Jaeger setup to switch from the default Jaeger backend, to the Elastic Stack — transform data with APM Server, store data in Elasticsearch, and visualize traces in the Kibana APM app. Best of all, no instrumentation changes are needed in your application code.

Get started
edit

Connect your preexisting Jaeger setup to Elastic APM in three steps:

There are caveats to this integration.

Configure Jaeger agents
edit

APM Server serves Jaeger gRPC over the same host and port as the Elastic APM agent protocol.

  1. Log into Elastic Cloud and select your deployment. Copy your APM endpoint and APM Server secret token; you’ll need these in the next step.
  2. Configure APM Server as a collector for your Jaeger agents.

    As of this writing, the Jaeger agent binary offers the following CLI flags, which can be used to enable TLS, output to Elastic Cloud, and set the APM Server secret token:

    --reporter.grpc.tls.enabled=true
    --reporter.grpc.host-port=<apm-endpoint:443>
    --agent.tags="elastic-apm-auth=Bearer <secret-token>"

For the equivalent environment variables, change all letters to upper-case and replace punctuation with underscores (_). See the Jaeger CLI flags documentation for more information.

Configure Sampling
edit

APM Server supports probabilistic sampling, which can be used to reduce the amount of data that your agents collect and send. Probabilistic sampling makes a random sampling decision based on the configured sampling value. For example, a value of .2 means that 20% of traces will be sampled.

There are two different ways to configure the sampling rate of your Jaeger agents:

APM Agent central configuration (default)
edit

Central sampling, with APM Agent central configuration, allows Jaeger clients to poll APM Server for the sampling rate. This means sample rates can be configured on the fly, on a per-service and per-environment basis.

Visit the Agent configuration page in the APM app to add a new sampling rate.

Local sampling in each Jaeger client
edit

If you don’t have access to the APM app, you’ll need to change the Jaeger client’s sampler.type and sampler.param. This enables you to set the sampling configuration locally in each Jaeger client. See the official Jaeger sampling documentation for more information.

Start sending span data
edit

That’s it! Data sent from Jaeger clients to the APM Server can now be viewed in the APM app.