• /
  • EnglishEspañolFrançais日本語한국어Português
  • 로그인지금 시작하기

No data with Kubernetes APM auto-attach

Problem

You are using the New Relic Ruby agent with the Kubernetes APM auto-attach for a non-Rails framework (like Sinatra), but no APM data is appearing in your New Relic account.

Solution

Explicitly call Bundler.require early in your application's startup process.

For many frameworks, this can be done by adding it to your main application file or a config.ru file before your application classes are defined.

Example (config.ru or app.rb):

# config.ru
require 'bundler'
Bundler.require
# ... rest of your application's startup code
require_relative './my_sinatra_app'
run MySinatraApp

After adding this code, redeploy your application. Data should begin appearing in New Relic within a few minutes.

Cause

The Kubernetes APM auto-attach works by patching the Bundler::Runtime#require method to inject the newrelic_rpm gem into your application.

While Rails applications automatically call Bundler.require during their boot process, many other frameworks do not. If Bundler.require is never called, the New Relic agent is never loaded into your application's environment. Adding this line ensures the agent is loaded as expected.

Copyright © 2025 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.