yabeda-prometheus-mmap 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +11 -0
- data/CHANGELOG.md +17 -0
- data/README.md +5 -0
- data/lib/yabeda/prometheus/mmap/adapter.rb +11 -0
- data/lib/yabeda/prometheus/mmap/exporter.rb +11 -2
- data/lib/yabeda/prometheus/mmap/version.rb +1 -1
- data/yabeda-prometheus-mmap.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 759db288b622e2ae72ba1d304d0cabbf31d67f9e68cbc7f056c34a33b636e101
|
4
|
+
data.tar.gz: c6778787416e6ebe3a719d2bf8e88e910e6eb4518fa1f5d8fde4571839f0fb4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 739bfbbb8de20743592d0528bd0e7a83c3a8c2e416cab44c10e2a4f90fd8577c3d17f287df1ece768bded0a4645f401e78856f59782a2c0e22d001aec650fc42
|
7
|
+
data.tar.gz: a69d049adb2ef301e0efd1cc01bb49fa0632c4584727de5ac4d0f647602df887bbc92203cb22ceb4585f5c20d926c09f9db6222a0310033fd71cc481d095d252
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,22 @@ 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.2.0 - 2021-07-21
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Debug mode with metric `yabeda_prometheus_mmap_render_duration` to measure how long takes to render response with already collected metrics for Prometheus. Requires Yabeda 0.10+. [@Envek], [@dsalahutdinov]
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- Yabeda 0.10.0 or newer is required. [@Envek]
|
17
|
+
|
18
|
+
## 0.1.2 - 2021-06-23
|
19
|
+
|
20
|
+
### Fixed
|
21
|
+
|
22
|
+
- Fix `uninitialized constant Yabeda::Rack::Handler (NameError)` when using [yabeda-rack-attack](https://github.com/dsalahutdinov/yabeda-rack-attack). [@dsalahutdinov]
|
23
|
+
|
8
24
|
## 0.1.1 - 2020-08-04
|
9
25
|
|
10
26
|
### Fixed
|
@@ -17,3 +33,4 @@ Initial release. [@dsalahutdinov][]
|
|
17
33
|
|
18
34
|
[@macchiang]: https://github.com/macchiang "Mac"
|
19
35
|
[@dsalahutdinov]: https://github.com/dsalahutdinov "Salahutdinov Dmitry"
|
36
|
+
[@Envek]: https://github.com/Envek "Andrey Novikov"
|
data/README.md
CHANGED
@@ -55,6 +55,11 @@ And then execute:
|
|
55
55
|
|
56
56
|
Port is configured by `PROMETHEUS_EXPORTER_PORT` or `PORT` variables (default is `9394`).
|
57
57
|
|
58
|
+
## Debugging metrics
|
59
|
+
|
60
|
+
- Time of already collected metrics rendering in response for Prometheus: `yabeda_prometheus_mmap_render_duration`.
|
61
|
+
|
62
|
+
These are only enabled in debug mode. See [Yabeda debugging metrics](https://github.com/yabeda-rb/yabeda#debugging-metrics) on how to enable it (e.g. by specifying `YABEDA_DEBUG=true` in your environment variables).
|
58
63
|
|
59
64
|
## Development with Docker
|
60
65
|
|
@@ -75,6 +75,17 @@ module Yabeda
|
|
75
75
|
raise ArgumentError, 'Prometheus require metrics to have comments'
|
76
76
|
end
|
77
77
|
|
78
|
+
def debug!
|
79
|
+
Yabeda.configure do
|
80
|
+
group :yabeda_prometheus_mmap
|
81
|
+
|
82
|
+
histogram :render_duration,
|
83
|
+
tags: %i[], unit: :seconds,
|
84
|
+
buckets: [0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10],
|
85
|
+
comment: 'Time required to render all metrics in Prometheus format'
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
78
89
|
Yabeda.register_adapter(:prometheus, new)
|
79
90
|
end
|
80
91
|
end
|
@@ -47,8 +47,17 @@ module Yabeda
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def call(env)
|
50
|
-
Yabeda.
|
51
|
-
|
50
|
+
::Yabeda.collect! if env['PATH_INFO'] == path
|
51
|
+
|
52
|
+
if ::Yabeda.debug?
|
53
|
+
result = nil
|
54
|
+
::Yabeda.yabeda_prometheus_mmap.render_duration.measure({}) do
|
55
|
+
result = super
|
56
|
+
end
|
57
|
+
result
|
58
|
+
else
|
59
|
+
super
|
60
|
+
end
|
52
61
|
end
|
53
62
|
end
|
54
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yabeda-prometheus-mmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Salahutdinov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prometheus-client-mmap
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.10'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
40
|
+
version: '0.10'
|
41
41
|
description: Uses prometheus-client-mmap
|
42
42
|
email:
|
43
43
|
- dsalahutdinov@gmail.com
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- ".github/workflows/test.yml"
|
50
50
|
- ".gitignore"
|
51
51
|
- ".rspec"
|
52
|
+
- ".rubocop.yml"
|
52
53
|
- CHANGELOG.md
|
53
54
|
- Gemfile
|
54
55
|
- LICENSE.txt
|