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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 906db4d10bd83296b001ddaa09d01bb01adb55299f054cd484c52cb8e1168dd8
4
- data.tar.gz: 870e978d2065aa4ef51904b34bdd6ea38cdd48e2a5ddb19ecab4792f3d5e0194
3
+ metadata.gz: 178705f128fcff8d9fc98c8b2db3a8b9a031d2b282f99cd522587389cd3f8001
4
+ data.tar.gz: c800d08198dcd1b62b94daabcbe0c7fdedd8c5cf5320992a63b4606475bb7f73
5
5
  SHA512:
6
- metadata.gz: d25b3c9449c812c329f1f6fb3acd0dcebc93a73a5895d37e2d6b76a0b3a3d3ee5b7aa04d80111469de5b0f76dfcd6986f6f5b64c8e30b52aec9196116dbda478
7
- data.tar.gz: 1506ce4596bf8aaef915a1b098f32a376e7d9ec7771f2a40b02c972e9dfc38ffbc7f49171387aa5c44766329a18d26705c24019296bc0cb543594d254ea216d3
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@v2
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.7
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
@@ -1,4 +1,4 @@
1
- name: Run tests
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
- name: "Run tests"
14
- if: "!contains(github.event.head_commit.message, '[ci skip]')"
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
- include:
20
- - ruby: 3.0
21
- - ruby: 2.7
22
- - ruby: 2.6
23
- - ruby: 2.5
24
- container:
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@v2
30
- - uses: actions/cache@v2
27
+ - uses: actions/checkout@v4
28
+ - uses: ruby/setup-ruby@v1
31
29
  with:
32
- path: vendor/bundle
33
- key: bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
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
- ::Rack::Handler::WEBrick.run(
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 = {})
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yabeda
4
4
  module Prometheus
5
- VERSION = "0.9.0"
5
+ VERSION = "0.9.1"
6
6
  end
7
7
  end
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.0
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: 2023-07-28 00:00:00.000000000 Z
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.1.6
150
+ rubygems_version: 3.4.10
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Extensible Prometheus exporter for your application