cloudwatch-metrics 1.1.2 → 1.1.4

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: c05a115e1d85721a94703a582811740101ded81e2eaab2bbbbf6812a28d5d02e
4
- data.tar.gz: 9cc9c8113894d10d20592206c4c0131e281e3b8973be026f3d9c7d907dca6b98
3
+ metadata.gz: 7a695784586836327fc97343e6d10959f915f3dc21f30fa50b734c5b4051075c
4
+ data.tar.gz: 372ea580850057678c327936ade66bb35904353cd52aee416d6b6fca304e3b60
5
5
  SHA512:
6
- metadata.gz: c3d062eff18b802d34fb9b1126d52297832d339beac6dfc0db6af23ebe131c0c11b28281140e9bd8f631943ad625ce7f1160409d8c2aad36c8941abcaa0e79cd
7
- data.tar.gz: 600219d188edd77b5969fbfafe3633ed888abba04afc40edb43e99f06189b5b1cdf155c5056ebdf5ffcfd99126e2f4f5571ab05cefefdd76b4932fa117f2848d
6
+ metadata.gz: b2ae2faa48dd04d4773760a31ea7d274bd5837cb55472a2101728316bea718e4d2cc4eb54ea4355a61a99a6f35fa1829ee4e2be7afc2c0dd8a6ecf061d067926
7
+ data.tar.gz: 429579c99ee8f7068dd35aa3000ac9ab6dee585c7c7004ca40b92d0faaf63afca336287f57a510034f0d6dd6efa255226942b204de4813f02eaff6282226f0a7
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
@@ -1,3 +1,7 @@
1
+ # DEPRECATED
2
+
3
+ We no longer write metrics to Cloudwatch. Write to Datadog instead.
4
+
1
5
  # CloudwatchMetrics
2
6
 
3
7
  `CloudwatchMetrics` is a Ruby gem for writing custom metrics to AWS Cloudwatch.
@@ -19,46 +23,11 @@ To create the initializer:
19
23
  rails generate cloudwatch_metrics:initializer
20
24
  ```
21
25
 
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.
26
+ 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
27
 
26
28
  ## Usage
27
29
 
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)`
30
+ 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
31
 
63
32
  ### Local development
64
33
 
@@ -82,11 +51,14 @@ region = us-west-2
82
51
  output = json
83
52
  ```
84
53
 
85
- ## Cloudwatch Concepts
54
+ ## Changing this gem
86
55
 
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.
56
+ ### Development
88
57
 
89
- ## Changing this gem
58
+ Run `bundle install` to update gemlock file
59
+ Run `rake` to run tests
60
+
61
+ ### Deploy new gem
90
62
 
91
63
  If you make changes to this gem you need to do a few things to make those updates available to clients.
92
64
 
@@ -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.4'
5
5
  end
@@ -9,6 +9,8 @@ require_relative 'cloudwatch_metrics/constants'
9
9
 
10
10
  # Posts custom metrics to AWS CloudWatch
11
11
  module CloudwatchMetrics
12
+ extend Gem::Deprecate
13
+
12
14
  class Error < StandardError; end
13
15
 
14
16
  class << self
@@ -48,6 +50,7 @@ module CloudwatchMetrics
48
50
  rescue StandardError => e
49
51
  handle_error(e)
50
52
  end
53
+ deprecate :record, :none, 2025, 1
51
54
 
52
55
  def record_all(
53
56
  name:, values:, counts:, unit: nil, namespace: nil, dimensions: nil, timestamp: nil
@@ -64,6 +67,7 @@ module CloudwatchMetrics
64
67
  rescue StandardError => e
65
68
  handle_error(e)
66
69
  end
70
+ deprecate :record_all, :none, 2025, 1
67
71
 
68
72
  private
69
73
 
@@ -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.4
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: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -100,5 +100,5 @@ requirements: []
100
100
  rubygems_version: 3.2.32
101
101
  signing_key:
102
102
  specification_version: 4
103
- summary: Ruby gem for pushing custom metrics to Cloudwatch
103
+ summary: "[Deprecated] Ruby gem for pushing custom metrics to Cloudwatch"
104
104
  test_files: []