event_tracer 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/event_tracer/datadog_logger.rb +6 -3
- data/lib/event_tracer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c2e5bbf4d4546e3ece6589508e00fc01eb30ca41b572ff2afbb4185b73c93d5
|
4
|
+
data.tar.gz: e3fe3b13cf8fc1e43732a75386502618427cab7a449fe95b8d2c69789383947b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17cd02fe83f7725b8e2a9d495979f5b183e2a63fc071b1b58795adfb910ed0c9048f1692b608d78d0348377b4c9216c1601481234ff60791206b2c1797e7d51f
|
7
|
+
data.tar.gz: ba23fdd140689fa467671a1f28024f38ea6b5c9e1ddd911c4980cbb91d57faf7a5ad2ce028aaffcead4f75d06ac4d5e30b0728525a3dac074ac366b8318f2797
|
@@ -18,15 +18,16 @@ module EventTracer
|
|
18
18
|
gauge: :gauge,
|
19
19
|
set: :set,
|
20
20
|
histogram: :histogram
|
21
|
-
}
|
21
|
+
}.freeze
|
22
22
|
DEFAULT_METRIC_TYPE = :count
|
23
23
|
DEFAULT_COUNTER = 1
|
24
24
|
|
25
25
|
attr_reader :allowed_tags
|
26
26
|
|
27
|
-
def initialize(decoratee, allowed_tags: [])
|
27
|
+
def initialize(decoratee, allowed_tags: [], default_tags: {})
|
28
28
|
super(decoratee)
|
29
29
|
@allowed_tags = allowed_tags.freeze
|
30
|
+
@default_tags = default_tags.freeze
|
30
31
|
end
|
31
32
|
|
32
33
|
LOG_TYPES.each do |log_type|
|
@@ -59,12 +60,14 @@ module EventTracer
|
|
59
60
|
|
60
61
|
alias_method :datadog, :decoratee
|
61
62
|
|
63
|
+
attr_reader :default_tags
|
64
|
+
|
62
65
|
def valid_args?(metrics)
|
63
66
|
metrics && (metrics.is_a?(Hash) || metrics.is_a?(Array))
|
64
67
|
end
|
65
68
|
|
66
69
|
def build_tags(args)
|
67
|
-
args.slice(*allowed_tags).map do |tag, value|
|
70
|
+
@default_tags.merge(args.slice(*allowed_tags)).map do |tag, value|
|
68
71
|
"#{tag}:#{value}"
|
69
72
|
end
|
70
73
|
end
|
data/lib/event_tracer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_tracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- melvrickgoh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|