Type to search.

OpenTracing API

Serverless Observability

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

APM Agent Ruby

The Elastic APM Ruby agent enables you to trace the execution of operations in your Ruby applications, sending performance metrics and errors to the Elastic APM Server.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

The Elastic APM OpenTracing bridge allows to create Elastic APM Transactions and Spans, using the OpenTracing API. In other words, it translates the calls to the OpenTracing API to Elastic APM and thus allows for reusing existing instrumentation.

The first span of a service will be converted to an Elastic APM Transaction, subsequent spans are mapped to Elastic APM Span.

This bridge allows for different operation modes in combination with the Elastic APM Agent.

  • Noop
    If no Elastic APM agent is running, the bridge is in noop mode and does not actually record and report spans.
  • Mix and Match
    If you want to leverage the auto instrumentation of Elastic APM, but also want do create custom spans or use the OpenTracing API to add custom tags to the spans created by Elastic APM, you can just do that. The OpenTracing bridge and the standard Elastic APM API interact seamlessly.
  • Manual instrumentation
    If you don’t want Elastic APM to auto-instrument known frameworks, but instead only rely on manual instrumentation, disable the auto instrumentation setting the configuration option instrument to false.

Either require 'elastic_apm/opentracing' during the boot of your app or specify the require: argument to your Gemfile, eg. gem 'elastic_apm', require: 'elastic_apm/opentracing'.

Ruby
::OpenTracing.global_tracer = ElasticAPM::OpenTracing::Tracer.new

Elastic APM defines some tags which are not included in the OpenTracing API but are relevant in the context of Elastic APM.

  • type - sets the type of the transaction, for example request, ext or db
  • user.id - sets the user id, appears in the "User" tab in the transaction details in the Elastic APM app
  • user.email - sets the user email, appears in the "User" tab in the transaction details in the Elastic APM app
  • user.username - sets the user name, appears in the "User" tab in the transaction details in the Elastic APM app
  • result - sets the result of the transaction. Overrides the default value of success. If the error tag is set to true, the default value is error.

Not all features of the OpenTracing API are supported.

This bridge only supports the format OpenTracing::FORMAT_RACK, using HTTP headers with capitalized names, prefixed with HTTP_ as Rack does it.

OpenTracing::FORMAT_BINARY is currently not supported.

Currently, this bridge only supports child_of references. Other references, like follows_from are not supported yet.

The Span.set_baggage method is not supported. Baggage items are dropped with a warning log message.

Logs are currently not supported.