promenade 0.1.9 → 0.1.11

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: c2bd249f853cbf57e2571cf4bb3fc58c664b0c0e68fe65b9ee9cae8c052e400b
4
- data.tar.gz: 657e124fdf770d0a6543079afe097c4958e6fdc870e150e2ce0f699d3fa9e072
3
+ metadata.gz: 2278db3e96b17da5b6cd8fd64775a6eed606fe500d6ee69a80c000b2dfeff818
4
+ data.tar.gz: edf1af8bd855e077f5dd8239495aae253c9bae41f5a71abe8953873c95546005
5
5
  SHA512:
6
- metadata.gz: 682fa7be51f6489f72744003794c8d1e7c268c345ba1d035acce315e5acd5172e21a4d64c4207cbf5ae2d09c051f0a4f02ded341fc44d632d407cd58f9e0b15f
7
- data.tar.gz: db9463b50ab7d5b5093edb545169dd689f1baf8c0ab9f0cd44299a4424dfe53425f098b213a2fce8a4b04a81a62031f3fc4bff4ddf82ec862ec87966d3379435
6
+ metadata.gz: 3267c599cfe5b7073342b1a207ac7b1bc7e7b52d4c5ce43810458636cdb14f85a9b38314df7aa21baa37282e49bef3b7d5d0d71ace265c9a86973a94c48a5271
7
+ data.tar.gz: d0e8ca80774f4fa4528fe5bca272dc1f99cc0649b01d5685ee504592273e2442e68f36ed774de693230b5c3005c13768fba7f9b633053adeed8a77d79596de3c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- promenade (0.1.9)
4
+ promenade (0.1.11)
5
5
  activesupport
6
6
  prometheus-client-mmap (~> 0.9.3)
7
7
  rack
@@ -9,54 +9,54 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (5.2.1)
12
+ activesupport (5.2.2)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 0.7, < 2)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
17
  ast (2.4.0)
18
- backports (3.11.4)
18
+ backports (3.12.0)
19
19
  binding_of_caller (0.8.0)
20
20
  debug_inspector (>= 0.0.1)
21
21
  climate_control (0.2.0)
22
- codecov (0.1.10)
22
+ codecov (0.1.14)
23
23
  json
24
24
  simplecov
25
25
  url
26
26
  coderay (1.1.2)
27
- concurrent-ruby (1.0.5)
27
+ concurrent-ruby (1.1.4)
28
28
  debug_inspector (0.0.3)
29
- deep-cover (0.6.4)
30
- bundler
31
- deep-cover-core (= 0.6.4)
29
+ deep-cover (0.7.1)
30
+ deep-cover-core (= 0.7.1)
32
31
  highline
33
- slop (~> 4.0)
34
- term-ansicolor
32
+ thor (>= 0.20.3)
35
33
  with_progress
36
- deep-cover-core (0.6.4)
34
+ deep-cover-core (0.7.1)
37
35
  backports (>= 3.11.0)
38
36
  binding_of_caller
39
37
  parser (~> 2.5.0)
40
38
  pry
39
+ term-ansicolor
41
40
  terminal-table
42
41
  diff-lcs (1.3)
43
42
  docile (1.3.1)
44
- highline (2.0.0)
45
- i18n (1.1.0)
43
+ highline (2.0.1)
44
+ i18n (1.6.0)
46
45
  concurrent-ruby (~> 1.0)
47
- jaro_winkler (1.5.1)
48
- json (2.1.0)
49
- method_source (0.9.0)
46
+ jaro_winkler (1.5.2)
47
+ json (2.2.0)
48
+ method_source (0.9.2)
50
49
  minitest (5.11.3)
51
- parallel (1.12.1)
52
- parser (2.5.1.2)
50
+ parallel (1.14.0)
51
+ parser (2.5.3.0)
53
52
  ast (~> 2.4.0)
54
53
  powerpack (0.1.2)
55
- prometheus-client-mmap (0.9.4)
56
- pry (0.11.3)
54
+ prometheus-client-mmap (0.9.5)
55
+ pry (0.12.2)
57
56
  coderay (~> 1.1.0)
58
57
  method_source (~> 0.9.0)
59
- rack (2.0.5)
58
+ psych (3.1.0)
59
+ rack (2.0.6)
60
60
  rainbow (3.0.0)
61
61
  rake (10.5.0)
62
62
  rspec (3.8.0)
@@ -65,37 +65,38 @@ GEM
65
65
  rspec-mocks (~> 3.8.0)
66
66
  rspec-core (3.8.0)
67
67
  rspec-support (~> 3.8.0)
68
- rspec-expectations (3.8.1)
68
+ rspec-expectations (3.8.2)
69
69
  diff-lcs (>= 1.2.0, < 2.0)
70
70
  rspec-support (~> 3.8.0)
71
71
  rspec-mocks (3.8.0)
72
72
  diff-lcs (>= 1.2.0, < 2.0)
73
73
  rspec-support (~> 3.8.0)
74
74
  rspec-support (3.8.0)
75
- rubocop (0.59.2)
75
+ rubocop (0.65.0)
76
76
  jaro_winkler (~> 1.5.1)
77
77
  parallel (~> 1.10)
78
78
  parser (>= 2.5, != 2.5.1.1)
79
79
  powerpack (~> 0.1)
80
+ psych (>= 3.1.0)
80
81
  rainbow (>= 2.2.2, < 4.0)
81
82
  ruby-progressbar (~> 1.7)
82
- unicode-display_width (~> 1.0, >= 1.0.1)
83
+ unicode-display_width (~> 1.4.0)
83
84
  ruby-progressbar (1.10.0)
84
85
  simplecov (0.16.1)
85
86
  docile (~> 1.1)
86
87
  json (>= 1.8, < 3)
87
88
  simplecov-html (~> 0.10.0)
88
89
  simplecov-html (0.10.2)
89
- slop (4.6.2)
90
- term-ansicolor (1.6.0)
90
+ term-ansicolor (1.7.1)
91
91
  tins (~> 1.0)
92
92
  terminal-table (1.8.0)
93
93
  unicode-display_width (~> 1.1, >= 1.1.1)
94
+ thor (0.20.3)
94
95
  thread_safe (0.3.6)
95
- tins (1.16.3)
96
+ tins (1.20.2)
96
97
  tzinfo (1.2.5)
97
98
  thread_safe (~> 0.1)
98
- unicode-display_width (1.4.0)
99
+ unicode-display_width (1.4.1)
99
100
  url (0.3.2)
100
101
  with_progress (1.0.1)
101
102
  ruby-progressbar (~> 1.4)
@@ -115,4 +116,4 @@ DEPENDENCIES
115
116
  simplecov
116
117
 
117
118
  BUNDLED WITH
118
- 1.16.2
119
+ 1.17.2
@@ -22,6 +22,10 @@ module Promenade
22
22
  doc "Messages processed by this consumer"
23
23
  end
24
24
 
25
+ counter :kafka_consumer_messages_fetched do
26
+ doc "Messages fetched by this consumer"
27
+ end
28
+
25
29
  counter :kafka_consumer_message_processing_errors do
26
30
  doc "Consumer errors while processing a message"
27
31
  end
@@ -88,7 +92,7 @@ module Promenade
88
92
 
89
93
  def process_batch(event) # rubocop:disable Metrics/AbcSize
90
94
  labels = get_labels(event)
91
- lag = event.payload.fetch(:offset_lag)
95
+ offset_lag = event.payload.fetch(:offset_lag)
92
96
  messages = event.payload.fetch(:message_count)
93
97
 
94
98
  if event.payload.key?(:exception)
@@ -98,7 +102,16 @@ module Promenade
98
102
  metric(:kafka_consumer_batch_processing_latency).observe(labels, event.duration)
99
103
  end
100
104
 
101
- metric(:kafka_consumer_ofset_lag).set(labels, lag)
105
+ metric(:kafka_consumer_ofset_lag).set(labels, offset_lag)
106
+ end
107
+
108
+ def fetch_batch(event)
109
+ labels = get_labels(event)
110
+ offset_lag = event.payload.fetch(:offset_lag)
111
+ messages = event.payload.fetch(:message_count)
112
+
113
+ metric(:kafka_consumer_messages_fetched).increment(labels, messages)
114
+ metric(:kafka_consumer_ofset_lag).set(labels, offset_lag)
102
115
  end
103
116
 
104
117
  def join_group(event)
@@ -1,5 +1,3 @@
1
- require "prometheus/client"
2
- require "prometheus/client/support/unicorn"
3
1
  require "pathname"
4
2
 
5
3
  module Promenade
@@ -17,6 +15,11 @@ module Promenade
17
15
  FileUtils.mkdir_p multiprocess_files_dir
18
16
  end
19
17
 
18
+ ENV["prometheus_multiproc_dir"] = multiprocess_files_dir.to_s
19
+
20
+ require "prometheus/client"
21
+ require "prometheus/client/support/unicorn"
22
+
20
23
  ::Prometheus::Client.configure do |config|
21
24
  config.multiprocess_files_dir = multiprocess_files_dir
22
25
  config.pid_provider = ::Prometheus::Client::Support::Unicorn.method(:worker_pid_provider)
@@ -1,3 +1,3 @@
1
1
  module Promenade
2
- VERSION = "0.1.9".freeze
2
+ VERSION = "0.1.11".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promenade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Robinson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-04 00:00:00.000000000 Z
11
+ date: 2019-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -205,8 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  requirements: []
208
- rubyforge_project:
209
- rubygems_version: 2.7.6
208
+ rubygems_version: 3.0.1
210
209
  signing_key:
211
210
  specification_version: 4
212
211
  summary: Promenade makes it simple to instrument Ruby apps for prometheus scraping