puma-cloudwatch 0.3.1 → 0.4.0

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: 597cac59de90ceaab9f7824dc362138439fff16affcd0166fcfac7d286c0c53e
4
- data.tar.gz: 714fe4f86113cdf8bdb5ff55e52aea97477edf0880ef72a2ba0d51d159c2cf69
3
+ metadata.gz: 60e07444819071535b18c33e033b6dbe27bba2a970f73442eedd9b0a3d2f46e6
4
+ data.tar.gz: 24d0affea2e0d330a5074618018ebc1cd1ccb9a084fac0e4b2d57b928f0992ed
5
5
  SHA512:
6
- metadata.gz: c298cd269d1e8aa81f204c9cb8afea0576c36775ccb4117ee7e967ba06913387bbc1d958d21c30fbf637eab6564e217ed276d6c6256872bc20ad30e29b0bd14d
7
- data.tar.gz: '09cd67be3c688102cedca2d80bd0b13d8184340ed16a22388b6f8c5f7a0d7e0c99cad9fb0f9db889e8229e2987819c9c9863e662811edab687d0f33fea8f231e'
6
+ metadata.gz: 69400a1dc46b9d28bd58ba95129b946214c5a63bdad192e3c1db4510acfae2a1596a2dba1949ec81f68f6f1ed33a3267f14e315a59b984712120d9062b7729e5
7
+ data.tar.gz: 32e888a03e8cf39a435c9c2aab829483bb4f0814effa901c851e5568f308140c3df0fb483c86f1661e89bb526ff659d2c360649cc7f134fff776485123723ce6
@@ -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.0]
7
+ - improve AWS IAM setup and permission errors so Thread loop doesnt stop
8
+
6
9
  ## [0.3.1]
7
10
  - fix PUMA_CLOUDWATCH_MUTE_START_MESSAGE var
8
11
 
data/README.md CHANGED
@@ -8,7 +8,7 @@ A [puma](https://puma.io) plugin that sends puma stats to CloudWatch.
8
8
 
9
9
  **Important**: To enable the plugin to send metrics to CloudWatch you must set the `PUMA_CLOUDWATCH_ENABLED` env variable. This allows you to send only metrics on configured servers and not unintentionally send them locally.
10
10
 
11
- It also strongly encourage to sent the `PUMA_CLOUDWATCH_DIMENSION_VALUE` env variable to include your application name. For example, if your application is named "demo-web", this would be a good value to use:
11
+ It also strongly encourage to set the `PUMA_CLOUDWATCH_DIMENSION_VALUE` env variable to include your application name. For example, if your application is named "demo-web", this would be a good value to use:
12
12
 
13
13
  PUMA_CLOUDWATCH_DIMENSION_VALUE=demo-web-puma
14
14
 
@@ -84,7 +84,15 @@ class PumaCloudwatch::Metrics
84
84
  end
85
85
 
86
86
  if enabled?
87
- cloudwatch.put_metric_data(params)
87
+ begin
88
+ cloudwatch.put_metric_data(params)
89
+ rescue Aws::CloudWatch::Errors::AccessDenied => e
90
+ puts "WARN: #{e.class} #{e.message}"
91
+ puts "Unable to send metrics to CloudWatch"
92
+ rescue PumaCloudwatch::Error => e
93
+ puts "WARN: #{e.class} #{e.message}"
94
+ puts "Unable to send metrics to CloudWatch"
95
+ end
88
96
  end
89
97
  end
90
98
 
@@ -94,6 +102,12 @@ class PumaCloudwatch::Metrics
94
102
 
95
103
  def cloudwatch
96
104
  @cloudwatch ||= Aws::CloudWatch::Client.new
105
+ rescue Aws::Errors::MissingRegionError => e
106
+ # Happens when:
107
+ # 1. ~/.aws/config is not also setup locally
108
+ # 2. On EC2 instance when AWS_REGION not set
109
+ puts "WARN: #{e.class} #{e.message}"
110
+ raise PumaCloudwatch::Error.new(e.message)
97
111
  end
98
112
  end
99
113
  end
@@ -1,3 +1,3 @@
1
1
  module PumaCloudwatch
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
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.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-18 00:00:00.000000000 Z
11
+ date: 2019-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cloudwatch