nexus_semantic_logger 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1e939b1284c82361caf156ea59fd20cdb09227a978871b329e8b5daced1cb98
|
4
|
+
data.tar.gz: be51dfd6de0f9e61f9c08152a4c37593c54094f91c3f6fa70f9e1303d979649a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9cac5834a9b8c2f105e8bf86fcf607c68fdb2ce9a48f3825e45ea8fb4e55b9b9cba37a052c05e49c8f70a33123ac898fe7d16bf5e44ea97784423bd4bae05a6
|
7
|
+
data.tar.gz: 437239b92a721285cb366ac917114468bef1a98e28bae0c83a6f3bfc3ce59be76bee9314c1ac7c2760566c92c402073f83923945bcd7e21d41bb413e3c05e76a
|
data/.gitignore
CHANGED
@@ -7,7 +7,7 @@ module NexusSemanticLogger
|
|
7
7
|
# own statsd instance.
|
8
8
|
class DatadogSingleton
|
9
9
|
include Singleton
|
10
|
-
attr_accessor :statsd, :
|
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
|
-
|
19
|
-
|
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
|
-
|
27
|
-
|
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.
|
24
|
-
c.tags = datadog_singleton.
|
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
|
-
VERSION = '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
|
+
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-
|
11
|
+
date: 2022-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|