dogstatsd-ruby 5.6.1 → 5.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/datadog/statsd/message_buffer.rb +2 -1
- data/lib/datadog/statsd/serialization/stat_serializer.rb +16 -15
- data/lib/datadog/statsd/serialization/tag_serializer.rb +3 -1
- data/lib/datadog/statsd/version.rb +1 -1
- data/lib/datadog/statsd.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb5fc01f7ac477b0d99986331aba69b1556b2160246ff379a60f394be8fb0968
|
4
|
+
data.tar.gz: fc254d901ec1071acbef8fa724e30f54b0fd4c65592a726e68805ea484c54811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 719c9f76ce1cc501fddff67f3e563eec94d612c40b8b29aa93bed1c270bc4d6d785eed088d5f4df513034f4eff38b1c1e67f2538c86372b07f353f29f6f0a18c
|
7
|
+
data.tar.gz: 7b2812a927a160ec0452e3366ed0eed9166ec95ecf88dc8ab325726d18e60d683d8bfb75845608f1e025a6af80871acd8a6e4d16a08c4d21c749731b1d327643
|
data/README.md
CHANGED
@@ -226,7 +226,7 @@ As much as possible, we will add a "future deprecation" message in the minor rel
|
|
226
226
|
|
227
227
|
## Ruby Versions
|
228
228
|
|
229
|
-
This gem supports and is tested on Ruby minor versions 2.1 through 3.
|
229
|
+
This gem supports and is tested on Ruby minor versions 2.1 through 3.3.
|
230
230
|
Support for Ruby 2.0 was dropped in version 5.4.0.
|
231
231
|
|
232
232
|
## Credits
|
@@ -28,7 +28,8 @@ module Datadog
|
|
28
28
|
# Serializes the message if it hasn't been already. Part of the
|
29
29
|
# delay_serialization feature.
|
30
30
|
if message.is_a?(Array)
|
31
|
-
|
31
|
+
stat, delta, type, tags, sample_rate = message
|
32
|
+
message = @serializer.to_stat(stat, delta, type, tags: tags, sample_rate: sample_rate)
|
32
33
|
end
|
33
34
|
|
34
35
|
message_size = message.bytesize
|
@@ -10,20 +10,20 @@ module Datadog
|
|
10
10
|
@tag_serializer = TagSerializer.new(global_tags)
|
11
11
|
end
|
12
12
|
|
13
|
-
def format(
|
14
|
-
|
13
|
+
def format(metric_name, delta, type, tags: [], sample_rate: 1)
|
14
|
+
metric_name = formatted_metric_name(metric_name)
|
15
15
|
|
16
16
|
if sample_rate != 1
|
17
17
|
if tags_list = tag_serializer.format(tags)
|
18
|
-
"#{@prefix_str}#{
|
18
|
+
"#{@prefix_str}#{metric_name}:#{delta}|#{type}|@#{sample_rate}|##{tags_list}"
|
19
19
|
else
|
20
|
-
"#{@prefix_str}#{
|
20
|
+
"#{@prefix_str}#{metric_name}:#{delta}|#{type}|@#{sample_rate}"
|
21
21
|
end
|
22
22
|
else
|
23
23
|
if tags_list = tag_serializer.format(tags)
|
24
|
-
"#{@prefix_str}#{
|
24
|
+
"#{@prefix_str}#{metric_name}:#{delta}|#{type}|##{tags_list}"
|
25
25
|
else
|
26
|
-
"#{@prefix_str}#{
|
26
|
+
"#{@prefix_str}#{metric_name}:#{delta}|#{type}"
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -37,17 +37,18 @@ module Datadog
|
|
37
37
|
attr_reader :prefix
|
38
38
|
attr_reader :tag_serializer
|
39
39
|
|
40
|
-
def
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
def formatted_metric_name(metric_name)
|
41
|
+
formatted = Symbol === metric_name ? metric_name.name : metric_name.to_s
|
42
|
+
|
43
|
+
if formatted.include?('::')
|
44
|
+
formatted = formatted.gsub('::', '.')
|
45
|
+
formatted.tr!(':|@', '_')
|
46
|
+
formatted
|
47
|
+
elsif formatted.include?(':') || formatted.include?('@') || formatted.include?('|')
|
48
|
+
formatted.tr(':|@', '_')
|
44
49
|
else
|
45
|
-
|
46
|
-
formated.gsub!('::', '.')
|
50
|
+
formatted
|
47
51
|
end
|
48
|
-
|
49
|
-
formated.tr!(':|@', '_')
|
50
|
-
formated
|
51
52
|
end
|
52
53
|
end
|
53
54
|
end
|
data/lib/datadog/statsd.rb
CHANGED
@@ -431,7 +431,7 @@ module Datadog
|
|
431
431
|
if sample_rate == 1 || opts[:pre_sampled] || rand <= sample_rate
|
432
432
|
full_stat =
|
433
433
|
if @delay_serialization
|
434
|
-
[
|
434
|
+
[stat, delta, type, opts[:tags], sample_rate]
|
435
435
|
else
|
436
436
|
serializer.to_stat(stat, delta, type, tags: opts[:tags], sample_rate: sample_rate)
|
437
437
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dogstatsd-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.6.
|
4
|
+
version: 5.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rein Henrichs
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-09-20 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Ruby DogStatsd client
|
15
15
|
email: code@datadoghq.com
|
@@ -44,9 +44,9 @@ licenses:
|
|
44
44
|
- MIT
|
45
45
|
metadata:
|
46
46
|
bug_tracker_uri: https://github.com/DataDog/dogstatsd-ruby/issues
|
47
|
-
changelog_uri: https://github.com/DataDog/dogstatsd-ruby/blob/v5.6.
|
48
|
-
documentation_uri: https://www.rubydoc.info/gems/dogstatsd-ruby/5.6.
|
49
|
-
source_code_uri: https://github.com/DataDog/dogstatsd-ruby/tree/v5.6.
|
47
|
+
changelog_uri: https://github.com/DataDog/dogstatsd-ruby/blob/v5.6.2/CHANGELOG.md
|
48
|
+
documentation_uri: https://www.rubydoc.info/gems/dogstatsd-ruby/5.6.2
|
49
|
+
source_code_uri: https://github.com/DataDog/dogstatsd-ruby/tree/v5.6.2
|
50
50
|
post_install_message: |2+
|
51
51
|
|
52
52
|
If you are upgrading from v4.x of the dogstatsd-ruby library, note the major change to the threading model:
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
|
-
rubygems_version: 3.
|
69
|
+
rubygems_version: 3.1.6
|
70
70
|
signing_key:
|
71
71
|
specification_version: 4
|
72
72
|
summary: A Ruby DogStatsd client
|