nexus_semantic_logger 1.4.1 → 1.5.0

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: 3760d456227ed07ed32f0bce0a1214bdd05b10e8e189cdb930e5f975b14a7c2a
4
- data.tar.gz: fb0546649521111dbaeaf9c48d5f170bdad097704030a1208a98589de8ce3238
3
+ metadata.gz: b1e939b1284c82361caf156ea59fd20cdb09227a978871b329e8b5daced1cb98
4
+ data.tar.gz: be51dfd6de0f9e61f9c08152a4c37593c54094f91c3f6fa70f9e1303d979649a
5
5
  SHA512:
6
- metadata.gz: 17d32091c3773edbaf31387b996cf900a47c9ab4ca56a32f6c2708780347160ae0f939d2883245c7a92baacf1d8f01965e6dc8d1627c2fe5800aa911a352f3e9
7
- data.tar.gz: e96b237fa979b031b0ea95629ece48683146a4d6a8d4693cff0c184298e467afcf6d9450adcb40079f4a727cb8eb1ca049be41d3c985c19e7646dfbc66e795c1
6
+ metadata.gz: f9cac5834a9b8c2f105e8bf86fcf607c68fdb2ce9a48f3825e45ea8fb4e55b9b9cba37a052c05e49c8f70a33123ac898fe7d16bf5e44ea97784423bd4bae05a6
7
+ data.tar.gz: 437239b92a721285cb366ac917114468bef1a98e28bae0c83a6f3bfc3ce59be76bee9314c1ac7c2760566c92c402073f83923945bcd7e21d41bb413e3c05e76a
data/.gitignore CHANGED
@@ -1 +1,3 @@
1
+ .idea/
2
+ .vscode/
1
3
  results/
@@ -7,7 +7,7 @@ module NexusSemanticLogger
7
7
  # own statsd instance.
8
8
  class DatadogSingleton
9
9
  include Singleton
10
- attr_accessor :statsd, :tags
10
+ attr_accessor :statsd, :global_tags
11
11
 
12
12
  def flush
13
13
  statsd&.flush(sync: Rails.env.development?) # Force flush sync in development, speed up checks.
@@ -15,16 +15,18 @@ module NexusSemanticLogger
15
15
 
16
16
  # Delegate to statsd (if available).
17
17
  # @param [String] metric Metric name.
18
- def increment(metric)
19
- statsd&.increment(metric, tags: tags)
18
+ # @param [Array<String>] tags Additional tags.
19
+ def increment(metric, tags: [])
20
+ statsd&.increment(metric, tags: global_tags + tags)
20
21
  flush
21
22
  end
22
23
 
23
24
  # Delegate to statsd (if available).
24
25
  # @param [String] metric Metric name.
25
26
  # @param [Integer] ms Timing in milliseconds.
26
- def timing(metric, ms)
27
- statsd&.timing(metric, ms, tags: tags)
27
+ # @param [Array<String>] tags Additional tags.
28
+ def timing(metric, ms, tags: [])
29
+ statsd&.timing(metric, ms, tags: global_tags + tags)
28
30
  flush
29
31
  end
30
32
  end
@@ -20,8 +20,8 @@ module NexusSemanticLogger
20
20
  # Configure tags to be sent on all traces and metrics.
21
21
  # Note that 'env' is NOT sent- that is set as the default on the agent e.g. staging, canary, production.
22
22
  # It does not necessarily align with the Rails env, and we do not want to double tag the env.
23
- datadog_singleton.tags = ["railsenv:#{Rails.env}", "service:#{service}"]
24
- c.tags = datadog_singleton.tags
23
+ datadog_singleton.global_tags = ["railsenv:#{Rails.env}", "service:#{service}"]
24
+ c.tags = datadog_singleton.global_tags
25
25
 
26
26
  # Tracer requires configuration to a datadog agent via DD_AGENT_HOST.
27
27
  dd_force_tracer_val = ENV.fetch('DD_FORCE_TRACER', false)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module NexusSemanticLogger
3
- # Leave this as 1.4.1 in order for CI process to replace with the tagged version.
4
- VERSION = '1.4.1'
3
+ # Leave this as 1.5.0 in order for CI process to replace with the tagged version.
4
+ VERSION = '1.5.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexus_semantic_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnathon Harris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-08 00:00:00.000000000 Z
11
+ date: 2022-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print