sidekiq_prometheus 1.7.0 → 1.8.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: c76de7fe8caef12bc6e505dd5e01648c5da34d87b00a6cf756d232a1c988bb46
4
- data.tar.gz: d211a23831395d5058a7c9ddb281870fde3154956194324984a816b54067e300
3
+ metadata.gz: 99f2c02a2ecdac71a05de9212319cc8efafb5e15d39d1a46d9dcd60d32ff847d
4
+ data.tar.gz: b43c963a8c63ca92ad695a8a5ef191701a2486772aaea24ad333ad6aacf66363
5
5
  SHA512:
6
- metadata.gz: 0cc266bed6f539d955405fe35b5e41a2f539b65ce7d4a552b70e745fe760a6e1a216ee22278889a193e7456e42bc72cc54b486b7f7266a2a3e80b33754c251f4
7
- data.tar.gz: 1544e8d064ccc46548153382e531131e250b4bf8acf567daebbf40daab8d934c0d46ef11bdd05ad7ff16f6961b79a205bde999d4e17b1a27e272ca2c1dd1b827
6
+ metadata.gz: 74a9dda61a073d84576614a107966b9e6f714896b1925b1a2983f8f5ff64d2fa4f19007b47eaa6926f9f8a76cd0162a4c95dc11e97b11b9d40d9804ed6765d69
7
+ data.tar.gz: d7d1784f6aa693eb0e96613d2f0af6ee49d26e11f6d061c61dc7c75e73c12760fbc95b4e526c6b8d017083a7a5c518b79fa0c339266c60d9e2c6611a702bd641
data/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  CHANGELOG
2
2
 
3
+ <a name="v1.8.0"></a>
4
+ ## [v1.8.0](https://github.com/fastly/sidekiq-prometheus/compare/v1.7.0...v1.8.0) (2022-10-04)
5
+
6
+ ### Features
7
+
8
+ * handle rate limiting exceptions distinctly from other exceptions ([#28](https://github.com/fastly/sidekiq-prometheus/issues/28))
9
+
10
+ ### Pull Requests
11
+
12
+ * Merge pull request [#27](https://github.com/fastly/sidekiq-prometheus/issues/27) from pinkahd/patch-1
13
+
14
+
15
+ <a name="v1.7.0"></a>
16
+ ## [v1.7.0](https://github.com/fastly/sidekiq-prometheus/compare/v1.6.0...v1.7.0) (2022-09-29)
17
+
18
+ ### Bug Fixes
19
+
20
+ * s/metrics_server_logging_enabled/metrics_server_logger_enabled/
21
+
22
+ ### Features
23
+
24
+ * add Sidekiq::Stats processes_size to the periodic metrics
25
+
26
+ ### Pull Requests
27
+
28
+ * Merge pull request [#30](https://github.com/fastly/sidekiq-prometheus/issues/30) from fastly/add_processes_size
29
+
30
+
3
31
  <a name="v1.6.0"></a>
4
32
  ## [v1.6.0](https://github.com/fastly/sidekiq-prometheus/compare/v1.5.0...v1.6.0) (2021-08-03)
5
33
 
@@ -46,8 +74,9 @@ CHANGELOG
46
74
 
47
75
  ### Pull Requests
48
76
 
49
- * Merge pull request [#17](https://github.com/fastly/sidekiq-prometheus/issues/17) from jetpks/add-option-to-disable-metrics-server
77
+ * Merge pull request [#18](https://github.com/fastly/sidekiq-prometheus/issues/18) from jetpks/release-120
50
78
  * Merge pull request [#15](https://github.com/fastly/sidekiq-prometheus/issues/15) from silicakes/master
79
+ * Merge pull request [#17](https://github.com/fastly/sidekiq-prometheus/issues/17) from jetpks/add-option-to-disable-metrics-server
51
80
 
52
81
  <a name="v1.1.0"></a>
53
82
  ## [v1.1.0](https://github.com/fastly/sidekiq-prometheus/compare/v1.0.1...v1.1.0) (2020-02-12)
@@ -63,6 +92,14 @@ CHANGELOG
63
92
  * Merge pull request [#11](https://github.com/fastly/sidekiq-prometheus/issues/11) from rossjones/patch-1
64
93
  * Merge pull request [#12](https://github.com/fastly/sidekiq-prometheus/issues/12) from fastly/hr
65
94
 
95
+ <a name="v1.0.1"></a>
96
+ ## [v1.0.1](https://github.com/fastly/sidekiq-prometheus/compare/v0.9.2...v1.0.1) (2019-10-30)
97
+
98
+ ### Pull Requests
99
+
100
+ * Merge pull request [#9](https://github.com/fastly/sidekiq-prometheus/issues/9) from we4tech/features/update-prometheus-client
101
+
102
+
66
103
  <a name="v1.0.0"></a>
67
104
  ## [v1.0.0](https://github.com/fastly/sidekiq-prometheus/compare/v0.9.1...v1.0.0) (2019-10-24)
68
105
 
@@ -71,6 +108,10 @@ CHANGELOG
71
108
  * Merge pull request [#9](https://github.com/fastly/sidekiq-prometheus/issues/9) from we4tech/features/update-prometheus-client
72
109
 
73
110
 
111
+ <a name="v0.9.2"></a>
112
+ ## [v0.9.2](https://github.com/fastly/sidekiq-prometheus/compare/v1.0.0...v0.9.2) (2019-10-30)
113
+
114
+
74
115
  <a name="v0.9.1"></a>
75
116
  ## [v0.9.1](https://github.com/fastly/sidekiq-prometheus/compare/v0.9.0...v0.9.1) (2019-07-08)
76
117
 
data/README.md CHANGED
@@ -75,8 +75,8 @@ end
75
75
 
76
76
  #### Configuration options
77
77
 
78
- * `preset_labels`: Hash of labels that will be included with every metric when they are registered.
79
- * `custom_labels`: Array of names for each label that will be passed during the reporting.
78
+ * `preset_labels`: Hash of labels that will be included with every metric when they are registered. `Hash{Symbol (label name) => String (label value)}`
79
+ * `custom_labels`: Hash of metrics and labels that can be applied to specific metrics. The metric name must be a registered metric. `Hash{Symbol (metric name) => Array<Symbol> (label names)}`
80
80
  * `gc_metrics_enabled`: Boolean that determines whether to record object allocation metrics per job. The default is `true`. Setting this to `false` if you don't need this metric.
81
81
  * `global_metrics_enabled`: Boolean that determines whether to report global metrics from the PeriodicMetrics reporter. When `true` this will report on a number of stats from the Sidekiq API for the cluster. This requires Sidekiq::Enterprise as the reporter uses the leader election functionality to ensure that only one worker per cluster is reporting metrics.
82
82
  * `periodic_metrics_enabled`: Boolean that determines whether to run the periodic metrics reporter. `PeriodicMetrics` runs a separate thread that reports on global metrics (if enabled) as well worker GC stats (if enabled). It reports metrics on the interval defined by `periodic_reporting_interval`. Defaults to `true`.
@@ -91,7 +91,7 @@ end
91
91
  ```ruby
92
92
  SidekiqPrometheus.configure do |config|
93
93
  config.preset_labels = { service: 'myapp' }
94
- config.custom_labels = [:worker_class, :job_type, :any_other_label]
94
+ config.custom_labels = { sidekiq_job_count: [:worker_class, :job_type, :any_other_label] }
95
95
  config.gc_metrics_enabled = false
96
96
  config.global_metrics_enabled = true
97
97
  config.periodic_metrics_enabled = true
@@ -254,11 +254,7 @@ To install this gem onto your local machine, run `bundle exec rake install`.
254
254
 
255
255
  ## Contributors
256
256
 
257
- * Lukas Eklund ([@leklund](https://github.com/leklund))
258
- * NHM Tanveer Hossain Khan ([@we4tech](https://github.com/we4tech))
259
- * [@Postmodern](https://github.com/postmodern)
260
- * Ross Jones ([@rossjones](https://github.com/rossjones))
261
- * Alejandro Arrufat ([@mirubiri](https://github.com/mirubiri))
257
+ See: https://github.com/fastly/sidekiq-prometheus/graphs/contributors
262
258
 
263
259
  ## Contributing
264
260
 
@@ -30,8 +30,13 @@ class SidekiqPrometheus::JobMetrics
30
30
 
31
31
  result
32
32
  rescue StandardError => e
33
- err_label = { :error_class => e.class.to_s }
34
- registry[:sidekiq_job_failed].increment(labels: err_label.merge(labels))
33
+ if e.class.to_s == 'Sidekiq::Limiter::OverLimit'
34
+ registry[:sidekiq_job_over_limit].increment(labels: labels)
35
+ else
36
+ err_label = { :error_class => e.class.to_s }
37
+ registry[:sidekiq_job_failed].increment(labels: err_label.merge(labels))
38
+ end
39
+
35
40
  raise e
36
41
  ensure
37
42
  registry[:sidekiq_job_count].increment(labels: labels)
@@ -72,6 +72,10 @@ module SidekiqPrometheus::Metrics
72
72
  type: :counter,
73
73
  docstring: 'Count of successful Sidekiq jobs',
74
74
  labels: JOB_LABELS, },
75
+ { name: :sidekiq_job_over_limit,
76
+ type: :counter,
77
+ docstring: 'Count of over limit Sidekiq jobs',
78
+ labels: JOB_LABELS, },
75
79
  ].freeze
76
80
  SIDEKIQ_GC_METRIC = {
77
81
  name: :sidekiq_job_allocated_objects,
@@ -44,7 +44,11 @@ class SidekiqPrometheus::PeriodicMetrics
44
44
  @sidekiq_queue = sidekiq_queue
45
45
  @senate = if senate.nil?
46
46
  if Object.const_defined?('Sidekiq::Senate')
47
- Sidekiq::Senate
47
+ if Sidekiq::Senate.respond_to?(:leader?)
48
+ Sidekiq::Senate
49
+ else
50
+ Sidekiq::Senate.new(Sidekiq)
51
+ end
48
52
  else
49
53
  Senate
50
54
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqPrometheus
4
- VERSION = '1.7.0'
4
+ VERSION = '1.8.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_prometheus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Eklund
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-09-29 00:00:00.000000000 Z
12
+ date: 2022-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler