Monitoring Ruby - The Instana Ruby gem

The Instana Ruby gem: Ruby Distributed Tracing & Metrics Sensor

Gem Version OpenTracing Badge

Ruby Supported Components


The instana gem is a zero configuration tool that will automatically collect key metrics and distributed traces from your Ruby processes. Just install and go.


The gem is available on Rubygems. To install, add this line to the end of your application's Gemfile:

gem 'instana'

And then execute:

$ bundle

Or install it yourself as:

$ gem install instana

Note: these methods also works on Cloud Foundry using the Cloud Foundry Ruby Buildpack. Additionally, since the Tile version 1.177.0, the instana_buildpack automates the setup of Ruby applications on Cloud Foundry. For more information, refer to the Instana Buildpack documentation.


For container based deployments, the Instana Ruby gem requires an ip binary available (such as from the iproute2 OS package). This requirement will be removed in a future version.


Although the gem has no configuration required for out of the box metrics and distributed tracing, individual components can be configured as needed. See the Ruby configuration page for more information.

Custom Tracing

If you wish to write your own instrumentation, this Ruby gem provides two options for custom tracing:

  1. Instana Ruby Tracing SDK
  2. OpenTracing

Want End User Monitoring?

Instana provides deep end user monitoring that links server side traces with browser events to give you a complete view from server to browser.

See the End User Monitoring page for more information.


Ruby sensor not installed

Monitoring issue type: ruby_sensor_not_installed

The Ruby process does not seem to include the instana Ruby gem, or the Ruby sensor cannot communicate with the Instana host agent.

To activate the Instana monitoring for Ruby, refer to the Installation section. If you are sure the Ruby gem is correctly installed, please refer to the more detailed Troubleshooting documentation for the Instana Ruby sensor.

Verify the process is instrumented

Make sure the instana gem is installed in your application and active. If the Ruby sensor is active, you will see the following entries in your application's logs:

Stan is on the scene.  Starting Instana instrumentation version #<version>

If you do not see this log, then the setup is not correct. Please refer to the Installation documentation.

If you do see the log message above, then it is very likely a network connectivity issue with the host agent, see the next section.

Verify the tracer can connect to the host agent

If the Ruby tracer is installed (refer to he previous section), verify that the Ruby process can connect to the host agent on the same host on port 42699. For more information on the required network visibility, refer to the Network requirements documentation for the Instana host agent.

What we see increasingly often, is that in containerized platforms either there are network visibility issues between the container with the application to be traced and the container of the Instana host agent; another issue of the same kind, due to some overlay network setup, the container of the application to be traced does not connect to the Instana agent container on the same host.

Often the problem is that the Ruby tracer is using the wrong ip address or DNS name to talk to the Instana agent. You can instruct the Ruby tracer to user a specific network address via the INSTANA_AGENT_HOST environment-variable.

In very few cases, we have seen customers that set up their networking so that the problem was not the network address, but the port the tracer uses. In case you need a port remapping, because the host agent does not listen on port 42699 but something else, you can instruct the tracer to use a different port via the INSTANA_AGENT_PORT environment variable.

In case none of the above helps you troubleshoot the issue, please open a Support Ticket.

Other issues

Seeing something unexpected or having trouble trying to configure something? See the Ruby Troubleshooting page for help.


To see the Instana Ruby gem release history, which also details the changes made in the Instana gem, please see the Github Releases page.

See Also