yabeda-prometheus-mmap 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 +4 -4
- data/README.md +50 -13
- data/lib/yabeda/prometheus/mmap/exporter.rb +1 -1
- data/lib/yabeda/prometheus/mmap/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: 3a4b12a39360e1ca4b9f1d849bee55f6022f904f444197e3e11776d3c35d10e5
|
4
|
+
data.tar.gz: 443b04248da339a56b1e37476e52a11ac6a1240cd1216102e994142902304cf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f72aa5a161e28a3a050a605ea39db45cd903fd5d24306a1fff778fffe829f304240b92e9e838258bbe9b1a90301dabc7f4c730f73f77845c5424116d87de0afb
|
7
|
+
data.tar.gz: 2f52032cc8f4dad25227d18a88184622a6b7d3c902a7bf823a189ef28791369473cd5e5dcbf6694bdcc0a7e14ba2e07518ede35e197e6d65ba10d634f3076986
|
data/README.md
CHANGED
@@ -1,8 +1,15 @@
|
|
1
|
-
|
1
|
+
<a href="https://amplifr.com/?utm_source=yabeda-prometheus-mmap">
|
2
|
+
<img width="100" height="140" align="right"
|
3
|
+
alt="Sponsored by Amplifr" src="https://amplifr-direct.s3-eu-west-1.amazonaws.com/social_images/image/37b580d9-3668-4005-8d5a-137de3a3e77c.png" />
|
4
|
+
</a>
|
2
5
|
|
3
|
-
|
6
|
+
# Yabeda::[Prometheus]::Mmap
|
7
|
+
|
8
|
+
|
9
|
+
Adapter for easy exporting your collected metrics from your application to the [Prometheus]!
|
10
|
+
It is based on [Prometheus Ruby Mmap Client](https://gitlab.com/gitlab-org/prometheus-client-mmap), that uses mmap'ed files to share metrics from multiple processes.
|
11
|
+
This allows efficient metrics processing for Ruby web apps running in multiprocess setups like Unicorn or Puma (clustered mode).
|
4
12
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
13
|
|
7
14
|
## Installation
|
8
15
|
|
@@ -14,27 +21,57 @@ gem 'yabeda-prometheus-mmap'
|
|
14
21
|
|
15
22
|
And then execute:
|
16
23
|
|
17
|
-
$ bundle
|
24
|
+
$ bundle
|
18
25
|
|
19
|
-
|
26
|
+
## Usage
|
20
27
|
|
21
|
-
|
28
|
+
1. Exporting from running web servers:
|
22
29
|
|
23
|
-
|
30
|
+
Place following in your `config.ru` _before_ running your application:
|
24
31
|
|
25
|
-
|
32
|
+
```ruby
|
33
|
+
require 'yabeda/prometheus/mmap'
|
26
34
|
|
27
|
-
|
35
|
+
use Yabeda::Prometheus::Exporter
|
36
|
+
```
|
28
37
|
|
29
|
-
|
38
|
+
Metrics will be available on `/metrics` path (configured by `:path` option).
|
30
39
|
|
31
|
-
|
40
|
+
Also you can mount it in Rails application routes as standalone Rack application.
|
32
41
|
|
33
|
-
|
42
|
+
2. Run web-server from long-running processes (delayed jobs, …):
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
require 'yabeda/prometheus/mmap'
|
46
|
+
|
47
|
+
Yabeda::Prometheus::Exporter.start_metrics_server!
|
48
|
+
```
|
49
|
+
|
50
|
+
WEBrick will be launched in separate thread and will serve metrics on `/metrics` path.
|
51
|
+
|
52
|
+
See [yabeda-sidekiq] for example.
|
34
53
|
|
35
|
-
|
54
|
+
Listening address is configured via `PROMETHEUS_EXPORTER_BIND` env variable (default is `0.0.0.0`).
|
36
55
|
|
56
|
+
Port is configured by `PROMETHEUS_EXPORTER_PORT` or `PORT` variables (default is `9394`).
|
57
|
+
|
58
|
+
|
59
|
+
## Development with Docker
|
60
|
+
|
61
|
+
Get local development environment working and tests running is very easy with docker-compose:
|
62
|
+
```bash
|
63
|
+
docker-compose run app bundle
|
64
|
+
docker-compose run app bundle exec rspec
|
65
|
+
```
|
66
|
+
|
67
|
+
## Contributing
|
68
|
+
|
69
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/yabeda-rb/yabeda-prometheus-mmap.
|
37
70
|
|
38
71
|
## License
|
39
72
|
|
40
73
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
74
|
+
|
75
|
+
[Prometheus]: https://prometheus.io/ "Open-source monitoring solution"
|
76
|
+
[yabeda-sidekiq]: https://github.com/yabeda-rb/yabeda-sidekiq
|
77
|
+
|
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.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-
|
11
|
+
date: 2020-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prometheus-client-mmap
|