nexus_semantic_logger 1.11.3 → 1.11.5

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: 14e22f42ddbae2ef45d866403fbd954b4e5713219aaca897472b8e0686fd43f5
4
- data.tar.gz: 94207afe26665630e15ed2aeed7e30ac6efaa42fe85038a0390314b88995982f
3
+ metadata.gz: 2c2b93034acfcfaf40fbffbf01287f4268644eec2752a5fabe52f2ce81139d7a
4
+ data.tar.gz: 613712ccae326eead3599f6f251dbe9d82a6e3fc2beb5c318aab60e9308e625e
5
5
  SHA512:
6
- metadata.gz: 89130fd037ac1b30bbfe2c87932820c3cc2b3df3ef1d06cc46e744d405298c481f29b19d201d087abe7441db1b065b4739875c6974d01adce48d58b53e40eaac
7
- data.tar.gz: 88be14d4564733680af9cbbe292579d6d88a36850bbb3005a135c74ab37d62cb5d76f166340e219d0e5d601fab714eba1fbc9d711f0299dedda04116c9e67074
6
+ metadata.gz: '0586dc978666d97bc52c09699a2fc9401c133c1531f4180893d9ac05eaf630ba951c03782b3818c626b429e1a15eac67ded751619a4453d4c55a758e7dd55750'
7
+ data.tar.gz: ecb05454ed928ad108052bda75f609586ffb398731e65ff28cdae77bca8c1a6b0e22368e1611c398062df8345aa61bbf7fe2623b2beef5eccd6cbccbf9a2c2b2
@@ -15,7 +15,7 @@ module NexusSemanticLogger
15
15
  config.log_tags = {
16
16
  request_id: :request_id,
17
17
  dd: -> (_) {
18
- correlation = Datadog.tracer.active_correlation
18
+ correlation = Datadog::Tracing.correlation
19
19
  {
20
20
  trace_id: correlation.trace_id.to_s,
21
21
  span_id: correlation.span_id.to_s,
@@ -22,11 +22,15 @@ module NexusSemanticLogger
22
22
  end
23
23
  c.runtime_metrics.statsd = datadog_singleton.statsd
24
24
 
25
- # Configure tags to be sent on all traces and metrics.
25
+ # Configure tags to be sent on all metrics.
26
26
  # Note that 'env' is NOT sent- that is set as the default on the agent e.g. staging, canary, production.
27
27
  # It does not necessarily align with the Rails env, and we do not want to double tag the env.
28
28
  datadog_singleton.global_tags = ["railsenv:#{Rails.env}", "service:#{service}"]
29
- c.tags = datadog_singleton.global_tags
29
+ # Trace tags API is Hash<String,String>, see https://www.rubydoc.info/gems/ddtrace/Datadog/Tracing
30
+ c.tags = {
31
+ railsenv: Rails.env,
32
+ service: service,
33
+ }
30
34
 
31
35
  # Tracer requires configuration to a datadog agent via DD_AGENT_HOST.
32
36
  dd_force_tracer_val = ENV.fetch('DD_FORCE_TRACER', false)
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+ require 'ddtrace'
3
+
4
+ # Temporary monkey patch for ddtrace 1.9 in ruby 3.2.
5
+ # Supposedly fixed in upstream 1.10, once that is released.
6
+ # See https://github.com/DataDog/dd-trace-rb/issues/2534
7
+ puts "hello world"
8
+ Datadog::Core::Environment::VMCache.class_eval do
9
+ module_function
10
+
11
+ # Ruby >= 3.2 uses :constant_cache_invalidations instead of :global_constant_state
12
+ # This is a temporary workaround, the correct solution is to report both :constant_cache_invalidations and
13
+ # :constant_cache_misses in DD
14
+ # See https://github.com/ruby/ruby/pull/5433,
15
+ # https://github.com/DataDog/dd-trace-rb/blob/v1.5.0/lib/datadog/core/environment/vm_cache.rb#L23-L25
16
+ def global_constant_state
17
+ RubyVM.stat[:constant_cache_invalidations]
18
+ end
19
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module NexusSemanticLogger
3
- # Leave this as 1.11.3 in order for CI process to replace with the tagged version.
4
- VERSION = '1.11.3'
3
+ # Leave this as 1.11.5 in order for CI process to replace with the tagged version.
4
+ VERSION = '1.11.5'
5
5
  end
@@ -4,6 +4,7 @@ require 'nexus_semantic_logger/application'
4
4
  require 'nexus_semantic_logger/datadog_formatter'
5
5
  require 'nexus_semantic_logger/datadog_singleton'
6
6
  require 'nexus_semantic_logger/datadog_tracer'
7
+ require 'nexus_semantic_logger/ddtrace_ruby3_patch'
7
8
  require 'nexus_semantic_logger/logger_metrics_subscriber'
8
9
 
9
10
  module NexusSemanticLogger
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.11.3
4
+ version: 1.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnathon Harris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-23 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print
@@ -111,6 +111,7 @@ files:
111
111
  - lib/nexus_semantic_logger/datadog_formatter.rb
112
112
  - lib/nexus_semantic_logger/datadog_singleton.rb
113
113
  - lib/nexus_semantic_logger/datadog_tracer.rb
114
+ - lib/nexus_semantic_logger/ddtrace_ruby3_patch.rb
114
115
  - lib/nexus_semantic_logger/extensions/action_dispatch/debug_exceptions.rb
115
116
  - lib/nexus_semantic_logger/logger_metrics_subscriber.rb
116
117
  - lib/nexus_semantic_logger/sneakers_metrics.rb