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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cloudwatch_metrics/version.rb +1 -1
- data/lib/cloudwatch_metrics.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c05a115e1d85721a94703a582811740101ded81e2eaab2bbbbf6812a28d5d02e
|
4
|
+
data.tar.gz: 9cc9c8113894d10d20592206c4c0131e281e3b8973be026f3d9c7d907dca6b98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3d062eff18b802d34fb9b1126d52297832d339beac6dfc0db6af23ebe131c0c11b28281140e9bd8f631943ad625ce7f1160409d8c2aad36c8941abcaa0e79cd
|
7
|
+
data.tar.gz: 600219d188edd77b5969fbfafe3633ed888abba04afc40edb43e99f06189b5b1cdf155c5056ebdf5ffcfd99126e2f4f5571ab05cefefdd76b4932fa117f2848d
|
data/Gemfile.lock
CHANGED
data/lib/cloudwatch_metrics.rb
CHANGED
@@ -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?
|