yabeda-http_requests 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/yabeda/http_requests.rb +4 -0
- data/lib/yabeda/http_requests/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: 43cc6ecb711ff652a406dd978752ebd74a0d976c9f4a296f596fb2eaca72b5be
|
4
|
+
data.tar.gz: f057f0dda68946fddf678dbb4f16cd2836cb047122d4611a6563f00b30270e36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d814205abf556894e66b3e5d3f44b2a5dd2fa63fde60bace12e7cb1e3d02431fb7c8512eff4198d5cd3a0875abc616bc2fa1ad9dc04011c8e0aeea41bc26394
|
7
|
+
data.tar.gz: 4590691d23794c7ea249c87f220231b8de30d770c632d8cad2a0509e670c2ffe9839d2d498d2993f54f298f65f74efce2f7c1d8045329b733a8dc26dfc1aec10
|
data/README.md
CHANGED
@@ -7,12 +7,14 @@
|
|
7
7
|
|
8
8
|
Built-in metrics for external services HTTP calls! This gem is a Part of the [yabeda](https://github.com/yabeda-rb/yabeda) suite.
|
9
9
|
|
10
|
+
Read [introduction article on dev.to](https://dev.to/dsalahutdinov/monitoring-external-services-with-prometheus-and-grafana-5eh6).
|
11
|
+
|
10
12
|
## Metrics
|
11
13
|
|
12
14
|
Works as the Puma plugin and provides following metrics:
|
13
15
|
- `http_request_total` - the number of external HTTP request attempts (by host, port, method)
|
14
16
|
- `http_response_total` - the number of made external HTTP requeusts (by host, port, method, status)
|
15
|
-
- `
|
17
|
+
- `http_response_duration` - the histogram of response duration (by host, port, method, status)
|
16
18
|
|
17
19
|
## Installation
|
18
20
|
|
@@ -63,7 +65,7 @@ After docker image builds and all the services get up, you can browse applicatio
|
|
63
65
|
|
64
66
|
Follow the [yabeda-external-http-requests](http://localhost:3000/d/OGd-oEXWz/yabeda-external-http-requests?orgId=1&refresh=5s) dashboard in Grafana.
|
65
67
|
Finally, after a couple of minutes when data collected you will see the following:
|
66
|
-
![Monitor external HTTP calls with Grafana](docs/
|
68
|
+
![Monitor external HTTP calls with Grafana](docs/dashboard.png)
|
67
69
|
|
68
70
|
## Development with Docker
|
69
71
|
|
data/lib/yabeda/http_requests.rb
CHANGED
@@ -8,6 +8,8 @@ require 'sniffer'
|
|
8
8
|
module Yabeda
|
9
9
|
# Common module
|
10
10
|
module HttpRequests
|
11
|
+
SNIFFER_STORAGE_SIZE = 0
|
12
|
+
|
11
13
|
Yabeda.configure do
|
12
14
|
group :http
|
13
15
|
|
@@ -33,7 +35,9 @@ module Yabeda
|
|
33
35
|
|
34
36
|
::Sniffer.config do |c|
|
35
37
|
c.enabled = true
|
38
|
+
c.store = { capacity: SNIFFER_STORAGE_SIZE }
|
36
39
|
c.middleware do |chain|
|
40
|
+
chain.remove(Sniffer::Middleware::Logger)
|
37
41
|
chain.add(Yabeda::HttpRequests::Sniffer)
|
38
42
|
end
|
39
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yabeda-http_requests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Salahutdinov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sniffer
|