cloudwatch-metrics 1.1.2 → 1.1.3

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: c05a115e1d85721a94703a582811740101ded81e2eaab2bbbbf6812a28d5d02e
4
- data.tar.gz: 9cc9c8113894d10d20592206c4c0131e281e3b8973be026f3d9c7d907dca6b98
3
+ metadata.gz: 9f09863337a7fd11e3f2f549b23b27c574a008662ecf66283ffd614e82a95922
4
+ data.tar.gz: 72362a407b63b87d9bb68e971bcf7f02340197d8c77648aae459d4f7c9274508
5
5
  SHA512:
6
- metadata.gz: c3d062eff18b802d34fb9b1126d52297832d339beac6dfc0db6af23ebe131c0c11b28281140e9bd8f631943ad625ce7f1160409d8c2aad36c8941abcaa0e79cd
7
- data.tar.gz: 600219d188edd77b5969fbfafe3633ed888abba04afc40edb43e99f06189b5b1cdf155c5056ebdf5ffcfd99126e2f4f5571ab05cefefdd76b4932fa117f2848d
6
+ metadata.gz: '08739f23905390ab206b19ca7e29ab1284ba4b4f060834bf6c1335123ba9ed5475f77c0c82d1e347630b833eac1961dfbf5a18f5a6b8a72929de83064534ce12'
7
+ data.tar.gz: f3792f4d86690627807c906007fed115dc595b63decda1ffffcdf0be8a5f1651baf27363ccf50188f5f21ce2faff489263d59699ed98eb2a97caf745c43938ca
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudwatch-metrics (1.1.2)
4
+ cloudwatch-metrics (1.1.3)
5
5
  activesupport (~> 7.0)
6
6
  aws-sdk-cloudwatch (~> 1.73)
7
7
  rake (~> 13.0)
@@ -16,16 +16,16 @@ GEM
16
16
  tzinfo (~> 2.0)
17
17
  ast (2.4.2)
18
18
  aws-eventstream (1.2.0)
19
- aws-partitions (1.781.0)
20
- aws-sdk-cloudwatch (1.75.0)
21
- aws-sdk-core (~> 3, >= 3.174.0)
19
+ aws-partitions (1.788.0)
20
+ aws-sdk-cloudwatch (1.78.0)
21
+ aws-sdk-core (~> 3, >= 3.177.0)
22
22
  aws-sigv4 (~> 1.1)
23
- aws-sdk-core (3.175.0)
23
+ aws-sdk-core (3.178.0)
24
24
  aws-eventstream (~> 1, >= 1.0.2)
25
25
  aws-partitions (~> 1, >= 1.651.0)
26
26
  aws-sigv4 (~> 1.5)
27
27
  jmespath (~> 1, >= 1.6.1)
28
- aws-sigv4 (1.5.2)
28
+ aws-sigv4 (1.6.0)
29
29
  aws-eventstream (~> 1, >= 1.0.2)
30
30
  concurrent-ruby (1.2.2)
31
31
  debug (1.8.0)
data/README.md CHANGED
@@ -19,46 +19,11 @@ To create the initializer:
19
19
  rails generate cloudwatch_metrics:initializer
20
20
  ```
21
21
 
22
- The initializer contains descriptions for all available options. The only options you must provide a value for are listed below:
23
-
24
- * **namespace**: This is the default namespace that all metrics will be published to. This should probably match the name of your application or service.
22
+ The initializer contains descriptions for all available options. More detailed descriptions are available in the user guide, linked below. The only option you must provide a value for is `namespace`.
25
23
 
26
24
  ## Usage
27
25
 
28
- Available methods are in the `CloudwatchMetrics` module. For convenience this is aliased to `CW` by default. I.e `CloudwatchMetrics.record(...)` is equivalent to `CW.record(...)`.
29
-
30
- Metrics are recorded using `CW.record` for single data points, or `CW.record_all` for collections of data points. Required and optional parameters for these methods are detailed below.
31
-
32
- ### CW.record Required Parameters
33
-
34
- * `name`: The name of the metric.
35
- * `value`: The value for the single data point being recorded.
36
-
37
- E.g. `CW.record(name: 'search_result_count', value: 25)`
38
-
39
-
40
- `CW.record_all` has a similar method signature, but takes an array of values, and a corresponding array indicating how many times each value occurred during the period.
41
-
42
- ### CW.record_all Required Parameters
43
-
44
- * `name`: The name of the metric.
45
- * `values`: Array of values for the data points being recorded.
46
- * `counts`: Array of numbers indicating the number of times each value occurred during the period. The length of this array should match the length of the `values` array.
47
-
48
- E.g. `CW.record_all(name: 'search_result_count', values: [25, 50, 65], counts: [1, 2, 1])`
49
-
50
- This means that for the `search_result_count` metric we had one search with 25 results, two searches with 50 results, and one search with 65 results.
51
-
52
- ### Optional Parameters
53
-
54
- Both recording methods accept optional parameters, which are detailed below, along with their default values
55
-
56
- * `unit`: The unit of measure for this data point. Units help provide conceptual meaning to your data, but CloudWatch attaches no significance to a unit internally. Common values are `Seconds`, `Kilobytes`, `Percent`, `Count`, `Kilobytes/Second`. Default value is `None`. A full list of available units is available at `CloudwatchMetrics::Units`.
57
- * `namespace`: Override the namespace set in the initializer. Default is `nil`.
58
- * `dimensions`: A hash of name/value pairs that form part of the identity of a metric. Dimensions allow you to group and filter data points for a particular metric. Default is `nil`.
59
- * `timestamp`: The time associated with the data point. The timestamp can be up to two weeks in the past and up to two hours into the future. Default is the current time.
60
-
61
- E.g. `CW.record(name: 'search_result_count', value: 25, unit: CW::COUNT, namespace: 'custom_namespace', dimensions: { group: 'A', subgroup: 'B' }, timestamp: Time.current - 1.day)`
26
+ See [How To: Publish Custom Metrics to CloudWatch](https://www.notion.so/pathccm/How-To-Publish-Custom-Metrics-to-CloudWatch-821be6ddec404b3b827c146a2f5de792#74c9ec588d5841f5bad58b59853054b9) for the user guide.
62
27
 
63
28
  ### Local development
64
29
 
@@ -82,11 +47,14 @@ region = us-west-2
82
47
  output = json
83
48
  ```
84
49
 
85
- ## Cloudwatch Concepts
50
+ ## Changing this gem
51
+
52
+ ### Development
86
53
 
87
- Refer to the [Cloudwatch Documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html) for a general overview of custom metrics in CloudWatch.
54
+ Run `bundle install` to update gemlock file
55
+ Run `rake` to run tests
88
56
 
89
- ## Changing this gem
57
+ ### Deploy new gem
90
58
 
91
59
  If you make changes to this gem you need to do a few things to make those updates available to clients.
92
60
 
@@ -18,7 +18,7 @@ module CloudwatchMetrics
18
18
  end
19
19
 
20
20
  def non_production_prefix
21
- @non_production_prefix ||= 'test-'
21
+ @non_production_prefix ||= 'test/'
22
22
  end
23
23
  end
24
24
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudwatchMetrics
4
- VERSION = '1.1.2'
4
+ VERSION = '1.1.3'
5
5
  end
@@ -35,8 +35,8 @@ CloudwatchMetrics.configure do |config|
35
35
 
36
36
  # This is an optional configuration to set the namespace prefix for non-production
37
37
  # environments. This is useful if you want to avoid polluting your production
38
- # metrics with test data. If empty or nil no prefix will be applied. Defaults to 'test-'.
39
- # config.non_production_prefix = 'test-'
38
+ # metrics with test data. If empty or nil no prefix will be applied. Defaults to 'test/'.
39
+ # config.non_production_prefix = 'test/'
40
40
 
41
41
  # This is an optional configuration to set an error handler proc.
42
42
  # If not set the default error handler will log the error
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudwatch-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Puckett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-21 00:00:00.000000000 Z
11
+ date: 2023-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport