yabeda-prometheus 0.9.0 → 0.9.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/.github/workflows/build-release.yml +9 -4
- data/.github/workflows/test.yml +14 -26
- data/CHANGELOG.md +7 -0
- data/lib/yabeda/prometheus/exporter.rb +13 -1
- data/lib/yabeda/prometheus/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 178705f128fcff8d9fc98c8b2db3a8b9a031d2b282f99cd522587389cd3f8001
|
4
|
+
data.tar.gz: c800d08198dcd1b62b94daabcbe0c7fdedd8c5cf5320992a63b4606475bb7f73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e78322f06706eb11df51cfd56bcba9890c7da377437e67a1ce021a55377b616e950dceb983cb2f654fa3c501f4e14bf73ffe7d07f8ce108837c9c009694c595d
|
7
|
+
data.tar.gz: 0c8eb49c988fb20e4c4154a78f4e027f35c6d216ed2c832aecb503e188f253b9c3fa6ca345e0319893ad4497e1a9f29d2213f1642b792fd22113a3262de92db4
|
@@ -8,13 +8,18 @@ on:
|
|
8
8
|
jobs:
|
9
9
|
release:
|
10
10
|
runs-on: ubuntu-latest
|
11
|
+
permissions:
|
12
|
+
contents: write
|
13
|
+
id-token: write
|
14
|
+
packages: write
|
15
|
+
|
11
16
|
steps:
|
12
|
-
- uses: actions/checkout@
|
17
|
+
- uses: actions/checkout@v4
|
13
18
|
with:
|
14
19
|
fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290
|
15
20
|
- uses: ruby/setup-ruby@v1
|
16
21
|
with:
|
17
|
-
ruby-version: 2
|
22
|
+
ruby-version: 3.2
|
18
23
|
- name: "Extract data from tag: version, message, body"
|
19
24
|
id: tag
|
20
25
|
run: |
|
@@ -75,8 +80,8 @@ jobs:
|
|
75
80
|
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
|
76
81
|
run: |
|
77
82
|
gem push yabeda-prometheus-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
|
83
|
+
- name: Configure RubyGems Credentials
|
84
|
+
uses: rubygems/configure-rubygems-credentials@main
|
78
85
|
- name: Publish to RubyGems
|
79
|
-
env:
|
80
|
-
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
|
81
86
|
run: |
|
82
87
|
gem push yabeda-prometheus-${{ steps.tag.outputs.version }}.gem
|
data/.github/workflows/test.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: Tests
|
2
2
|
|
3
3
|
on:
|
4
4
|
pull_request:
|
@@ -10,36 +10,24 @@ on:
|
|
10
10
|
|
11
11
|
jobs:
|
12
12
|
test:
|
13
|
-
|
14
|
-
if:
|
13
|
+
# Skip running tests for local pull requests (use push event instead), run only for foreign ones
|
14
|
+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
|
15
|
+
name: 'Ruby ${{ matrix.ruby }}'
|
15
16
|
runs-on: ubuntu-latest
|
16
17
|
strategy:
|
17
18
|
fail-fast: false
|
18
19
|
matrix:
|
19
|
-
|
20
|
-
-
|
21
|
-
-
|
22
|
-
-
|
23
|
-
-
|
24
|
-
|
25
|
-
image: ruby:${{ matrix.ruby }}
|
26
|
-
env:
|
27
|
-
CI: true
|
20
|
+
ruby:
|
21
|
+
- '2.7'
|
22
|
+
- '3.0'
|
23
|
+
- '3.1'
|
24
|
+
- '3.2'
|
25
|
+
- '3.3'
|
28
26
|
steps:
|
29
|
-
- uses: actions/checkout@
|
30
|
-
- uses:
|
27
|
+
- uses: actions/checkout@v4
|
28
|
+
- uses: ruby/setup-ruby@v1
|
31
29
|
with:
|
32
|
-
|
33
|
-
|
34
|
-
restore-keys: |
|
35
|
-
bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
36
|
-
bundle-${{ matrix.ruby }}-
|
37
|
-
- name: Upgrade Bundler to 2.0 (for older Rubies)
|
38
|
-
run: gem install bundler -v '~> 2.0'
|
39
|
-
- name: Bundle install
|
40
|
-
run: |
|
41
|
-
bundle config path vendor/bundle
|
42
|
-
bundle install
|
43
|
-
bundle update
|
30
|
+
ruby-version: ${{ matrix.ruby }}
|
31
|
+
bundler-cache: true
|
44
32
|
- name: Run RSpec
|
45
33
|
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
## Unreleased
|
9
9
|
|
10
|
+
## 0.9.1 - 2024-01-04
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- Compatibility with Rack 3 and Rack 2. [#27](https://github.com/yabeda-rb/yabeda-prometheus/pull/27) by [@aroop][].
|
15
|
+
|
10
16
|
## 0.9.0 - 2023-07-28
|
11
17
|
|
12
18
|
### Added
|
@@ -153,3 +159,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
153
159
|
[@palkan]: https://github.com/palkan "Vladimir Dementyev"
|
154
160
|
[@ollym]: https://github.com/ollym "Oliver Morgan"
|
155
161
|
[@etsenake]: https://github.com/etsenake "Josh Etsenake"
|
162
|
+
[@aroop]: https://github.com/aroop "Ajay Guthikonda"
|
@@ -22,7 +22,7 @@ module Yabeda
|
|
22
22
|
def start_metrics_server!(**rack_app_options)
|
23
23
|
Thread.new do
|
24
24
|
default_port = ENV.fetch("PORT", 9394)
|
25
|
-
|
25
|
+
rack_handler.run(
|
26
26
|
rack_app(**rack_app_options),
|
27
27
|
Host: ENV["PROMETHEUS_EXPORTER_BIND"] || "0.0.0.0",
|
28
28
|
Port: ENV.fetch("PROMETHEUS_EXPORTER_PORT", default_port),
|
@@ -40,6 +40,18 @@ module Yabeda
|
|
40
40
|
run NOT_FOUND_HANDLER
|
41
41
|
end
|
42
42
|
end
|
43
|
+
|
44
|
+
def rack_handler
|
45
|
+
if Gem.loaded_specs['rack']&.version&.>= Gem::Version.new('3.0')
|
46
|
+
require 'rackup'
|
47
|
+
::Rackup::Handler::WEBrick
|
48
|
+
else
|
49
|
+
::Rack::Handler::WEBrick
|
50
|
+
end
|
51
|
+
rescue LoadError
|
52
|
+
warn 'Please add gems rackup and webrick to your Gemfile to expose Yabeda metrics from prometheus-mmap'
|
53
|
+
::Rack::Handler::WEBrick
|
54
|
+
end
|
43
55
|
end
|
44
56
|
|
45
57
|
def initialize(app, options = {})
|
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.9.
|
4
|
+
version: 0.9.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:
|
11
|
+
date: 2024-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prometheus-client
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.4.10
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Extensible Prometheus exporter for your application
|