prometheus_exporter 0.7.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +82 -25
- data/Appraisals +7 -3
- data/CHANGELOG +104 -24
- data/Dockerfile +9 -0
- data/README.md +258 -51
- data/bin/prometheus_exporter +19 -6
- data/examples/custom_collector.rb +1 -1
- data/gemfiles/ar_70.gemfile +5 -0
- data/lib/prometheus_exporter/client.rb +48 -23
- data/lib/prometheus_exporter/instrumentation/active_record.rb +11 -29
- data/lib/prometheus_exporter/instrumentation/delayed_job.rb +5 -2
- data/lib/prometheus_exporter/instrumentation/good_job.rb +30 -0
- data/lib/prometheus_exporter/instrumentation/method_profiler.rb +63 -23
- data/lib/prometheus_exporter/instrumentation/periodic_stats.rb +62 -0
- data/lib/prometheus_exporter/instrumentation/process.rb +5 -21
- data/lib/prometheus_exporter/instrumentation/puma.rb +34 -27
- data/lib/prometheus_exporter/instrumentation/resque.rb +35 -0
- data/lib/prometheus_exporter/instrumentation/sidekiq.rb +53 -23
- data/lib/prometheus_exporter/instrumentation/sidekiq_process.rb +52 -0
- data/lib/prometheus_exporter/instrumentation/sidekiq_queue.rb +32 -24
- data/lib/prometheus_exporter/instrumentation/sidekiq_stats.rb +37 -0
- data/lib/prometheus_exporter/instrumentation/unicorn.rb +10 -15
- data/lib/prometheus_exporter/instrumentation.rb +5 -0
- data/lib/prometheus_exporter/metric/base.rb +12 -10
- data/lib/prometheus_exporter/metric/gauge.rb +4 -0
- data/lib/prometheus_exporter/metric/histogram.rb +15 -3
- data/lib/prometheus_exporter/middleware.rb +45 -19
- data/lib/prometheus_exporter/server/active_record_collector.rb +9 -12
- data/lib/prometheus_exporter/server/collector.rb +4 -0
- data/lib/prometheus_exporter/server/delayed_job_collector.rb +24 -18
- data/lib/prometheus_exporter/server/good_job_collector.rb +52 -0
- data/lib/prometheus_exporter/server/metrics_container.rb +66 -0
- data/lib/prometheus_exporter/server/process_collector.rb +8 -13
- data/lib/prometheus_exporter/server/puma_collector.rb +14 -12
- data/lib/prometheus_exporter/server/resque_collector.rb +50 -0
- data/lib/prometheus_exporter/server/runner.rb +14 -3
- data/lib/prometheus_exporter/server/sidekiq_collector.rb +1 -1
- data/lib/prometheus_exporter/server/sidekiq_process_collector.rb +43 -0
- data/lib/prometheus_exporter/server/sidekiq_queue_collector.rb +6 -7
- data/lib/prometheus_exporter/server/sidekiq_stats_collector.rb +48 -0
- data/lib/prometheus_exporter/server/type_collector.rb +2 -0
- data/lib/prometheus_exporter/server/unicorn_collector.rb +32 -33
- data/lib/prometheus_exporter/server/web_collector.rb +17 -17
- data/lib/prometheus_exporter/server/web_server.rb +72 -41
- data/lib/prometheus_exporter/server.rb +4 -0
- data/lib/prometheus_exporter/version.rb +1 -1
- data/lib/prometheus_exporter.rb +12 -13
- data/prometheus_exporter.gemspec +6 -6
- metadata +53 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '042907307e8e1555111f34fb69d6cf66127e7742a76130952e3708a742ada24a'
|
4
|
+
data.tar.gz: 1e474618e9ddfa870a47e3ba7d7e55935677f3770d73968bb60457474b49502d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0137930945e0b254dbf0d7245d696d782044bfee9dd255ff022ffadaddafb47cdefc1aa6f83927bc84866d87fee761027590c2f08fbe730496e7099e68a883b7'
|
7
|
+
data.tar.gz: 562691a91a7f4a0e380b92236f3295177481763393db7b0db9d8763f6ac631d317e6bd21bd3368471029742b8e649a1c2a3884fa2aafe93d280aa353909d9ecd
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,42 +1,99 @@
|
|
1
|
-
name:
|
1
|
+
name: CI
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
+
branches:
|
6
|
+
- main
|
5
7
|
pull_request:
|
6
8
|
schedule:
|
7
|
-
- cron:
|
9
|
+
- cron: "0 0 * * 0" # weekly
|
10
|
+
|
11
|
+
permissions:
|
12
|
+
contents: write
|
13
|
+
packages: write
|
14
|
+
|
15
|
+
env:
|
16
|
+
DOCKER_REPO: ghcr.io/discourse/prometheus_exporter
|
8
17
|
|
9
18
|
jobs:
|
10
19
|
build:
|
11
20
|
runs-on: ubuntu-latest
|
12
|
-
name: Ruby ${{ matrix.ruby }}
|
21
|
+
name: Ruby ${{ matrix.ruby }} AR ${{ matrix.activerecord }}
|
22
|
+
timeout-minutes: 10
|
23
|
+
|
24
|
+
env:
|
25
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/ar_${{ matrix.activerecord }}.gemfile
|
26
|
+
|
13
27
|
strategy:
|
28
|
+
fail-fast: false
|
14
29
|
matrix:
|
15
|
-
ruby: [
|
30
|
+
ruby: ['3.0', '3.1', '3.2', '3.3']
|
31
|
+
activerecord: [60, 61, 70]
|
32
|
+
|
16
33
|
steps:
|
17
|
-
- uses: actions/checkout@
|
18
|
-
|
19
|
-
|
20
|
-
- uses: actions/setup-ruby@v1
|
34
|
+
- uses: actions/checkout@v2
|
35
|
+
|
36
|
+
- uses: ruby/setup-ruby@v1
|
21
37
|
with:
|
22
38
|
ruby-version: ${{ matrix.ruby }}
|
23
|
-
|
24
|
-
|
25
|
-
path: vendor/bundle
|
26
|
-
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-v2-${{ hashFiles('**/Gemfile.lock') }}
|
27
|
-
restore-keys: |
|
28
|
-
${{ runner.os }}-${{ matrix.ruby }}-gems-v2-
|
29
|
-
- name: Setup gems
|
30
|
-
run: |
|
31
|
-
gem install bundler
|
32
|
-
# for Ruby <= 2.6 , details https://github.com/rubygems/rubygems/issues/3284
|
33
|
-
gem update --system 3.0.8 && gem update --system
|
34
|
-
bundle config path vendor/bundle
|
35
|
-
bundle install --jobs 4
|
36
|
-
bundle exec appraisal install
|
39
|
+
bundler-cache: true
|
40
|
+
|
37
41
|
- name: Rubocop
|
38
42
|
run: bundle exec rubocop
|
39
|
-
|
40
|
-
run: bundle exec appraisal bundle
|
43
|
+
|
41
44
|
- name: Run tests
|
42
|
-
run: bundle exec
|
45
|
+
run: bundle exec rake
|
46
|
+
|
47
|
+
publish:
|
48
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
49
|
+
needs: build
|
50
|
+
runs-on: ubuntu-latest
|
51
|
+
|
52
|
+
outputs:
|
53
|
+
new_version_published: ${{ steps.release.outputs.new_version_published }}
|
54
|
+
|
55
|
+
steps:
|
56
|
+
- uses: actions/checkout@v2
|
57
|
+
|
58
|
+
- name: Release gem
|
59
|
+
id: release
|
60
|
+
uses: discourse/publish-rubygems-action@v2
|
61
|
+
env:
|
62
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
63
|
+
GIT_EMAIL: team@discourse.org
|
64
|
+
GIT_NAME: discoursebot
|
65
|
+
|
66
|
+
publish_docker:
|
67
|
+
needs: publish
|
68
|
+
if: needs.publish.outputs.new_version_published == 'true'
|
69
|
+
runs-on: ubuntu-latest
|
70
|
+
timeout-minutes: 20
|
71
|
+
|
72
|
+
steps:
|
73
|
+
- uses: actions/checkout@v3
|
74
|
+
- uses: docker/setup-qemu-action@v2
|
75
|
+
- uses: docker/setup-buildx-action@v2
|
76
|
+
|
77
|
+
- name: Set vars
|
78
|
+
id: vars
|
79
|
+
run: |
|
80
|
+
ruby -r ./lib/prometheus_exporter/version.rb -e 'print "version=#{PrometheusExporter::VERSION}"' >> $GITHUB_OUTPUT
|
81
|
+
|
82
|
+
- name: Login to Github Container Registry
|
83
|
+
uses: docker/login-action@v2
|
84
|
+
with:
|
85
|
+
registry: ghcr.io
|
86
|
+
username: ${{ github.actor }}
|
87
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
88
|
+
|
89
|
+
- name: Build and push images
|
90
|
+
uses: docker/build-push-action@v3
|
91
|
+
with:
|
92
|
+
context: .
|
93
|
+
push: true
|
94
|
+
platforms: linux/amd64,linux/arm64
|
95
|
+
build-args: |
|
96
|
+
GEM_VERSION=${{ steps.vars.outputs.version }}
|
97
|
+
tags: |
|
98
|
+
${{ env.DOCKER_REPO }}:${{ steps.vars.outputs.version }}
|
99
|
+
${{ env.DOCKER_REPO }}:latest
|
data/Appraisals
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
appraise "ar-60" do
|
4
|
-
|
5
|
-
# gem "activerecord", "~> 6.0.0"
|
4
|
+
gem "activerecord", "~> 6.0.0"
|
6
5
|
end
|
7
6
|
|
8
7
|
appraise "ar-61" do
|
9
|
-
gem "activerecord", "~> 6.1.
|
8
|
+
gem "activerecord", "~> 6.1.1"
|
9
|
+
end
|
10
|
+
|
11
|
+
appraise "ar-70" do
|
12
|
+
# latest version
|
13
|
+
gem "activerecord", "~> 7.1.2"
|
10
14
|
end
|
data/CHANGELOG
CHANGED
@@ -1,4 +1,84 @@
|
|
1
|
-
|
1
|
+
2.1.0 - 2024-08-01
|
2
|
+
|
3
|
+
- FEATURE: good_job instrumentation
|
4
|
+
- PERF: improve performance of histogram
|
5
|
+
- DEV: use new metric collector pattern so we reuse code between collectors
|
6
|
+
|
7
|
+
2.0.8 - 2023-01-20
|
8
|
+
|
9
|
+
- FEATURE: attempting to make our first docker release
|
10
|
+
|
11
|
+
2.0.7 - 2023-01-13
|
12
|
+
|
13
|
+
- FEATURE: allow binding server to both ipv4 and v6
|
14
|
+
- FIX: expire stale sidekiq metrics
|
15
|
+
|
16
|
+
|
17
|
+
2.0.6 - 2022-11-22
|
18
|
+
|
19
|
+
- FIX: use user specified labels over default in merge conflict
|
20
|
+
- FIX: sidekiq stats collector memory leak
|
21
|
+
|
22
|
+
2.0.5 - 2022-11-15
|
23
|
+
|
24
|
+
- FIX: regression :prepend style instrumentation not working correctly
|
25
|
+
|
26
|
+
2.0.4 - 2022-11-10
|
27
|
+
|
28
|
+
- FIX/FEATURE: support for Redis 5 gem instrumentation
|
29
|
+
|
30
|
+
2.0.3 - 2022-05-23
|
31
|
+
|
32
|
+
- FEATURE: new ping endpoint for keepalive checks
|
33
|
+
- FIX: order histogram correctly for GCP support
|
34
|
+
- FIX: improve sidekiq instrumentation
|
35
|
+
|
36
|
+
2.0.2 - 2022-02-25
|
37
|
+
|
38
|
+
- FIX: runner was not requiring unicorn integration correctly leading to a crash
|
39
|
+
|
40
|
+
2.0.1 - 2022-02-24
|
41
|
+
|
42
|
+
- FIX: ensure threads do not leak when calling #start repeatedly on instrumentation classes, this is an urgent patch for Puma integration
|
43
|
+
|
44
|
+
2.0.0 - 2022-02-18
|
45
|
+
|
46
|
+
- FEATURE: Add per worker custom labels
|
47
|
+
- FEATURE: support custom histogram buckets
|
48
|
+
- FIX: all metrics are exposing status label, and not only `http_requests_total`
|
49
|
+
- BREAKING: rename all `http_duration` metrics to `http_request_duration` to match prometheus official naming conventions (See https://prometheus.io/docs/practices/naming/#metric-names).
|
50
|
+
|
51
|
+
1.0.1 - 2021-12-22
|
52
|
+
|
53
|
+
- FEATURE: add labels to preflight requests
|
54
|
+
- FEATURE: SidekiqStats metrics
|
55
|
+
- FIX: mintor refactors to Sidekiq metrics
|
56
|
+
|
57
|
+
1.0.0 - 2021-11-23
|
58
|
+
|
59
|
+
- BREAKING: rename metrics to match prometheus official naming conventions (See https://prometheus.io/docs/practices/naming/#metric-names)
|
60
|
+
- FEATURE: Sidekiq process metrics
|
61
|
+
- FEATURE: Allow collecting web metrics as histograms
|
62
|
+
- FIX: logger improved for web server
|
63
|
+
- FIX: Remove job labels from DelayedJob queues
|
64
|
+
|
65
|
+
0.8.1 - 2021-08-04
|
66
|
+
|
67
|
+
- FEATURE: swap from hardcoded STDERR to logger pattern (see README for details)
|
68
|
+
|
69
|
+
0.8.0 - 2021-07-05
|
70
|
+
|
71
|
+
- FIX: handle ThreadError more gracefully in cases where process shuts down
|
72
|
+
- FEATURE: add job_name and queue_name labels to delayed job metrics
|
73
|
+
- FEATURE: always scope puma metrics on hostname in collector
|
74
|
+
- FEATURE: add customizable labels option to puma collector
|
75
|
+
- FEATURE: support for Resque
|
76
|
+
- DEV: Remove support for EOL ruby 2.5
|
77
|
+
- FIX: Add source location to MethodProfiler patches
|
78
|
+
- FEATURE: Improve Active Record instrumentation
|
79
|
+
- FEATURE: Support HTTP_X_AMZN_TRACE_ID when supplied
|
80
|
+
|
81
|
+
0.7.0 - 2020-12-29
|
2
82
|
|
3
83
|
- Dev: Removed support from EOL rubies, only 2.5, 2.6, 2.7 and 3.0 are supported now.
|
4
84
|
- Dev: Better support for Ruby 3.0, explicitly depending on webrick
|
@@ -6,111 +86,111 @@
|
|
6
86
|
- FEATURE: clean pattern for overriding middleware labels was introduced (in README)
|
7
87
|
- Fix: Better support for forking
|
8
88
|
|
9
|
-
0.6.0 -
|
89
|
+
0.6.0 - 2020-11-17
|
10
90
|
|
11
91
|
- FEATURE: add support for basic-auth in the prometheus_exporter web server
|
12
92
|
|
13
|
-
0.5.3 -
|
93
|
+
0.5.3 - 2020-07-29
|
14
94
|
|
15
95
|
- FEATURE: added #remove to all metric types so users can remove specific labels if needed
|
16
96
|
|
17
|
-
0.5.2 -
|
97
|
+
0.5.2 - 2020-07-01
|
18
98
|
|
19
99
|
- FEATURE: expanded instrumentation for sidekiq
|
20
100
|
- FEATURE: configurable default labels
|
21
101
|
|
22
|
-
0.5.1 -
|
102
|
+
0.5.1 - 2020-02-25
|
23
103
|
|
24
104
|
- FEATURE: Allow configuring the default client's host and port via environment variables
|
25
105
|
|
26
|
-
0.5.0 -
|
106
|
+
0.5.0 - 2020-02-14
|
27
107
|
|
28
108
|
- Breaking change: listen only to localhost by default to prevent unintended insecure configuration
|
29
109
|
- FIX: Avoid calling `hostname` aggressively, instead cache it on the exporter instance
|
30
110
|
|
31
|
-
0.4.17 -
|
111
|
+
0.4.17 - 2020-01-13
|
32
112
|
|
33
113
|
- FEATURE: add support for `to_h` on all metrics which can be used to query existing key/values
|
34
114
|
|
35
|
-
0.4.16 -
|
115
|
+
0.4.16 - 2019-11-04
|
36
116
|
|
37
117
|
- FEATURE: Support #reset! on all metric types to reset a metric to default
|
38
118
|
|
39
|
-
0.4.15 -
|
119
|
+
0.4.15 - 2019-11-04
|
40
120
|
|
41
121
|
- FEATURE: Improve delayed job collector, add pending counts
|
42
122
|
- FEATURE: New ActiveRecord collector (documented in readme)
|
43
123
|
- FEATURE: Allow passing in histogram and summary options
|
44
124
|
- FEATURE: Allow custom labels for unicorn collector
|
45
125
|
|
46
|
-
0.4.14 -
|
126
|
+
0.4.14 - 2019-09-10
|
47
127
|
|
48
128
|
- FEATURE: allow finding metrics by name RemoteMetric #find_registered_metric
|
49
129
|
- FIX: guard socket closing
|
50
130
|
|
51
|
-
0.4.13 -
|
131
|
+
0.4.13 - 2019-07-09
|
52
132
|
|
53
133
|
- Fix: Memory leak in unicorn and puma collectors
|
54
134
|
|
55
|
-
0.4.12 -
|
135
|
+
0.4.12 - 2019-05-30
|
56
136
|
|
57
137
|
- Fix: unicorn collector reporting incorrect number of unicorn workers
|
58
138
|
|
59
|
-
0.4.11 -
|
139
|
+
0.4.11 - 2019-05-15
|
60
140
|
|
61
141
|
- Fix: Handle stopping nil worker_threads in Client
|
62
142
|
- Dev: add frozen string literals
|
63
143
|
|
64
|
-
0.4.10 -
|
144
|
+
0.4.10 - 2019-04-29
|
65
145
|
|
66
146
|
- Fix: Custom label support for puma collector
|
67
147
|
- Fix: Raindrops socket collector not working correctly
|
68
148
|
|
69
|
-
0.4.9 -
|
149
|
+
0.4.9 - 2019-04-11
|
70
150
|
|
71
151
|
- Fix: Gem was not working correctly in Ruby 2.4 and below due to a syntax error
|
72
152
|
|
73
|
-
0.4.8 -
|
153
|
+
0.4.8 - 2019-04-10
|
74
154
|
|
75
155
|
- Feature: added helpers for instrumenting unicorn using raindrops
|
76
156
|
|
77
|
-
0.4.7 -
|
157
|
+
0.4.7 - 2019-04-08
|
78
158
|
|
79
159
|
- Fix: collector was not escaping " \ and \n correctly. This could lead
|
80
160
|
to a corrupt payload in some cases.
|
81
161
|
|
82
|
-
0.4.6 -
|
162
|
+
0.4.6 - 2019-04-02
|
83
163
|
|
84
164
|
- Feature: Allow resetting a counter
|
85
165
|
- Feature: Add sidekiq metrics: restarted, dead jobs counters
|
86
166
|
- Fix: Client shutting down before sending metrics to collector
|
87
167
|
|
88
|
-
0.4.5 -
|
168
|
+
0.4.5 - 2019-02-14
|
89
169
|
|
90
170
|
- Feature: Allow process collector to ship custom labels for all process metrics
|
91
171
|
- Fix: Always scope process metrics on hostname in collector
|
92
172
|
|
93
|
-
0.4.4 -
|
173
|
+
0.4.4 - 2019-02-13
|
94
174
|
|
95
175
|
- Feature: add support for local metric collection without using HTTP
|
96
176
|
|
97
|
-
0.4.3 -
|
177
|
+
0.4.3 - 2019-02-11
|
98
178
|
|
99
179
|
- Feature: Add alias for Gauge #observe called #set, this makes it a bit easier to migrate from prom
|
100
180
|
- Feature: Add increment and decrement to Counter
|
101
181
|
|
102
|
-
0.4.2 -
|
182
|
+
0.4.2 - 2018-11-30
|
103
183
|
|
104
184
|
- Fix/Feature: setting a Gauge to nil will remove Gauge (setting to non numeric will raise)
|
105
185
|
|
106
|
-
0.4.0 -
|
186
|
+
0.4.0 - 2018-10-23
|
107
187
|
|
108
188
|
- Feature: histogram support
|
109
189
|
- Feature: custom quantile support for summary
|
110
190
|
- Feature: Puma metrics
|
111
191
|
- Fix: delayed job metrics
|
112
192
|
|
113
|
-
0.3.4 -
|
193
|
+
0.3.4 - 2018-10-02
|
114
194
|
|
115
195
|
- Fix: custom collector via CLI was not working correctly
|
116
196
|
|