An all new influxdb-rails 1.0
This is the first stable release of the v1.0 branch of influxdb-rails. We have packed for you a lot of awesome features and bug fixes into 1.0. And we hope you'll enjoy using this as much as we have creating it!
⚠️ This is a complete new branch, it also includes a couple of breaking changes!⚠️
New Features
Redesign of the Measurement Output
We switched from emitting eight different measurements based on Active Support Instrumentation hooks to one measurement called rails
. We changed this to support easier aggregation across data in the rails
measurement, to simplify our configuration and to stay closer to the InfluxDB/Grafana nomenclature.
You will need to update your dashboards, sorry for the inconvenience (see the Breaking Changes section).
A Sample Dashboard
Sending measurements to an InfluxDB is only half of the fun! 🤡 So this is the first version that includes a grafana dashboard. This dashboard tracks Ruby on Rails application performance based on the data we deliver with this gem.
Check out the sample-dashboard/ directory. We are really looking forward to collaborate with you on this. Let's build a the perfect Ruby on Rails dashboard together! 🤝
Easy custom Tags & Values
It's now way easier to include your own tags & values for measurements. Be it application wide (thank you @Kukunin for #47 💐) or per request!
New ActiveRecord
and ActionView
instrumentation
We have expanded the set of measurements to include also data from ActiveRecord and from ActionView so you get to know where your application really spends time on. Additionally to that the ActionController
measurements now include more tags (method, status, format). And last but not least, all measurements now include the application name (thank you @stefanhorning for #44 💐). See our README.md for all the new goodness.
Breaking Changes
As this is a complete new branch it also includes a couple of breaking changes and you will have to update your configuration and your dashboards based on our data. We are sorry we have to put you through this...
Client Configuration
To simplify the configuration we have separated all of the influxdb-ruby client settings. Please update your configuration accordingly.
0.4.x | 1.0.x |
---|---|
influxdb_database |
client.database |
influxdb_username |
client.username |
influxdb_password |
client.password |
influxdb_hosts |
client.hosts |
influxdb_port |
client.port |
async |
client.async |
use_ssl |
client.use_ssl |
retry |
client.retry |
open_timeout |
client.open_timeout |
read_timeout |
client.read_timeout |
max_delay |
client.max_delay |
time_precision |
client.time_precision |
Exceptions
To simplify our code base and in honor to the many Free Software exception trackers (errbit, sentry etc.), who do this job in a much nicer way, we have dropped the exceptions feature completely. So from this version on, we will not output anything into the rails.exceptions
measurement anymore. We are sorry if you have relied on this and you now have to migrate to something else for exception tracking, but this was such an invasive code-path. We rather want to concentrate our resources on supporting more ActiveSupport Instrumentation hooks and data instead of this.
Measurement Output
As explained above, the measurement output changed. Below you find a table of what moved where.
0.4.x | 1.0.x (measurement: rails ) |
---|---|
measurement: rails.controller |
tag-key: hook , tag-value: process_action , field-key: controller |
measurement: rails.view |
tag-key: hook , tag-value: process_action , field-key: view |
measurement: rails.db |
tag-key: hook , tag-value: process_action , field-key: db |
measurement: rails.render_template |
tag-key: hook , tag-value: render_template |
measurement: rails.render_partial |
tag-key: hook , tag-value: render_partial |
measurement: rails.render_collection |
tag-key: hook , tag-value: render_collection |
measurement: rails.sql |
tag-key: hook , tag-value: sql |
measurement: rails.exceptions |
Not Available anymore |
See the InfluxDB Key Concepts documentation about what measurement, tag-key, tag-value and field-key mean.
Measurement Configuration
As explained above, a couple of configuration variables have changed. There is no need for you to do anything after the update but we list them here for completeness.
The following settings in your initializer don't have an effect anymore, you can remove them.
series_name_for_controller_runtimes
series_name_for_view_runtimes
series_name_for_db_runtimes
series_name_for_render_template
series_name_for_render_partial
series_name_for_render_collection
series_name_for_sql
series_name_for_exceptions
series_name_for_instrumentation
And there are two new variables (with sensible defaults) that you can add to your initializer. You can use measurement_name = 'rails'
to influence how the measurement we send is called. To disable measuring some specific hook (setting series_name_for_something = nil
in 0.4x) you can use the variable ignored_hooks = ['sql.active_record', 'render_template.action_view']
. See README.md#usage for the list of hooks we support.
Other breaking changes
- Support for Ruby <= 2.2.x has been removed
- Support for Rails <= 4.1.x has been removed
- Removed previously deprecated methods, if you still have them in your initializer they will now crash.
InfluxDB::Rails::Configuration#reraise_global_exceptions
InfluxDB::Rails::Configuration#database_name
InfluxDB::Rails::Configuration#application_id
Installation & Update
Please refer to README.md for everything else.
Hope this helps you instrument your Ruby on Rails application with Free Software! ❤️ - @ChrisBr, @hennevogel & @dmke