yabeda-prometheus 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +3 -2
- data/lib/yabeda/prometheus.rb +1 -0
- data/lib/yabeda/prometheus/exporter.rb +10 -2
- data/lib/yabeda/prometheus/version.rb +1 -1
- data/yabeda-prometheus.gemspec +6 -1
- metadata +6 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1922a6edd3de4513c03bb3405280060973cfe6c0004b56be0bf0c923934eb82f
|
4
|
+
data.tar.gz: acc3a06038a5cf9f972406b0edd466ae04f49643d2ad784d0c9e2565919a7308
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed6e18d43df3f06ad848c6b6965e7093a71ba36d4c34e3e3bfb93f43eda220bf738436604f0db3ae63e026e53bd6eccfe6ec9f60d667a4cb0687f7ac2a9ce5bb
|
7
|
+
data.tar.gz: 2b77cc35bc3f5e72033aa624371630d6221ba54dc5d3ea5c222db62a12bddca589c5c5bf7bc5925e76de0d5d38083fe5ae7c754bcb913492a2af34b8c9970753
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,28 @@ 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
8
|
|
9
|
+
## 0.1.4 - 2018-11-06
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Support for prometheus-client-mmap gem that allow to collect metrics from
|
14
|
+
forking servers like Passenger or Puma in clustered mode. @Envek
|
15
|
+
|
16
|
+
Now you need to manually specify which gem you need to use in your Gemfile
|
17
|
+
due to lack of either/or dependencies in RubyGems.
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem "prometheus-client"
|
21
|
+
gem "yabeda-prometheus"
|
22
|
+
```
|
23
|
+
|
24
|
+
Or:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
gem "prometheus-client-mmap"
|
28
|
+
gem "yabeda-prometheus"
|
29
|
+
```
|
30
|
+
|
9
31
|
## 0.1.3 - 2018-10-31
|
10
32
|
|
11
33
|
### Added
|
data/README.md
CHANGED
@@ -16,9 +16,10 @@ Adapter for easy exporting your collected metrics from your application to the [
|
|
16
16
|
|
17
17
|
## Installation
|
18
18
|
|
19
|
-
Add this
|
19
|
+
Add this lines to your application's Gemfile:
|
20
20
|
|
21
21
|
```ruby
|
22
|
+
gem 'prometheus-client' # Or 'prometheus-client-mmap' if you need multi-process support
|
22
23
|
gem 'yabeda-prometheus'
|
23
24
|
```
|
24
25
|
|
@@ -52,7 +53,7 @@ And then execute:
|
|
52
53
|
|
53
54
|
Listening address is configured via `PROMETHEUS_EXPORTER_BIND` env variable (default is `0.0.0.0`).
|
54
55
|
|
55
|
-
Port is configured by `PROMETHEUS_EXPORTER_PORT` or `PORT` variables (default is `
|
56
|
+
Port is configured by `PROMETHEUS_EXPORTER_PORT` or `PORT` variables (default is `9394`).
|
56
57
|
|
57
58
|
3. Use push gateway for short living things (rake tasks, cron jobs, …):
|
58
59
|
|
data/lib/yabeda/prometheus.rb
CHANGED
@@ -1,11 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
begin
|
4
|
+
# Try to load exporter from GitLab's prometheus-client-mmap gem
|
5
|
+
require "prometheus/client/rack/exporter"
|
6
|
+
BASE_EXPORTER_CLASS = ::Prometheus::Client::Rack::Exporter
|
7
|
+
rescue LoadError
|
8
|
+
# Try to load exporter from original prometheus-client
|
9
|
+
require "prometheus/middleware/exporter"
|
10
|
+
BASE_EXPORTER_CLASS = ::Prometheus::Middleware::Exporter
|
11
|
+
end
|
4
12
|
|
5
13
|
module Yabeda
|
6
14
|
module Prometheus
|
7
15
|
# Rack application or middleware that provides metrics exposition endpoint
|
8
|
-
class Exporter <
|
16
|
+
class Exporter < BASE_EXPORTER_CLASS
|
9
17
|
NOT_FOUND_HANDLER = lambda do |_env|
|
10
18
|
[404, { "Content-Type" => "text/plain" }, ["Not Found\n"]]
|
11
19
|
end.freeze
|
data/yabeda-prometheus.gemspec
CHANGED
@@ -26,7 +26,12 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
28
|
spec.add_dependency "yabeda"
|
29
|
-
|
29
|
+
|
30
|
+
spec.post_install_message = <<~MESSAGE
|
31
|
+
You need to have installed either prometheus-client or prometheus-client-mmap
|
32
|
+
gem for yabeda-prometheus to work.
|
33
|
+
Please make sure that you have added one of them to your Gemfile.
|
34
|
+
MESSAGE
|
30
35
|
|
31
36
|
spec.add_development_dependency "bundler", "~> 1.17"
|
32
37
|
spec.add_development_dependency "rake", "~> 12.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yabeda-prometheus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Novikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yabeda
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: prometheus-client
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,7 +99,10 @@ metadata:
|
|
113
99
|
homepage_uri: https://github.com/yabeda-rb/yabeda-prometheus
|
114
100
|
source_code_uri: https://github.com/yabeda-rb/yabeda-prometheus
|
115
101
|
changelog_uri: https://github.com/yabeda-rb/yabeda-prometheus/blob/master/CHANGELOG.md
|
116
|
-
post_install_message:
|
102
|
+
post_install_message: |
|
103
|
+
You need to have installed either prometheus-client or prometheus-client-mmap
|
104
|
+
gem for yabeda-prometheus to work.
|
105
|
+
Please make sure that you have added one of them to your Gemfile.
|
117
106
|
rdoc_options: []
|
118
107
|
require_paths:
|
119
108
|
- lib
|