puma-cloudwatch 0.4.5 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70ae556e3b7f637e097d36d0296652566b0dae5c66f1d257013b1653393cf7c4
4
- data.tar.gz: 80e4da1709178513fc7e8057bb800d15a87e6e2c261b0b5e6916ad10f41eaf04
3
+ metadata.gz: b0f5f9757f6fd2ca0da318c57d6e16f05072b2f7e004b7c67e863567e6a21feb
4
+ data.tar.gz: 354658460c267d9a730fd297f3b42e1d5d19b162a9503679d9f5f0ed40776138
5
5
  SHA512:
6
- metadata.gz: 4d8f25242c010a545080e1236e9f9b6b3b608c660f6a096bbace315632cd2326925e4f322fda0bdf2b31195f5b898c09a2bf7f20c922d3daf6cd657d8e31014a
7
- data.tar.gz: 998bf6b0ebcd485d5a7212ccc0a2f189ebf588c6b08652f3549628d5dfc97fd6d93eb054ee6f8f670284d1d54453290b6b12bd02f5d470bc2de9db59c3ef6265
6
+ metadata.gz: 28412c44a0d354767ef34d855f86560cb6f467d72ac1721897e4302a393f4d05fc3b5d681490008435c105c84c77b4d236662485282cffbb36df7e53fa662d85
7
+ data.tar.gz: 20437ec6faed3244a69f6ff90ba5cd6e4c1da64990509c222275133e588c718bd31dda8accb6c725946b486df474376ca78740bc5ba00cedd39d56c4258532f2
data/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
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.8] - 2023-02-24
7
+ - [#10](https://github.com/tongueroo/puma-cloudwatch/pull/10) fix region if check
8
+ - loosen development dependencies
9
+
10
+ ## [0.4.7] - 2023-02-24
11
+ - [#9](https://github.com/tongueroo/puma-cloudwatch/pull/9) fix region if check
12
+
13
+ ## [0.4.6] - 2023-01-05
14
+ - [#7](https://github.com/tongueroo/puma-cloudwatch/pull/7) Add PUMA_CLOUDWATCH_AWS_REGION
15
+
6
16
  ## [0.4.5] - 2021-11-09
7
17
  - [#5](https://github.com/boltops-tools/puma-cloudwatch/pull/5) Enabling high-resolution Cloudwatch metrics if frequency is lower tha…
8
18
 
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.nil? || @region.empty?
108
+ Aws::CloudWatch::Client.new
109
+ else
110
+ Aws::CloudWatch::Client.new(region: @region)
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.8"
3
3
  end
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency "aws-sdk-cloudwatch"
25
25
 
26
- spec.add_development_dependency "bundler", "~> 2.0"
27
- spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "rspec", "~> 3.0"
26
+ spec.add_development_dependency "bundler"
27
+ spec.add_development_dependency "rake"
28
+ spec.add_development_dependency "rspec"
29
29
  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.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-09 00:00:00.000000000 Z
11
+ date: 2023-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cloudwatch
@@ -28,45 +28,45 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '2.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '3.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '3.0'
69
- description:
68
+ version: '0'
69
+ description:
70
70
  email:
71
71
  - tongueroo@gmail.com
72
72
  executables: []
@@ -99,7 +99,7 @@ homepage: https://github.com/boltops-tools/puma-cloudwatch
99
99
  licenses:
100
100
  - MIT
101
101
  metadata: {}
102
- post_install_message:
102
+ post_install_message:
103
103
  rdoc_options: []
104
104
  require_paths:
105
105
  - lib
@@ -114,8 +114,8 @@ 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
118
- signing_key:
117
+ rubygems_version: 3.3.26
118
+ signing_key:
119
119
  specification_version: 4
120
120
  summary: Puma plugin sends puma stats to CloudWatch
121
121
  test_files: []