newrelic / newrelic-ruby-agent

New Relic RPM Ruby Agent

Home Page:https://docs.newrelic.com/docs/apm/agents/ruby-agent/getting-started/introduction-new-relic-ruby/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

k8s: Create injection script

kford-newrelic opened this issue · comments

Description

Create a script written in Go that is responsible for injecting agent code into the customer's application container(s).

The newrelic-agent-operator repository is an OTel fork which already includes the Go scripts for a few languages, but not Ruby. Here are the other langauages scripts.

The Ruby agent code is injected into the customer’s application via a RUBYOPT environment variable that points to a setup script. This setup script uses the bundle add utility, which updates the dependency manifest and re-installs the dependencies.

Additionally, logic may need to be added to the injection script to not install the agent if an agent is already installed in the customer’s application container(s). For most agents this will likely be done by looking for the presents of certain environment variables within the customer’s application container. For example, a new relic license key. (This is very TBD at the moment-we will likely have a dedicated discussion about this and how we can/want to detect this.) The goal here is simply to not automatically install an agent into a container in which an application already has an agent installed.

Let's also consider contributing our Ruby script back to OTel.

Closed with #2635