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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00254e5e7e0ae29d42202878964ae8fa9260ab3876890bf726672888e5093e0f
4
- data.tar.gz: bd4b76a4b6b05831f8093b11575b201af09559be18e256352933673fee53f9a6
3
+ metadata.gz: 17430310dde26c291834ba76e124506f4cd913578d18f6fbb9c8a1caa2967776
4
+ data.tar.gz: f978a2034421966bd6e8dcc38f2e1f2ab644c3cb3627c6bf94a73f5cd46fee00
5
5
  SHA512:
6
- metadata.gz: 483e9952ee662d3ba3abe97c3b8f2b142c873b4b44ba6e184f475df3810eecd43512eee28da129d3e236ad5e554989814dea90c2366b3f99b78a0e53bb3e5a0c
7
- data.tar.gz: 607657e05536fe692899567734a2c17e588e145bb57cf2cf682d289cf312f3df0312739d2a872308f0a1cc281d87432b6236bc524d8f6b2a329bec30b1e7a0e5
6
+ metadata.gz: 62b667631fad16ce7b6436109e14484509c8c54e3bd41a4c744fdabc62f34b22b9a86bc861c6df369d1ce74f2eee6d8ebb4c7dbd89971b48d7feb16892e92a13
7
+ data.tar.gz: 40adc80e926e70ba662b1c9fd6f32872a35a689fa127993037ee3e5b5272325c4d9a2fa25433dc17b6a225f60ecaab333661b7e5555e7d6fdf78e459466454fe
@@ -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.
@@ -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))
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yabeda
4
4
  module Rails
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
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.5.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-03-27 00:00:00.000000000 Z
11
+ date: 2020-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yabeda