Go to All Forums

Configs for Different Rails Environments

Hello,

How can we configure our Rails application.name in apminsight.conf to default to a different name per environment without manual configurations?

The goal is to differentiate Production, Staging, and Development data without manual intervention on each installation.

Can the conf file read in ENV variables somehow?  Something like this would work great for us (but doesn't work)

application.name=ourAppName-$RAILS_ENV

Thanks
~Nate


Like (1) Reply
Replies (2)

Hi Nate,

We have recently included this feature in our ruby gem. Though it is not exactly the same as what you are asking, you can configure the value of application.name with value from environment variables enclosing it within {}

Ex: application.name={app_name}

where app_name is an environment variable in ENV hash. Please note that the variables from ENV hash are only supported. Also, use the gem file downloaded from Site24x7 APMInsight tab. The gem file in RubyGems.org doesn't have this feature yet.

Hope this solves your problem.

Let us know for any further assistance.

Regards,
Raji.


Like (0) Reply

Thanks!

For future reference, for those trying to do the same thing:

  1. We downloaded the gem file to vendor/gems in our Rails app and then used "gem unpack" on it.
  2. Added this to our Gemfile (note that specifying '1.1' was critical to get it to work with bundler)
    gem 'site24x7_apminsight', '1.1', :path=>'vendor/gems/site24x7_apminsight-1.1'
  3. Now running 'bundle install' works!
  4. In the top app dir, created the apminsight.conf with
    application.name={RAILS_ENV}


Like (0) Reply

Was this post helpful?