puma-cloudwatch 0.4.5 → 0.4.6

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.

Potentially problematic release.


This version of puma-cloudwatch might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70ae556e3b7f637e097d36d0296652566b0dae5c66f1d257013b1653393cf7c4
4
- data.tar.gz: 80e4da1709178513fc7e8057bb800d15a87e6e2c261b0b5e6916ad10f41eaf04
3
+ metadata.gz: d09a3ee61265bb88d4a7bf0a999a3dc1f298036c08932f030bef85f60d6d9971
4
+ data.tar.gz: 199924c67590f9fd92d51c7524d06b261071b972af77e961a796cdc1f451e02e
5
5
  SHA512:
6
- metadata.gz: 4d8f25242c010a545080e1236e9f9b6b3b608c660f6a096bbace315632cd2326925e4f322fda0bdf2b31195f5b898c09a2bf7f20c922d3daf6cd657d8e31014a
7
- data.tar.gz: 998bf6b0ebcd485d5a7212ccc0a2f189ebf588c6b08652f3549628d5dfc97fd6d93eb054ee6f8f670284d1d54453290b6b12bd02f5d470bc2de9db59c3ef6265
6
+ metadata.gz: ad6ce44c5b56f0e304000f21b20d1db834d1de8614fe726ac7f2e4b374905cd070821c30dd801a96578e8074422dca68ca86549c12f06c0058a53e59556e4ec6
7
+ data.tar.gz: 75fd2d6ba41bc8be29ce8edd0e18d2d7c18f9b928ed4b1a6710f414cc68845a91e5221918c2d7732cef022ec0bf5037c161aaf99988361e0418ffc9a955f9257
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [0.4.6] - 2023-01-05
7
+ - [#7](https://github.com/tongueroo/puma-cloudwatch/pull/7) Add PUMA_CLOUDWATCH_AWS_REGION
8
+
6
9
  ## [0.4.5] - 2021-11-09
7
10
  - [#5](https://github.com/boltops-tools/puma-cloudwatch/pull/5) Enabling high-resolution Cloudwatch metrics if frequency is lower tha…
8
11
 
data/README.md CHANGED
@@ -37,6 +37,7 @@ PUMA\_CLOUDWATCH\_DIMENSION\_VALUE | CloudWatch metric dimension value | puma
37
37
  PUMA\_CLOUDWATCH\_ENABLED | Enables sending of the data to CloudWatch. | (unset)
38
38
  PUMA\_CLOUDWATCH\_FREQUENCY | How often to send data to CloudWatch in seconds. | 60
39
39
  PUMA\_CLOUDWATCH\_NAMESPACE | CloudWatch metric namespace | WebServer
40
+ PUMA\_CLOUDWATCH\_AWS\_REGION | CloudWatch metric AWS region | (unset)
40
41
  PUMA\_CLOUDWATCH\_MUTE\_START\_MESSAGE | Mutes the "puma-cloudwatch plugin" startup message | (unset)
41
42
 
42
43
  ### Sum and Frequency Normalization
@@ -18,6 +18,7 @@ class PumaCloudwatch::Metrics
18
18
  @dimension_value = ENV['PUMA_CLOUDWATCH_DIMENSION_VALUE'] || "puma"
19
19
  @frequency = Integer(ENV['PUMA_CLOUDWATCH_FREQUENCY'] || 60)
20
20
  @enabled = ENV['PUMA_CLOUDWATCH_ENABLED'] || false
21
+ @region = ENV['PUMA_CLOUDWATCH_AWS_REGION']
21
22
  end
22
23
 
23
24
  def call
@@ -103,7 +104,12 @@ class PumaCloudwatch::Metrics
103
104
  end
104
105
 
105
106
  def cloudwatch
106
- @cloudwatch ||= Aws::CloudWatch::Client.new
107
+ @cloudwatch ||= if @region.present?
108
+ Aws::CloudWatch::Client.new(region: @region)
109
+ else
110
+ Aws::CloudWatch::Client.new
111
+ end
112
+
107
113
  rescue Aws::Errors::MissingRegionError => e
108
114
  # Happens when:
109
115
  # 1. ~/.aws/config is not also setup locally
@@ -1,3 +1,3 @@
1
1
  module PumaCloudwatch
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-cloudwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-09 00:00:00.000000000 Z
11
+ date: 2023-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cloudwatch
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.1.6
117
+ rubygems_version: 3.3.26
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Puma plugin sends puma stats to CloudWatch