cloudwatch-metrics 1.1.1 → 1.1.2

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: aae5940338cdbe6a8908f6330531daa21de3bebe3c63a84e5c8c30fbace3413e
4
- data.tar.gz: 15cf0039191265a80066547276459f60f584bfd70924574b0719d65838b13bc3
3
+ metadata.gz: c05a115e1d85721a94703a582811740101ded81e2eaab2bbbbf6812a28d5d02e
4
+ data.tar.gz: 9cc9c8113894d10d20592206c4c0131e281e3b8973be026f3d9c7d907dca6b98
5
5
  SHA512:
6
- metadata.gz: 7c0a974cd1dd8a00473fabefa3be9721f0ce08ca832791c0e7fc764baf3d3111177d64583e30e822473392f746e5afb52a2908586d8ee87b39238283d9509556
7
- data.tar.gz: 021f06249687423051df6bc8f0adf113be020666fa0b3184b16e36bb4c174d1333c4eb90043e2b9318b626f994b4fcb75a8514ec0715c439466ea18078fe99b6
6
+ metadata.gz: c3d062eff18b802d34fb9b1126d52297832d339beac6dfc0db6af23ebe131c0c11b28281140e9bd8f631943ad625ce7f1160409d8c2aad36c8941abcaa0e79cd
7
+ data.tar.gz: 600219d188edd77b5969fbfafe3633ed888abba04afc40edb43e99f06189b5b1cdf155c5056ebdf5ffcfd99126e2f4f5571ab05cefefdd76b4932fa117f2848d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudwatch-metrics (1.1.1)
4
+ cloudwatch-metrics (1.1.2)
5
5
  activesupport (~> 7.0)
6
6
  aws-sdk-cloudwatch (~> 1.73)
7
7
  rake (~> 13.0)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudwatchMetrics
4
- VERSION = '1.1.1'
4
+ VERSION = '1.1.2'
5
5
  end
@@ -92,20 +92,19 @@ module CloudwatchMetrics
92
92
  end
93
93
 
94
94
  # convert key/value hash to format expected by AWS SDK
95
+ # ignore any keys with blank values
95
96
  def map_dimensions(dimensions)
96
97
  combined_dimensions = (configuration.default_dimensions || {}).merge(dimensions || {})
97
98
 
98
99
  mapped_values = []
99
100
  combined_dimensions.keys.each do |key|
100
- mapped_values << {
101
- name: key.to_s,
102
- value: combined_dimensions[key]
103
- }
101
+ mapped_values << {name: key.to_s, value: combined_dimensions[key]} if combined_dimensions[key].present?
104
102
  end
105
103
 
106
104
  mapped_values
107
105
  end
108
106
 
107
+ # handle error by calling configured error handler or logging and raising
109
108
  def handle_error(error)
110
109
  if !configuration.error_handler.nil?
111
110
  configuration.error_handler.call(error)
@@ -116,6 +115,7 @@ module CloudwatchMetrics
116
115
  raise CloudwatchMetrics::Error, error.message
117
116
  end
118
117
 
118
+ # get namespace from configuration or use provided value and apply non-production prefix if applicable
119
119
  def full_namespace(provided_namespace)
120
120
  constructed_namespace = provided_namespace || configuration.namespace
121
121
  raise CloudwatchMetrics::Error, 'Namespace must be provided' if constructed_namespace.blank?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudwatch-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Puckett