yabeda-rails 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +20 -0
- data/lib/yabeda/rails.rb +1 -1
- data/lib/yabeda/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17430310dde26c291834ba76e124506f4cd913578d18f6fbb9c8a1caa2967776
|
4
|
+
data.tar.gz: f978a2034421966bd6e8dcc38f2e1f2ab644c3cb3627c6bf94a73f5cd46fee00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62b667631fad16ce7b6436109e14484509c8c54e3bd41a4c744fdabc62f34b22b9a86bc861c6df369d1ce74f2eee6d8ebb4c7dbd89971b48d7feb16892e92a13
|
7
|
+
data.tar.gz: 40adc80e926e70ba662b1c9fd6f32872a35a689fa127993037ee3e5b5272325c4d9a2fa25433dc17b6a225f60ecaab333661b7e5555e7d6fdf78e459466454fe
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## 0.6.0 - 2020-08-06
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Ability to add default/custom tags to metrics from controllers. @raivil in [#13](https://github.com/yabeda-rb/yabeda-rails/pull/13)
|
13
|
+
|
8
14
|
## 0.5.0 - 2020-03-27
|
9
15
|
|
10
16
|
### Added
|
data/README.md
CHANGED
@@ -57,6 +57,26 @@ You always can add support for your app server to [lib/yabeda/rails/railtie.rb](
|
|
57
57
|
end
|
58
58
|
```
|
59
59
|
|
60
|
+
## Custom tags
|
61
|
+
|
62
|
+
You can add additional tags to the existing metrics by adding custom payload to your controller.
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
# This block is optional but some adapters (like Prometheus) requires that all tags should be declared in advance
|
66
|
+
Yabeda.configure do
|
67
|
+
default_tag :importance, nil
|
68
|
+
end
|
69
|
+
|
70
|
+
class ApplicationController < ActionController::Base
|
71
|
+
def append_info_to_payload(payload)
|
72
|
+
super
|
73
|
+
payload[:importance] = extract_importance(params)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
```
|
77
|
+
`append_info_to_payload` is a method from [ActionController::Instrumentation](https://api.rubyonrails.org/classes/ActionController/Instrumentation.html#method-i-append_info_to_payload)
|
78
|
+
|
79
|
+
|
60
80
|
## Development
|
61
81
|
|
62
82
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/yabeda/rails.rb
CHANGED
@@ -47,7 +47,7 @@ module Yabeda
|
|
47
47
|
status: event.payload[:status],
|
48
48
|
format: event.payload[:format],
|
49
49
|
method: event.payload[:method].downcase,
|
50
|
-
}
|
50
|
+
}.merge!(event.payload.slice(*Yabeda.default_tags.keys))
|
51
51
|
|
52
52
|
rails_requests_total.increment(labels)
|
53
53
|
rails_request_duration.measure(labels, Yabeda::Rails.ms2s(event.duration))
|
data/lib/yabeda/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yabeda-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Novikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yabeda
|