promenade 0.7.0 → 0.9.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: c8f195d39a6967000ebf64da2a2143a85c934ad0a37b7303eb91511dd1f458bf
4
- data.tar.gz: '030960d747dd81a33a2feea7b6f3a3460fdc3952160b4c000900645df163d402'
3
+ metadata.gz: fc0749131d57843e9243eb47058cc0615c73865b92b753772308ceb13cd6b096
4
+ data.tar.gz: 66c5a9376ea0cd02dbd64bd63e67d3178f440a30701646912ef459586e14a1e6
5
5
  SHA512:
6
- metadata.gz: 3cb2cd2eaf07029afd1ac8ad574be62d5b5f848734ea67f1f94a919fe9a6f548c2bcb71d761b92a30077575114a7b505eebe21f20f380af47471401c62b898f6
7
- data.tar.gz: 0e94c108cd6e98d0f1280e07412e2cb9a41ef7f5a0d7f33735d785c1253424246e46c5fc49ddc0757658301f697272baa1ee882f109327442d13ffa87e6f6429
6
+ metadata.gz: 5569ffe88cbaf2a0a738b605c15673a6866e51c345fc53a8000f01004dd77b23a8175af32f1242ed2492aa444c6a71e20d760fb1d377b2c02ead531470108f47
7
+ data.tar.gz: b2fe6be44e09a45f9e6cf051971b27140d9af03e436265815ccb0e527d85dfcc890dc271654e3b404ff9cfce8c8a633ff4efe1c17797781ef6751732bb7d92f3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- promenade (0.7.0)
4
+ promenade (0.9.0)
5
5
  actionpack
6
6
  activesupport (> 6.0, < 8.0)
7
7
  prometheus-client-mmap (~> 0.16.0)
@@ -10,167 +10,144 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actioncable (7.0.3)
14
- actionpack (= 7.0.3)
15
- activesupport (= 7.0.3)
13
+ actioncable (7.0.4.2)
14
+ actionpack (= 7.0.4.2)
15
+ activesupport (= 7.0.4.2)
16
16
  nio4r (~> 2.0)
17
17
  websocket-driver (>= 0.6.1)
18
- actionmailbox (7.0.3)
19
- actionpack (= 7.0.3)
20
- activejob (= 7.0.3)
21
- activerecord (= 7.0.3)
22
- activestorage (= 7.0.3)
23
- activesupport (= 7.0.3)
18
+ actionmailbox (7.0.4.2)
19
+ actionpack (= 7.0.4.2)
20
+ activejob (= 7.0.4.2)
21
+ activerecord (= 7.0.4.2)
22
+ activestorage (= 7.0.4.2)
23
+ activesupport (= 7.0.4.2)
24
24
  mail (>= 2.7.1)
25
25
  net-imap
26
26
  net-pop
27
27
  net-smtp
28
- actionmailer (7.0.3)
29
- actionpack (= 7.0.3)
30
- actionview (= 7.0.3)
31
- activejob (= 7.0.3)
32
- activesupport (= 7.0.3)
28
+ actionmailer (7.0.4.2)
29
+ actionpack (= 7.0.4.2)
30
+ actionview (= 7.0.4.2)
31
+ activejob (= 7.0.4.2)
32
+ activesupport (= 7.0.4.2)
33
33
  mail (~> 2.5, >= 2.5.4)
34
34
  net-imap
35
35
  net-pop
36
36
  net-smtp
37
37
  rails-dom-testing (~> 2.0)
38
- actionpack (7.0.3)
39
- actionview (= 7.0.3)
40
- activesupport (= 7.0.3)
38
+ actionpack (7.0.4.2)
39
+ actionview (= 7.0.4.2)
40
+ activesupport (= 7.0.4.2)
41
41
  rack (~> 2.0, >= 2.2.0)
42
42
  rack-test (>= 0.6.3)
43
43
  rails-dom-testing (~> 2.0)
44
44
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
45
- actiontext (7.0.3)
46
- actionpack (= 7.0.3)
47
- activerecord (= 7.0.3)
48
- activestorage (= 7.0.3)
49
- activesupport (= 7.0.3)
45
+ actiontext (7.0.4.2)
46
+ actionpack (= 7.0.4.2)
47
+ activerecord (= 7.0.4.2)
48
+ activestorage (= 7.0.4.2)
49
+ activesupport (= 7.0.4.2)
50
50
  globalid (>= 0.6.0)
51
51
  nokogiri (>= 1.8.5)
52
- actionview (7.0.3)
53
- activesupport (= 7.0.3)
52
+ actionview (7.0.4.2)
53
+ activesupport (= 7.0.4.2)
54
54
  builder (~> 3.1)
55
55
  erubi (~> 1.4)
56
56
  rails-dom-testing (~> 2.0)
57
57
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
58
- activejob (7.0.3)
59
- activesupport (= 7.0.3)
58
+ activejob (7.0.4.2)
59
+ activesupport (= 7.0.4.2)
60
60
  globalid (>= 0.3.6)
61
- activemodel (7.0.3)
62
- activesupport (= 7.0.3)
63
- activerecord (7.0.3)
64
- activemodel (= 7.0.3)
65
- activesupport (= 7.0.3)
66
- activestorage (7.0.3)
67
- actionpack (= 7.0.3)
68
- activejob (= 7.0.3)
69
- activerecord (= 7.0.3)
70
- activesupport (= 7.0.3)
61
+ activemodel (7.0.4.2)
62
+ activesupport (= 7.0.4.2)
63
+ activerecord (7.0.4.2)
64
+ activemodel (= 7.0.4.2)
65
+ activesupport (= 7.0.4.2)
66
+ activestorage (7.0.4.2)
67
+ actionpack (= 7.0.4.2)
68
+ activejob (= 7.0.4.2)
69
+ activerecord (= 7.0.4.2)
70
+ activesupport (= 7.0.4.2)
71
71
  marcel (~> 1.0)
72
72
  mini_mime (>= 1.1.0)
73
- activesupport (7.0.3)
73
+ activesupport (7.0.4.2)
74
74
  concurrent-ruby (~> 1.0, >= 1.0.2)
75
75
  i18n (>= 1.6, < 2)
76
76
  minitest (>= 5.1)
77
77
  tzinfo (~> 2.0)
78
78
  ast (2.4.2)
79
- backports (3.23.0)
80
- binding_of_caller (1.0.0)
81
- debug_inspector (>= 0.0.1)
82
79
  builder (3.2.4)
83
80
  byebug (11.1.3)
84
- climate_control (1.1.1)
81
+ climate_control (1.2.0)
85
82
  codecov (0.6.0)
86
83
  simplecov (>= 0.15, < 0.22)
87
- coderay (1.1.3)
88
- concurrent-ruby (1.1.10)
84
+ concurrent-ruby (1.2.2)
89
85
  crass (1.0.6)
90
- debug_inspector (1.1.0)
91
- deep-cover (1.1.0)
92
- deep-cover-core (= 1.1.0)
93
- highline
94
- thor (>= 0.20.3)
95
- with_progress
96
- deep-cover-core (1.1.0)
97
- backports (>= 3.11.0)
98
- binding_of_caller
99
- parser (>= 2.5)
100
- pry
101
- term-ansicolor
102
- terminal-table
86
+ date (3.3.3)
103
87
  diff-lcs (1.5.0)
104
- digest (3.1.0)
105
88
  docile (1.4.0)
106
- erubi (1.10.0)
107
- globalid (1.0.0)
89
+ erubi (1.12.0)
90
+ globalid (1.1.0)
108
91
  activesupport (>= 5.0)
109
- highline (2.0.3)
110
- i18n (1.10.0)
92
+ i18n (1.12.0)
111
93
  concurrent-ruby (~> 1.0)
112
94
  json (2.6.3)
113
- loofah (2.18.0)
95
+ loofah (2.19.1)
114
96
  crass (~> 1.0.2)
115
97
  nokogiri (>= 1.5.9)
116
- mail (2.7.1)
98
+ mail (2.8.1)
117
99
  mini_mime (>= 0.1.1)
100
+ net-imap
101
+ net-pop
102
+ net-smtp
118
103
  marcel (1.0.2)
119
104
  method_source (1.0.0)
120
105
  mini_mime (1.1.2)
121
- mini_portile2 (2.8.0)
122
- minitest (5.16.0)
123
- net-imap (0.2.3)
124
- digest
106
+ mini_portile2 (2.8.1)
107
+ minitest (5.17.0)
108
+ net-imap (0.3.4)
109
+ date
125
110
  net-protocol
126
- strscan
127
- net-pop (0.1.1)
128
- digest
111
+ net-pop (0.1.2)
129
112
  net-protocol
113
+ net-protocol (0.2.1)
130
114
  timeout
131
- net-protocol (0.1.3)
132
- timeout
133
- net-smtp (0.3.1)
134
- digest
115
+ net-smtp (0.3.3)
135
116
  net-protocol
136
- timeout
137
117
  nio4r (2.5.8)
138
- nokogiri (1.13.6)
118
+ nokogiri (1.14.2)
139
119
  mini_portile2 (~> 2.8.0)
140
120
  racc (~> 1.4)
141
121
  parallel (1.22.1)
142
122
  parser (3.2.1.0)
143
123
  ast (~> 2.4.1)
144
124
  prometheus-client-mmap (0.16.2)
145
- pry (0.14.1)
146
- coderay (~> 1.1)
147
- method_source (~> 1.0)
148
- racc (1.6.0)
149
- rack (2.2.3.1)
150
- rack-test (1.1.0)
151
- rack (>= 1.0, < 3)
152
- rails (7.0.3)
153
- actioncable (= 7.0.3)
154
- actionmailbox (= 7.0.3)
155
- actionmailer (= 7.0.3)
156
- actionpack (= 7.0.3)
157
- actiontext (= 7.0.3)
158
- actionview (= 7.0.3)
159
- activejob (= 7.0.3)
160
- activemodel (= 7.0.3)
161
- activerecord (= 7.0.3)
162
- activestorage (= 7.0.3)
163
- activesupport (= 7.0.3)
125
+ racc (1.6.2)
126
+ rack (2.2.6.2)
127
+ rack-test (2.0.2)
128
+ rack (>= 1.3)
129
+ rails (7.0.4.2)
130
+ actioncable (= 7.0.4.2)
131
+ actionmailbox (= 7.0.4.2)
132
+ actionmailer (= 7.0.4.2)
133
+ actionpack (= 7.0.4.2)
134
+ actiontext (= 7.0.4.2)
135
+ actionview (= 7.0.4.2)
136
+ activejob (= 7.0.4.2)
137
+ activemodel (= 7.0.4.2)
138
+ activerecord (= 7.0.4.2)
139
+ activestorage (= 7.0.4.2)
140
+ activesupport (= 7.0.4.2)
164
141
  bundler (>= 1.15.0)
165
- railties (= 7.0.3)
142
+ railties (= 7.0.4.2)
166
143
  rails-dom-testing (2.0.3)
167
144
  activesupport (>= 4.2.0)
168
145
  nokogiri (>= 1.6)
169
- rails-html-sanitizer (1.4.3)
170
- loofah (~> 2.3)
171
- railties (7.0.3)
172
- actionpack (= 7.0.3)
173
- activesupport (= 7.0.3)
146
+ rails-html-sanitizer (1.5.0)
147
+ loofah (~> 2.19, >= 2.19.1)
148
+ railties (7.0.4.2)
149
+ actionpack (= 7.0.4.2)
150
+ activesupport (= 7.0.4.2)
174
151
  method_source
175
152
  rake (>= 12.2)
176
153
  thor (~> 1.0)
@@ -179,18 +156,18 @@ GEM
179
156
  rake (13.0.6)
180
157
  regexp_parser (2.7.0)
181
158
  rexml (3.2.5)
182
- rspec (3.11.0)
183
- rspec-core (~> 3.11.0)
184
- rspec-expectations (~> 3.11.0)
185
- rspec-mocks (~> 3.11.0)
186
- rspec-core (3.11.0)
187
- rspec-support (~> 3.11.0)
188
- rspec-expectations (3.11.0)
159
+ rspec (3.12.0)
160
+ rspec-core (~> 3.12.0)
161
+ rspec-expectations (~> 3.12.0)
162
+ rspec-mocks (~> 3.12.0)
163
+ rspec-core (3.12.1)
164
+ rspec-support (~> 3.12.0)
165
+ rspec-expectations (3.12.2)
189
166
  diff-lcs (>= 1.2.0, < 2.0)
190
- rspec-support (~> 3.11.0)
191
- rspec-mocks (3.11.1)
167
+ rspec-support (~> 3.12.0)
168
+ rspec-mocks (3.12.3)
192
169
  diff-lcs (>= 1.2.0, < 2.0)
193
- rspec-support (~> 3.11.0)
170
+ rspec-support (~> 3.12.0)
194
171
  rspec-rails (5.1.2)
195
172
  actionpack (>= 5.2)
196
173
  activesupport (>= 5.2)
@@ -199,8 +176,8 @@ GEM
199
176
  rspec-expectations (~> 3.10)
200
177
  rspec-mocks (~> 3.10)
201
178
  rspec-support (~> 3.10)
202
- rspec-support (3.11.0)
203
- rubocop (1.46.0)
179
+ rspec-support (3.12.0)
180
+ rubocop (1.47.0)
204
181
  json (~> 2.3)
205
182
  parallel (~> 1.10)
206
183
  parser (>= 3.2.0.0)
@@ -214,43 +191,33 @@ GEM
214
191
  parser (>= 3.2.1.0)
215
192
  rubocop-capybara (2.17.1)
216
193
  rubocop (~> 1.41)
217
- rubocop-performance (1.14.2)
194
+ rubocop-performance (1.16.0)
218
195
  rubocop (>= 1.7.0, < 2.0)
219
196
  rubocop-ast (>= 0.4.0)
220
- rubocop-rails (2.15.0)
197
+ rubocop-rails (2.18.0)
221
198
  activesupport (>= 4.2.0)
222
199
  rack (>= 1.1)
223
- rubocop (>= 1.7.0, < 2.0)
200
+ rubocop (>= 1.33.0, < 2.0)
224
201
  rubocop-rspec (2.18.1)
225
202
  rubocop (~> 1.33)
226
203
  rubocop-capybara (~> 2.17)
227
- ruby-progressbar (1.11.0)
204
+ ruby-progressbar (1.12.0)
228
205
  simplecov (0.21.2)
229
206
  docile (~> 1.1)
230
207
  simplecov-html (~> 0.11)
231
208
  simplecov_json_formatter (~> 0.1)
232
209
  simplecov-html (0.12.3)
233
210
  simplecov_json_formatter (0.1.4)
234
- strscan (3.0.3)
235
- sync (0.5.0)
236
- term-ansicolor (1.7.1)
237
- tins (~> 1.0)
238
- terminal-table (3.0.2)
239
- unicode-display_width (>= 1.1.1, < 3)
240
211
  thor (1.2.1)
241
- timeout (0.3.0)
242
- tins (1.31.1)
243
- sync
244
- tzinfo (2.0.4)
212
+ timeout (0.3.2)
213
+ tzinfo (2.0.6)
245
214
  concurrent-ruby (~> 1.0)
246
215
  unicode-display_width (2.4.2)
247
- webrick (1.7.0)
216
+ webrick (1.8.1)
248
217
  websocket-driver (0.7.5)
249
218
  websocket-extensions (>= 0.1.0)
250
219
  websocket-extensions (0.1.5)
251
- with_progress (1.0.1)
252
- ruby-progressbar (~> 1.4)
253
- zeitwerk (2.6.0)
220
+ zeitwerk (2.6.7)
254
221
 
255
222
  PLATFORMS
256
223
  ruby
@@ -260,7 +227,6 @@ DEPENDENCIES
260
227
  byebug
261
228
  climate_control
262
229
  codecov
263
- deep-cover
264
230
  promenade!
265
231
  rails (> 3.0, < 8.0)
266
232
  rake
@@ -8,10 +8,11 @@ module Promenade
8
8
  class ExceptionHandler
9
9
  extend SingletonCaller
10
10
 
11
- attr_reader :histogram_name, :exceptions_counter_name, :registry
11
+ attr_reader :histogram_name, :requests_counter_name, :exceptions_counter_name, :registry
12
12
 
13
- def initialize(histogram_name:, exceptions_counter_name:, registry:)
13
+ def initialize(histogram_name:, requests_counter_name:, exceptions_counter_name:, registry:)
14
14
  @histogram_name = histogram_name
15
+ @requests_counter_name = requests_counter_name
15
16
  @exceptions_counter_name = exceptions_counter_name
16
17
  @registry = registry
17
18
  end
@@ -21,6 +22,7 @@ module Promenade
21
22
  labels.merge!(code: status_code_for_exception(exception))
22
23
 
23
24
  histogram.observe(labels, duration.to_f)
25
+ requests_counter.increment(labels)
24
26
  exceptions_counter.increment(exception: exception.class.name)
25
27
 
26
28
  raise exception
@@ -32,6 +34,10 @@ module Promenade
32
34
  registry.get(histogram_name)
33
35
  end
34
36
 
37
+ def requests_counter
38
+ registry.get(requests_counter_name)
39
+ end
40
+
35
41
  def exceptions_counter
36
42
  registry.get(exceptions_counter_name)
37
43
  end
@@ -10,9 +10,17 @@ module Promenade
10
10
  class HTTPRequestDurationCollector < MiddlwareBase
11
11
  REQUEST_DURATION_HISTOGRAM_NAME = :http_req_duration_seconds
12
12
 
13
+ # We specifically want to record a separate metric `http_requests_total` even
14
+ # though we know it is a duplicate of http_req_duration_seconds_count.
15
+ # This is a very commonly used prometheus metric name, and is very useful
16
+ # e.g. for autoscaling. Using the http_req_duration_seconds_count in such
17
+ # queries can be confusing
18
+ REQUESTS_COUNTER_NAME = :http_requests_total
19
+
13
20
  EXCEPTIONS_COUNTER_NAME = :http_exceptions_total
14
21
 
15
22
  private_constant :REQUEST_DURATION_HISTOGRAM_NAME,
23
+ :REQUESTS_COUNTER_NAME,
16
24
  :EXCEPTIONS_COUNTER_NAME
17
25
 
18
26
  def initialize(app,
@@ -42,6 +50,7 @@ module Promenade
42
50
  end
43
51
 
44
52
  def record_request_duration(labels, duration)
53
+ requests_counter.increment(labels)
45
54
  durations_histogram.observe(labels, duration)
46
55
  end
47
56
 
@@ -57,7 +66,13 @@ module Promenade
57
66
  registry.get(REQUEST_DURATION_HISTOGRAM_NAME)
58
67
  end
59
68
 
69
+ def requests_counter
70
+ registry.get(REQUESTS_COUNTER_NAME)
71
+ end
72
+
60
73
  def register_metrics!
74
+ registry.counter(REQUESTS_COUNTER_NAME,
75
+ "A counter of the total number of HTTP requests made.")
61
76
  registry.histogram(REQUEST_DURATION_HISTOGRAM_NAME,
62
77
  "A histogram of the response latency.", {}, latency_buckets)
63
78
  registry.counter(EXCEPTIONS_COUNTER_NAME,
@@ -71,6 +86,7 @@ module Promenade
71
86
  def default_exception_handler
72
87
  ExceptionHandler.initialize_singleton(
73
88
  histogram_name: REQUEST_DURATION_HISTOGRAM_NAME,
89
+ requests_counter_name: REQUESTS_COUNTER_NAME,
74
90
  exceptions_counter_name: EXCEPTIONS_COUNTER_NAME,
75
91
  registry: registry,
76
92
  )
@@ -0,0 +1,46 @@
1
+ require "promenade/karafka/subscriber"
2
+
3
+ module Promenade
4
+ module Karafka
5
+ class ConsumerSubscriber < Subscriber
6
+ attach_to "consumer.karafka"
7
+
8
+ Promenade.histogram :karafka_consumer_batch_processing_duration_seconds do
9
+ doc "Consumer message processing latency in seconds"
10
+ buckets :network
11
+ end
12
+
13
+ Promenade.counter :karafka_consumer_messages_processed do
14
+ doc "Messages processed by this consumer"
15
+ end
16
+
17
+ def consumed(event)
18
+ consumer = event.payload[:caller]
19
+ messages = consumer.messages
20
+ batch_processing_duration = convert_milliseconds_to_seconds(event.payload[:time])
21
+
22
+ labels = get_labels(consumer)
23
+
24
+ Promenade.metric(:karafka_consumer_messages_processed).increment(labels, messages.size)
25
+ Promenade.metric(:karafka_consumer_batch_processing_duration_seconds).observe(labels, batch_processing_duration)
26
+ end
27
+
28
+ private
29
+
30
+ def get_labels(consumer)
31
+ metadata = consumer.messages.metadata
32
+
33
+ {
34
+ client: consumer.topic.kafka[:"client.id"],
35
+ group: consumer.topic.consumer_group.id,
36
+ topic: metadata.topic,
37
+ partition: metadata.partition,
38
+ }
39
+ end
40
+
41
+ def convert_milliseconds_to_seconds(time_in_milliseconds)
42
+ time_in_milliseconds / 1000.to_f
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,27 @@
1
+ require "promenade/karafka/subscriber"
2
+
3
+ module Promenade
4
+ module Karafka
5
+ class ErrorSubscriber < Subscriber
6
+ attach_to "error.karafka"
7
+
8
+ Promenade.counter :karafka_errors do
9
+ doc "Count of Kafka connection errors"
10
+ end
11
+
12
+ def occurred(event)
13
+ labels = get_labels(event)
14
+
15
+ Promenade.metric(:karafka_errors).increment(labels)
16
+ end
17
+
18
+ private
19
+
20
+ def get_labels(event)
21
+ {
22
+ error_type: event.payload[:type],
23
+ }
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,80 @@
1
+ require "promenade/karafka/subscriber"
2
+ require "active_support/core_ext/hash"
3
+
4
+ module Promenade
5
+ module Karafka
6
+ class StatisticsSubscriber < Subscriber
7
+ attach_to "statistics.karafka"
8
+
9
+ Promenade.histogram :karafka_connection_latency_seconds do
10
+ doc "Request latency (rtt) in seconds"
11
+ buckets :network
12
+ end
13
+
14
+ Promenade.counter :karafka_connection_calls do
15
+ doc "Count of calls made to Kafka broker"
16
+ end
17
+
18
+ Promenade.gauge :karafka_consumer_offset_lag do
19
+ doc "Lag between message create and consume time"
20
+ end
21
+
22
+ def emitted(event)
23
+ group = event.payload[:consumer_group_id]
24
+ statistics = event.payload[:statistics].with_indifferent_access
25
+ client_id = statistics[:client_id]
26
+
27
+ report_topic_metrics(statistics[:topics], group, client_id)
28
+ report_connection_metrics(statistics[:brokers], client_id)
29
+ end
30
+
31
+ private
32
+
33
+ def report_topic_metrics(topics, group, client_id)
34
+ topics.map do |topic_name, topic_values|
35
+ labels = {
36
+ client: client_id,
37
+ topic: topic_name,
38
+ group: group,
39
+ }
40
+ report_partition_metrics(topic_values, labels)
41
+ end
42
+ end
43
+
44
+ def report_partition_metrics(topic_values, labels)
45
+ topic_values[:partitions].map do |partition_name, partition_values|
46
+ next if partition_name == "-1"
47
+ next if partition_values[:consumer_lag_stored] == -1
48
+
49
+ labels = labels.merge(
50
+ partition: partition_name,
51
+ )
52
+
53
+ offset_lag = partition_values[:consumer_lag_stored]
54
+
55
+ Promenade.metric(:karafka_consumer_offset_lag).set(labels, offset_lag)
56
+ end
57
+ end
58
+
59
+ def report_connection_metrics(brokers, client_id)
60
+ labels = {
61
+ client: client_id,
62
+ }
63
+
64
+ brokers.map do |broker_name, broker_values|
65
+ next if broker_values[:nodeid] == -1
66
+
67
+ rtt = convert_microseconds_to_seconds(broker_values[:rtt][:avg])
68
+ connection_calls = broker_values[:connects]
69
+
70
+ Promenade.metric(:karafka_connection_calls).increment(labels.merge(broker: broker_name), connection_calls)
71
+ Promenade.metric(:karafka_connection_latency_seconds).observe(labels.merge(broker: broker_name), rtt)
72
+ end
73
+ end
74
+
75
+ def convert_microseconds_to_seconds(time_in_microseconds)
76
+ time_in_microseconds / 1_000_000.to_f
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,8 @@
1
+ require "active_support/subscriber"
2
+
3
+ module Promenade
4
+ module Karafka
5
+ class Subscriber < ActiveSupport::Subscriber
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ require "promenade/karafka/consumer_subscriber"
2
+ require "promenade/karafka/error_subscriber"
3
+ require "promenade/karafka/statistics_subscriber"
@@ -1,3 +1,3 @@
1
1
  module Promenade
2
- VERSION = "0.7.0".freeze
2
+ VERSION = "0.9.0".freeze
3
3
  end
data/promenade.gemspec CHANGED
@@ -31,7 +31,6 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "bundler", "~> 2.0"
32
32
  spec.add_development_dependency "byebug"
33
33
  spec.add_development_dependency "climate_control"
34
- spec.add_development_dependency "deep-cover"
35
34
  spec.add_development_dependency "rails", "> 3.0", "< 8.0"
36
35
  spec.add_development_dependency "rake"
37
36
  spec.add_development_dependency "rspec", "~> 3.11"
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.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Robinson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-01 00:00:00.000000000 Z
11
+ date: 2023-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -114,20 +114,6 @@ dependencies:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
- - !ruby/object:Gem::Dependency
118
- name: deep-cover
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - ">="
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: '0'
131
117
  - !ruby/object:Gem::Dependency
132
118
  name: rails
133
119
  requirement: !ruby/object:Gem::Requirement
@@ -302,6 +288,11 @@ files:
302
288
  - lib/promenade/kafka/fetcher_subscriber.rb
303
289
  - lib/promenade/kafka/producer_subscriber.rb
304
290
  - lib/promenade/kafka/subscriber.rb
291
+ - lib/promenade/karafka.rb
292
+ - lib/promenade/karafka/consumer_subscriber.rb
293
+ - lib/promenade/karafka/error_subscriber.rb
294
+ - lib/promenade/karafka/statistics_subscriber.rb
295
+ - lib/promenade/karafka/subscriber.rb
305
296
  - lib/promenade/prometheus.rb
306
297
  - lib/promenade/railtie.rb
307
298
  - lib/promenade/setup.rb