-
Notifications
You must be signed in to change notification settings - Fork 62
Added config parameter to configure app name … #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added config parameter to configure app name … #44
Conversation
…ls metrics to be able to distinguish between multiple apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for app_name
should not be my-rails-app
. Existing users of this gem, who haven't set this, shouldn't start to wonder where this might have came from.
I'd suggest either to re-use the application class name, or default to a blank value.
lib/influxdb/rails/configuration.rb
Outdated
@@ -65,6 +67,8 @@ class Configuration | |||
:series_name_for_view_runtimes => "rails.view", | |||
:series_name_for_db_runtimes => "rails.db", | |||
|
|||
:rails_app_name => 'my-rails-app', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should either be nil
, or something like Rails.application.class.parent_name
.
lib/influxdb-rails.rb
Outdated
server: hostname, | ||
method: method, | ||
server: hostname, | ||
app_name: app_name | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app_name
might be blank, so you'll need a .compact
on the hash
lib/influxdb-rails.rb
Outdated
server: hostname, | ||
method: method, | ||
server: hostname, | ||
app_name: app_name | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
lib/influxdb-rails.rb
Outdated
server: hostname, | ||
method: method, | ||
server: hostname, | ||
app_name: app_name | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
Yes, was thinking the same thing. Just wanted to quickly check first if this change flies. Will implement the rest tomorrow. |
Now done, complete with specs. |
LGTM, will merge it later, when I'm back home. |
Perfect, thanks! |
Tests seem to fail for some Ruby versions, not sure why as those are unrelated to my changes. |
Hm, usually restarting the Travis job helps, but in this case it didn't... (btw. I totally forgot about this, but I'm on it now :-)) |
Interestingly, with the exact same gemset from the last succeeding spec run, your changes still fail locally... I'm not sure, why this happens (and only for Ruby < 2.4 for Rails 4.0), but I agree, these failures should be unrelated to your changes. |
Got it. |
…d make metrics sending code a little more DRY.
Fixed now, by no longer relying on |
This is now merged in fae86f0 and c1f144d. The workaround for I've not yet released a new gem version, since I started a major refactoring and want to include #22 and #43 as well. Since 055a952 introduced some breaking changes and at least #43 requires more of them, I'm going for a 1.0 release. |
After some cleanup, I've discovered I'm going to remove |
Introduced in #44, `rails_app_name` is actually redundant.
used for tagging the rails metrics to be able to distinguish between multiple apps.