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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f84ff22349c762a429e58f5913884a3eff066c983881ed16d9f846785c27184f
4
- data.tar.gz: ccb8508e0eba3e08f2312248618d2fff80ff5bab70c08c5c9754b04ee000088e
3
+ metadata.gz: 3c2e5bbf4d4546e3ece6589508e00fc01eb30ca41b572ff2afbb4185b73c93d5
4
+ data.tar.gz: e3fe3b13cf8fc1e43732a75386502618427cab7a449fe95b8d2c69789383947b
5
5
  SHA512:
6
- metadata.gz: 588eb7e39ca26221be2c15a986d5862a6f102713a8be329e245ae086c0503daa0c2e1d54d5996a008c1a6a93855f5f16b33eea551902438926fb1e29dcd29720
7
- data.tar.gz: 43d3d079f656213b87f8666bca064dd83910282a4f7ffe3bb9dc1106f25ceea8c6b2e6dafbb8181c20c1377e515a6a37311cb495d4b9cab7c48016f2a79124ea
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
@@ -1,3 +1,3 @@
1
1
  module EventTracer
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '0.5.1'.freeze
3
3
  end
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.0
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-03-26 00:00:00.000000000 Z
11
+ date: 2022-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby