dogstatsd-ruby 4.3.0 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/datadog/statsd.rb +17 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0a17784b24e078a39ee2717d1b7b25d1879e067a5e356db6f98eb012d2bbef2
4
- data.tar.gz: 9559cb5d04e7b8dee34becbd0adb9182fb1cbda48ae5de13a470cd1d843d4d8d
3
+ metadata.gz: 25baf4b0dc57e8ed9a79bd2115224f22de9097200ccf4931b54fbb1e40905363
4
+ data.tar.gz: a51c91dc366316b6edbadc64eb5e7383b6b100c9a2a859eb9bc31b9bef9ec7e2
5
5
  SHA512:
6
- metadata.gz: 652f8010045d42ae2fe2056d6c97f645d54c430b491a1e878cdf85abd22fda2dfbeae74022fb71faa51f5ce636c1bb6dcef60e172ba15c4b74fcd3eded1d9b05
7
- data.tar.gz: 42f8763913be88f9871568ac966403f19437c4e477792a771b4b10d9645e2e73f6a588f89c4ba8bd218feb44842f1f6a491434eb0cdc64a2e0a47b30287da8f2
6
+ metadata.gz: 225ef009dcb475534ec746d9eaa6e8b156ad7b50291c2894ba9171806bc91231150510a65a47ec754dbf519f80fe7381c589d34f35e983519fb8e991347e1a12
7
+ data.tar.gz: e8609033506332625db4a6655adceacfb7fd1b85346020c1582dd032815ea56158d46442cecafd40fdd7bf098745e41ab1e70323b323ff63dd8bb43be3be8b88
@@ -192,7 +192,7 @@ module Datadog
192
192
  DISTRIBUTION_TYPE = 'd'.freeze
193
193
  TIMING_TYPE = 'ms'.freeze
194
194
  SET_TYPE = 's'.freeze
195
- VERSION = "4.3.0".freeze
195
+ VERSION = "4.4.0".freeze
196
196
 
197
197
  # A namespace to prepend to all statsd calls. Defaults to no namespace.
198
198
  attr_reader :namespace
@@ -407,8 +407,8 @@ module Datadog
407
407
  # @param [String] name Service check name
408
408
  # @param [String] status Service check status.
409
409
  # @param [Hash] opts the additional data about the service check
410
- # @option opts [Integer, nil] :timestamp (nil) Assign a timestamp to the event. Default is now when none
411
- # @option opts [String, nil] :hostname (nil) Assign a hostname to the event.
410
+ # @option opts [Integer, String, nil] :timestamp (nil) Assign a timestamp to the service check. Default is now when none
411
+ # @option opts [String, nil] :hostname (nil) Assign a hostname to the service check.
412
412
  # @option opts [Array<String>, nil] :tags (nil) An array of tags
413
413
  # @option opts [String, nil] :message (nil) A message to associate with this service check status
414
414
  # @example Report a critical service check status
@@ -426,7 +426,7 @@ module Datadog
426
426
  # @param [String] title Event title
427
427
  # @param [String] text Event text. Supports newlines (+\n+)
428
428
  # @param [Hash] opts the additional data about the event
429
- # @option opts [Integer, nil] :date_happened (nil) Assign a timestamp to the event. Default is now when none
429
+ # @option opts [Integer, String, nil] :date_happened (nil) Assign a timestamp to the event. Default is now when none
430
430
  # @option opts [String, nil] :hostname (nil) Assign a hostname to the event.
431
431
  # @option opts [String, nil] :aggregation_key (nil) Assign an aggregation key to the event, to group it with some others
432
432
  # @option opts [String, nil] :priority ('normal') Can be "normal" or "low"
@@ -486,7 +486,11 @@ module Datadog
486
486
  escaped_message = escape_service_check_message(message)
487
487
  sc_string << "|m:#{escaped_message}"
488
488
  else
489
- value = remove_pipes(opts[key])
489
+ if key == :timestamp && opts[key].is_a?(Integer)
490
+ value = opts[key]
491
+ else
492
+ value = remove_pipes(opts[key])
493
+ end
490
494
  sc_string << "|#{shorthand_key}#{value}"
491
495
  end
492
496
  end
@@ -502,7 +506,14 @@ module Datadog
502
506
  # All pipes ('|') in the metadata are removed. Title and Text can keep theirs
503
507
  OPTS_KEYS.each do |key, shorthand_key|
504
508
  if key != :tags && opts[key]
505
- value = remove_pipes(opts[key])
509
+ # :date_happened is the only key where the value is an Integer
510
+ # To not break backwards compatibility, we still accept a String
511
+ if key == :date_happened && opts[key].is_a?(Integer)
512
+ value = opts[key]
513
+ # All other keys only have String values
514
+ else
515
+ value = remove_pipes(opts[key])
516
+ end
506
517
  event_string_data << "|#{shorthand_key}:#{value}"
507
518
  end
508
519
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogstatsd-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rein Henrichs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-24 00:00:00.000000000 Z
11
+ date: 2019-07-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby DogStastd client
14
14
  email: code@datadoghq.com