librato-rails 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +3 -0
- data/README.md +12 -0
- data/lib/librato/rails/railtie.rb +16 -17
- data/lib/librato/rails/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +3 -1
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -232,12 +232,24 @@ your config, which will append the process id to the source name used by each th
|
|
232
232
|
|
233
233
|
Note that it may take 2-3 minutes for the first results to show up in your Metrics account after you have started your servers with `librato-rails` enabled and the first request has been received.
|
234
234
|
|
235
|
+
#### Verbose Logging
|
236
|
+
|
235
237
|
If you want to get more information about `librato-rails` submissions to the Metrics service you can set your `log_level` to `debug` (see [configuration](https://github.com/librato/librato-rails/wiki/Configuration)) to get detailed information added to your logs about the settings `librato-rails` is seeing at startup and when it is submitting.
|
236
238
|
|
237
239
|
Be sure to tail your logs manually (`tail -F <logfile>`) as the log output you get when using the `rails server` command often skips startup log lines.
|
238
240
|
|
239
241
|
If you are having an issue with a specific metric, using a `log_level` of `trace` will add the exact measurements being sent to your logs along with lots of other information about `librato-rails` as it executes. Neither of these modes are recommended long-term in production as they will add quite a bit of volume to your log file and will slow operation somewhat. Note that submission I/O is non-blocking, submission times are total time - your process will continue to handle requests during submissions.
|
240
242
|
|
243
|
+
#### Console Mode
|
244
|
+
|
245
|
+
By default the `librato-rails` reporter will not start in console mode, even if `librato-rails` is configured. If you want to force the reporter to run in console mode, set `LIBRATO_AUTORUN` to `1` in your environment:
|
246
|
+
|
247
|
+
```sh
|
248
|
+
$ LIBRATO_AUTORUN=1 rails console
|
249
|
+
```
|
250
|
+
|
251
|
+
#### Custom Flush Interval
|
252
|
+
|
241
253
|
If you are debugging setting up `librato-rails` locally you can set `flush_interval` to something shorter (say 10s) to force submission more frequently. Don't change your `flush_interval` in production as it will not result in measurements showing up more quickly, but may affect performance.
|
242
254
|
|
243
255
|
## Contribution
|
@@ -14,26 +14,25 @@ module Librato
|
|
14
14
|
Librato.register_tracker(tracker)
|
15
15
|
|
16
16
|
unless ::Rails.env.test?
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
logger = ::Rails.logger
|
26
|
-
end
|
27
|
-
config.librato_rails.log_target = logger
|
28
|
-
tracker.log(:debug) { "config: #{config.librato_rails.dump}" }
|
29
|
-
|
30
|
-
if tracker.should_start?
|
31
|
-
tracker.log :info, "starting up (pid #{$$}, using #{config.librato_rails.config_by})..."
|
32
|
-
app.middleware.insert(0, Librato::Rack, :config => config.librato_rails)
|
33
|
-
end
|
17
|
+
|
18
|
+
initializer 'librato_rails.setup' do |app|
|
19
|
+
# set up logging; heroku needs logging to STDOUT
|
20
|
+
if on_heroku
|
21
|
+
logger = Logger.new(STDOUT)
|
22
|
+
logger.level = Logger::INFO
|
23
|
+
else
|
24
|
+
logger = ::Rails.logger
|
34
25
|
end
|
26
|
+
config.librato_rails.log_target = logger
|
27
|
+
tracker.log(:debug) { "config: #{config.librato_rails.dump}" }
|
35
28
|
|
29
|
+
if tracker.should_start?
|
30
|
+
tracker.log :info, "starting up (pid #{$$}, using #{config.librato_rails.config_by})..."
|
31
|
+
app.middleware.insert(0, Librato::Rack, :config => config.librato_rails)
|
32
|
+
tracker.check_worker if config.librato_rails.autorun
|
33
|
+
end
|
36
34
|
end
|
35
|
+
|
37
36
|
end
|
38
37
|
|
39
38
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librato-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
bktaNmhlblFBRjFDSDk2WmNxY0pIMTc5UzJ0SWlLRE04a2VlUklVT1BDM1dU
|
38
38
|
MGZhb2svMgpnQTJvemRyODUxYy9uQT09Ci0tLS0tRU5EIENFUlRJRklDQVRF
|
39
39
|
LS0tLS0K
|
40
|
-
date: 2013-
|
40
|
+
date: 2013-09-06 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rails
|
@@ -208,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
208
|
version: '0'
|
209
209
|
segments:
|
210
210
|
- 0
|
211
|
-
hash:
|
211
|
+
hash: 3991195064303754984
|
212
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
213
|
none: false
|
214
214
|
requirements:
|
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
segments:
|
219
219
|
- 0
|
220
|
-
hash:
|
220
|
+
hash: 3991195064303754984
|
221
221
|
requirements: []
|
222
222
|
rubyforge_project:
|
223
223
|
rubygems_version: 1.8.23
|
metadata.gz.sig
CHANGED