strongmind-sidekiq-cloudwatchmetrics 2.6.2 → 2.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sidekiq/cloud_watch_metrics.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fe6e911e4388260d1bf13674dce5e4ab6d3433799bfd2848186a43a2d67b809
|
4
|
+
data.tar.gz: a1c919b1af2905a9591a7aab9c79e691ba361fc286a311fd285e4b55ba252815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48aa39fe0f573e0db86d27928efb73aeddec2058e24ed6bc8255164514ca128120ca8f548f6f53c3da4156016e577e723e90df32922700f412ead3a313f9890c
|
7
|
+
data.tar.gz: 58a0d087fa7575ad6935fc40f03b673595fb5338ea591e5ea97d4f64ccc8d699ed50515175d77ff68e26d9936ccf3a9e9d768d17c80ae8319499e7f5a6959017
|
@@ -42,7 +42,7 @@ module Sidekiq::CloudWatchMetrics
|
|
42
42
|
include Sidekiq::Component
|
43
43
|
end
|
44
44
|
|
45
|
-
def initialize(config: Sidekiq, client: Aws::CloudWatch::Client.new, namespace:
|
45
|
+
def initialize(config: Sidekiq, client: Aws::CloudWatch::Client.new(region: 'us-west-2'), namespace: ENV.fetch('NAMESPACE', 'Default-Sidekiq-CloudWatchMetrics'), process_metrics: true, additional_dimensions: {}, interval: 60, **kwargs)
|
46
46
|
# Sidekiq 6.5+ requires @config, which defaults to the top-level
|
47
47
|
# `Sidekiq` module, but can be overridden when running multiple Sidekiqs.
|
48
48
|
@config = config
|
@@ -50,7 +50,7 @@ module Sidekiq::CloudWatchMetrics
|
|
50
50
|
@namespace = namespace
|
51
51
|
@process_metrics = process_metrics
|
52
52
|
@additional_dimensions = additional_dimensions.map { |k, v| {name: k.to_s, value: v.to_s} }
|
53
|
-
@metrics_to_publish = metrics_to_publish
|
53
|
+
@metrics_to_publish = kwargs[:metrics_to_publish] || []
|
54
54
|
@interval = interval
|
55
55
|
end
|
56
56
|
|
@@ -228,12 +228,13 @@ module Sidekiq::CloudWatchMetrics
|
|
228
228
|
metric[:dimensions] = (metric[:dimensions] || []) + @additional_dimensions
|
229
229
|
end
|
230
230
|
end
|
231
|
-
|
232
231
|
# We can only put 20 metrics at a time
|
233
|
-
metrics.select { |metric| @metrics_to_publish.include?(metric[:metric_name]) }
|
232
|
+
custom_metrics = @metrics_to_publish&.any? ? metrics.select { |metric| @metrics_to_publish.include?(metric[:metric_name]) } : metrics
|
233
|
+
|
234
|
+
custom_metrics.each_slice(20) do |metric_to_publish|
|
234
235
|
@client.put_metric_data(
|
235
236
|
namespace: @namespace,
|
236
|
-
metric_data:
|
237
|
+
metric_data: metric_to_publish,
|
237
238
|
)
|
238
239
|
end
|
239
240
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongmind-sidekiq-cloudwatchmetrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- StrongMind Devops
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|