Install the New Relic Ruby agent in a Google App Engine (GAE) flexible environment using either GAE's native mode or a custom Docker runtime.
Prerequisites
Requirement | Details |
|---|---|
New Relic account | You need a New Relic account and your . |
Google Cloud project | A Google Cloud Platform project with an App Engine application created. See Google App Engine procedures for Ruby. |
Google Cloud SDK | The |
Ruby version | See Ruby agent requirements and supported frameworks for supported versions. |
Install the gem and configure your app
Add the newrelic_rpm gem to your Gemfile:
gem 'newrelic_rpm'Then run:
$bundle installWhen using GAE native mode, you provide your app code and an app.yaml. GAE deploys to a standard prebuilt Docker image automatically. No additional Dockerfile is needed.
If your app needs specific libraries or headers, use a custom runtime. Create a Dockerfile and set app.yaml to:
runtime: customenv: flexNew Relic recommends the custom runtime method. It also recommends that you allow Google App Engine to handle health checks.
Configure the agent
Download newrelic.yml from the New Relic GitHub repository and copy it into the config directory of your application.
Set the two required values:
Set
license_keyto your .Set
app_nameto a meaningful name for your application.For all other configuration options, see Ruby agent configuration.
Deploy and verify
Deploy your app using the gcloud CLI:
$gcloud app deployWait until the deployment completes. Send at least two requests, then wait 2–3 minutes and open one.newrelic.com > APM to look for your app by name.
Tip
App not appearing? See No data appears (Ruby).
Related articles
- Ruby agent requirements and supported frameworks — Supported Ruby versions.
- Ruby agent configuration — All available configuration settings.
- Google App Engine documentation for Ruby — GAE flex reference.