Coder Social home page Coder Social logo

Comments (7)

jfelchner avatar jfelchner commented on September 27, 2024 1

@carllerche any word on getting the "setting the config from an initializer" working? Currently setting the ENV in a config/initializers file doesn't work. Nor does doing a Rails.application.configure block and setting config.skylight.authentication in there in a config/initializers file.

It would be pretty great if we could set this at Rails boot time.

from skylight-ruby.

carllerche avatar carllerche commented on September 27, 2024

Another option would be to configure the agent directly from the rails initializer. Something like:

config.skylight.authentication = Rails.application.secrets.skylight['authentication']

That probably would be better than the ERB route. Thoughts?

from skylight-ruby.

janvarljen avatar janvarljen commented on September 27, 2024

I already tried defining this in my production.rb file

config.skylight.application = Rails.application.secrets.skylight['application']
config.skylight.authentication = Rails.application.secrets.skylight['authentication']

and removed the config/skylight.yml file but it didn't work.

am I doing something wrong?

from skylight-ruby.

carllerche avatar carllerche commented on September 27, 2024

Oh sorry, that currently doesn't work :) I was asking if that would be a better solution for you vs. ERB in the YAML (which I am generally not a fan of).

from skylight-ruby.

janvarljen avatar janvarljen commented on September 27, 2024

Oh ok. Yeah I agree that that would be a better approach.

Do you have an estimate when this will be available?

P.S. if you're interested here's how newrelic is handling reading .yml files

https://github.com/newrelic/rpm/blob/5560d8ecff0dcece53a80edbc4535cc60fc188d8/lib/new_relic/agent/configuration/yaml_source.rb

from skylight-ruby.

carllerche avatar carllerche commented on September 27, 2024

No estimate yet, the easiest "work around" would be to use environment variables. It would be possible to set the environment variables in the Rails app before it boots if you don't want to set it externally.

Something like the following should work:

ENV["SKYLIGHT_AUTHENTICATION"] = Rails.application.secrets.skylight['authentication']

as long as it happens early on.

from skylight-ruby.

janvarljen avatar janvarljen commented on September 27, 2024

Ok thx for your comments.

from skylight-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.