yabeda-anycable 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e76796d4558c166a201eee2af2e0c794ec2417dc53826330b437fca2f9dae3b2
4
- data.tar.gz: b27eb4bb731973a3cb37cdbb12e843a2a03bcd92dd6bf1ff8cbffd8054481296
3
+ metadata.gz: b3f53fe940b5a2585e4ddd6a623dd487830355408582d05f1fabd544a6716eb4
4
+ data.tar.gz: ebc45e6e08150bf20348ae3cfcc499f8d984f620f773d939b4eafbd298c8dee5
5
5
  SHA512:
6
- metadata.gz: 390c3093be23828016551909a4cc4678311ca5573830b2be42ce9ff024c02666007e0211e7a04f255edb5ea340f7d96269efd5cd42e82c5c3144f7e68f4e5698
7
- data.tar.gz: 20ed44d8f1cdeb5fcaecf593bcc35068be2a2fc82a57dc71da2f0db22f024c8aeb2245c32baa541e7cc1d3416f5019e1afbdee559ac159a8b3a7a5e9764bf7a9
6
+ metadata.gz: 63cd80c5080438ad26f60f2a500fe00553ae145f814e44fa6e5952d1c1b729d13bea2c1f23642af87edc0c6428349af340ecb3ed4b0aef89e3d6d2c3ba737ba7
7
+ data.tar.gz: 0aa7b7a938246af0f13dc1624c37df5d0ab8f491e2d006b3eeb2119ae7faf0a7b319082d64ab9d199f4f151f54b45c1234d2bf5b8fe784dcd87373b488d9be23
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [Unreleased]
1
+ ## [0.1.1] - 2022-02-15
2
+
3
+ ### Changed
4
+
5
+ - Add instrumentation middleware to AnyCable RPC only when Yabeda is actually used (configured). See [issue №2](https://github.com/yabeda-rb/yabeda-anycable/issues/2)
2
6
 
3
7
  ## [0.1.0] - 2021-07-22
4
8
 
data/Gemfile CHANGED
@@ -5,6 +5,8 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in yabeda-anycable.gemspec
6
6
  gemspec
7
7
 
8
+ gem "yabeda", "~> 0.11" # Yabeda with RSpec matchers (we don't need this restriction for runtime)
9
+
8
10
  gem "pry"
9
11
  gem "pry-byebug"
10
12
  gem "pry-doc"
data/Gemfile.lock CHANGED
@@ -1,28 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yabeda-anycable (0.1.0)
4
+ yabeda-anycable (0.1.1)
5
5
  anycable-core (~> 1.1)
6
6
  yabeda (~> 0.10)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- anycable-core (1.1.1)
11
+ anycable-core (1.2.0)
12
12
  anyway_config (>= 2.1.0)
13
13
  google-protobuf (>= 3.13)
14
- anyway_config (2.1.0)
15
- ruby-next-core (>= 0.11.0)
14
+ anyway_config (2.2.3)
15
+ ruby-next-core (>= 0.14.0)
16
16
  ast (2.4.2)
17
17
  byebug (11.1.3)
18
18
  coderay (1.1.3)
19
19
  concurrent-ruby (1.1.9)
20
- diff-lcs (1.4.4)
21
- dry-initializer (3.0.4)
22
- google-protobuf (3.17.3-x86_64-linux)
20
+ diff-lcs (1.5.0)
21
+ dry-initializer (3.1.1)
22
+ google-protobuf (3.19.4)
23
23
  method_source (1.0.0)
24
- parallel (1.20.1)
25
- parser (3.0.2.0)
24
+ parallel (1.21.0)
25
+ parser (3.1.0.0)
26
26
  ast (~> 2.4.1)
27
27
  pry (0.14.1)
28
28
  coderay (~> 1.1)
@@ -30,45 +30,47 @@ GEM
30
30
  pry-byebug (3.8.0)
31
31
  byebug (~> 11.0)
32
32
  pry (~> 0.10)
33
- pry-doc (1.1.0)
33
+ pry-doc (1.3.0)
34
34
  pry (~> 0.11)
35
35
  yard (~> 0.9.11)
36
- rainbow (3.0.0)
36
+ rainbow (3.1.1)
37
37
  rake (13.0.6)
38
- regexp_parser (2.1.1)
38
+ regexp_parser (2.2.1)
39
39
  rexml (3.2.5)
40
- rspec (3.10.0)
41
- rspec-core (~> 3.10.0)
42
- rspec-expectations (~> 3.10.0)
43
- rspec-mocks (~> 3.10.0)
44
- rspec-core (3.10.1)
45
- rspec-support (~> 3.10.0)
46
- rspec-expectations (3.10.1)
40
+ rspec (3.11.0)
41
+ rspec-core (~> 3.11.0)
42
+ rspec-expectations (~> 3.11.0)
43
+ rspec-mocks (~> 3.11.0)
44
+ rspec-core (3.11.0)
45
+ rspec-support (~> 3.11.0)
46
+ rspec-expectations (3.11.0)
47
47
  diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.10.0)
49
- rspec-mocks (3.10.2)
48
+ rspec-support (~> 3.11.0)
49
+ rspec-mocks (3.11.0)
50
50
  diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.10.0)
52
- rspec-support (3.10.2)
53
- rubocop (1.18.3)
51
+ rspec-support (~> 3.11.0)
52
+ rspec-support (3.11.0)
53
+ rubocop (1.25.1)
54
54
  parallel (~> 1.10)
55
- parser (>= 3.0.0.0)
55
+ parser (>= 3.1.0.0)
56
56
  rainbow (>= 2.2.2, < 4.0)
57
57
  regexp_parser (>= 1.8, < 3.0)
58
58
  rexml
59
- rubocop-ast (>= 1.7.0, < 2.0)
59
+ rubocop-ast (>= 1.15.1, < 2.0)
60
60
  ruby-progressbar (~> 1.7)
61
61
  unicode-display_width (>= 1.4.0, < 3.0)
62
- rubocop-ast (1.8.0)
62
+ rubocop-ast (1.15.2)
63
63
  parser (>= 3.0.1.1)
64
- ruby-next-core (0.12.0)
64
+ ruby-next-core (0.14.1)
65
65
  ruby-progressbar (1.11.0)
66
- unicode-display_width (2.0.0)
67
- yabeda (0.10.0)
68
- anyway_config (>= 1.3, < 3)
66
+ unicode-display_width (2.1.0)
67
+ webrick (1.7.0)
68
+ yabeda (0.11.0)
69
+ anyway_config (>= 1.0, < 3)
69
70
  concurrent-ruby
70
71
  dry-initializer
71
- yard (0.9.26)
72
+ yard (0.9.27)
73
+ webrick (~> 1.7.0)
72
74
 
73
75
  PLATFORMS
74
76
  x86_64-linux
@@ -80,6 +82,7 @@ DEPENDENCIES
80
82
  rake (~> 13.0)
81
83
  rspec (~> 3.0)
82
84
  rubocop (~> 1.7)
85
+ yabeda (~> 0.11)
83
86
  yabeda-anycable!
84
87
 
85
88
  BUNDLED WITH
data/README.md CHANGED
@@ -4,6 +4,8 @@ Built-in metrics for monitoring [AnyCable] RPC server out of the box! Part of th
4
4
 
5
5
  See [AnyCable architecture](https://docs.anycable.io/architecture) on details on what AnyCable RPC server is. For monitoring of [AnyCable] websocket server you will need to use [monitoring capabilities](https://docs.anycable.io/anycable-go/instrumentation) built in [anycable-go] itself.
6
6
 
7
+ Get sample Grafana dashboard from [Grafana.com #14793](https://grafana.com/grafana/dashboards/14793) or from [`grafana-dashboard.json`](./grafana-dashboard.json) file.
8
+
7
9
  ## Installation
8
10
 
9
11
  ```ruby
@@ -0,0 +1,283 @@
1
+ {
2
+ "__inputs": [
3
+ {
4
+ "name": "DS_PROMETHEUS",
5
+ "label": "Prometheus",
6
+ "description": "",
7
+ "type": "datasource",
8
+ "pluginId": "prometheus",
9
+ "pluginName": "Prometheus"
10
+ }
11
+ ],
12
+ "__requires": [
13
+ {
14
+ "type": "grafana",
15
+ "id": "grafana",
16
+ "name": "Grafana",
17
+ "version": "6.6.0"
18
+ },
19
+ {
20
+ "type": "panel",
21
+ "id": "graph",
22
+ "name": "Graph",
23
+ "version": ""
24
+ },
25
+ {
26
+ "type": "datasource",
27
+ "id": "prometheus",
28
+ "name": "Prometheus",
29
+ "version": "1.0.0"
30
+ }
31
+ ],
32
+ "annotations": {
33
+ "list": [
34
+ {
35
+ "builtIn": 1,
36
+ "datasource": "-- Grafana --",
37
+ "enable": true,
38
+ "hide": true,
39
+ "iconColor": "rgba(0, 211, 255, 1)",
40
+ "name": "Annotations & Alerts",
41
+ "type": "dashboard"
42
+ }
43
+ ]
44
+ },
45
+ "description": "",
46
+ "editable": true,
47
+ "gnetId": null,
48
+ "graphTooltip": 0,
49
+ "id": null,
50
+ "links": [
51
+ {
52
+ "asDropdown": false,
53
+ "icon": "doc",
54
+ "includeVars": false,
55
+ "keepTime": false,
56
+ "tags": [],
57
+ "targetBlank": true,
58
+ "title": "yabeda-anycable",
59
+ "tooltip": "Open anycable-yabeda homepage and docs",
60
+ "type": "link",
61
+ "url": "https://github.com/yabeda-rb/yabeda-anycable"
62
+ }
63
+ ],
64
+ "panels": [
65
+ {
66
+ "aliasColors": {},
67
+ "bars": false,
68
+ "dashLength": 10,
69
+ "dashes": false,
70
+ "datasource": null,
71
+ "decimals": null,
72
+ "fieldConfig": {
73
+ "defaults": {},
74
+ "overrides": []
75
+ },
76
+ "fill": 1,
77
+ "fillGradient": 0,
78
+ "gridPos": {
79
+ "h": 9,
80
+ "w": 23,
81
+ "x": 0,
82
+ "y": 0
83
+ },
84
+ "hiddenSeries": false,
85
+ "id": 4,
86
+ "legend": {
87
+ "alignAsTable": true,
88
+ "avg": false,
89
+ "current": true,
90
+ "hideEmpty": true,
91
+ "max": true,
92
+ "min": false,
93
+ "rightSide": true,
94
+ "show": true,
95
+ "sideWidth": 350,
96
+ "sort": "max",
97
+ "sortDesc": true,
98
+ "total": false,
99
+ "values": true
100
+ },
101
+ "lines": true,
102
+ "linewidth": 1,
103
+ "nullPointMode": "null",
104
+ "options": {
105
+ "alertThreshold": true
106
+ },
107
+ "percentage": false,
108
+ "pluginVersion": "7.5.3",
109
+ "pointradius": 2,
110
+ "points": false,
111
+ "renderer": "flot",
112
+ "seriesOverrides": [],
113
+ "spaceLength": 10,
114
+ "stack": false,
115
+ "steppedLine": false,
116
+ "targets": [
117
+ {
118
+ "exemplar": true,
119
+ "expr": "histogram_quantile(0.95, sum(rate(anycable_rpc_call_runtime_seconds_bucket[1m])) by (method,command,le))",
120
+ "interval": "",
121
+ "legendFormat": "{{method}}: {{command}}",
122
+ "refId": "A"
123
+ }
124
+ ],
125
+ "thresholds": [],
126
+ "timeFrom": null,
127
+ "timeRegions": [],
128
+ "timeShift": null,
129
+ "title": "RPC call runtime (95th percentile)",
130
+ "tooltip": {
131
+ "shared": true,
132
+ "sort": 2,
133
+ "value_type": "individual"
134
+ },
135
+ "type": "graph",
136
+ "xaxis": {
137
+ "buckets": null,
138
+ "mode": "time",
139
+ "name": null,
140
+ "show": true,
141
+ "values": []
142
+ },
143
+ "yaxes": [
144
+ {
145
+ "format": "s",
146
+ "label": null,
147
+ "logBase": 1,
148
+ "max": null,
149
+ "min": "0",
150
+ "show": true
151
+ },
152
+ {
153
+ "format": "short",
154
+ "label": null,
155
+ "logBase": 1,
156
+ "max": null,
157
+ "min": null,
158
+ "show": false
159
+ }
160
+ ],
161
+ "yaxis": {
162
+ "align": false,
163
+ "alignLevel": null
164
+ }
165
+ },
166
+ {
167
+ "aliasColors": {},
168
+ "bars": false,
169
+ "dashLength": 10,
170
+ "dashes": false,
171
+ "datasource": null,
172
+ "fieldConfig": {
173
+ "defaults": {},
174
+ "overrides": []
175
+ },
176
+ "fill": 1,
177
+ "fillGradient": 0,
178
+ "gridPos": {
179
+ "h": 9,
180
+ "w": 23,
181
+ "x": 0,
182
+ "y": 9
183
+ },
184
+ "hiddenSeries": false,
185
+ "id": 2,
186
+ "legend": {
187
+ "alignAsTable": true,
188
+ "avg": false,
189
+ "current": true,
190
+ "hideEmpty": true,
191
+ "max": true,
192
+ "min": false,
193
+ "rightSide": true,
194
+ "show": true,
195
+ "sideWidth": 350,
196
+ "sort": "max",
197
+ "sortDesc": true,
198
+ "total": false,
199
+ "values": true
200
+ },
201
+ "lines": true,
202
+ "linewidth": 1,
203
+ "nullPointMode": "null",
204
+ "options": {
205
+ "alertThreshold": true
206
+ },
207
+ "percentage": false,
208
+ "pluginVersion": "7.5.3",
209
+ "pointradius": 2,
210
+ "points": false,
211
+ "renderer": "flot",
212
+ "seriesOverrides": [],
213
+ "spaceLength": 10,
214
+ "stack": false,
215
+ "steppedLine": false,
216
+ "targets": [
217
+ {
218
+ "exemplar": true,
219
+ "expr": "sum(rate(anycable_rpc_call_count[1m])) by (method, command, status)",
220
+ "interval": "",
221
+ "legendFormat": "{{method}}: {{command}} ({{status}})",
222
+ "refId": "A"
223
+ }
224
+ ],
225
+ "thresholds": [],
226
+ "timeFrom": null,
227
+ "timeRegions": [],
228
+ "timeShift": null,
229
+ "title": "RPC call throughput",
230
+ "tooltip": {
231
+ "shared": true,
232
+ "sort": 2,
233
+ "value_type": "individual"
234
+ },
235
+ "type": "graph",
236
+ "xaxis": {
237
+ "buckets": null,
238
+ "mode": "time",
239
+ "name": null,
240
+ "show": true,
241
+ "values": []
242
+ },
243
+ "yaxes": [
244
+ {
245
+ "decimals": 0,
246
+ "format": "reqps",
247
+ "label": null,
248
+ "logBase": 1,
249
+ "max": null,
250
+ "min": "0",
251
+ "show": true
252
+ },
253
+ {
254
+ "format": "short",
255
+ "label": null,
256
+ "logBase": 1,
257
+ "max": null,
258
+ "min": null,
259
+ "show": false
260
+ }
261
+ ],
262
+ "yaxis": {
263
+ "align": false,
264
+ "alignLevel": null
265
+ }
266
+ }
267
+ ],
268
+ "schemaVersion": 27,
269
+ "style": "dark",
270
+ "tags": [],
271
+ "templating": {
272
+ "list": []
273
+ },
274
+ "time": {
275
+ "from": "now-6h",
276
+ "to": "now"
277
+ },
278
+ "timepicker": {},
279
+ "timezone": "",
280
+ "title": "AnyCable RPC",
281
+ "uid": "yabeda-anycable",
282
+ "version": 1
283
+ }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yabeda
4
4
  module AnyCable
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -16,9 +16,9 @@ module Yabeda
16
16
  ].freeze
17
17
 
18
18
  ::AnyCable.configure_server do
19
- ::AnyCable.middleware.use(Middleware)
20
-
21
19
  ::Yabeda.configure do
20
+ ::AnyCable.middleware.use(Middleware)
21
+
22
22
  group :anycable
23
23
 
24
24
  counter :rpc_call_count, tags: %i[method command status], comment: "RPC calls count"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yabeda-anycable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-22 00:00:00.000000000 Z
11
+ date: 2022-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anycable-core
@@ -61,6 +61,7 @@ files:
61
61
  - Rakefile
62
62
  - bin/console
63
63
  - bin/setup
64
+ - grafana-dashboard.json
64
65
  - lib/yabeda/anycable.rb
65
66
  - lib/yabeda/anycable/middleware.rb
66
67
  - lib/yabeda/anycable/version.rb
@@ -88,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
89
  - !ruby/object:Gem::Version
89
90
  version: '0'
90
91
  requirements: []
91
- rubygems_version: 3.2.22
92
+ rubygems_version: 3.2.32
92
93
  signing_key:
93
94
  specification_version: 4
94
95
  summary: Collect performance metrics for AnyCable RPC server