Skip to content
Snippets Groups Projects
Commit e27be54b authored by Theo Cushion's avatar Theo Cushion
Browse files

Merge branch 'tc/fix_updated_datadog' into 'main'

fix: change references from ddtrace to datadog

See merge request !12
parents d65a99e0 48cf96e1
No related branches found
Tags 1.13.1
1 merge request!12fix: change references from ddtrace to datadog
Pipeline #90355 passed
......@@ -4,7 +4,6 @@ require 'nexus_semantic_logger/application'
require 'nexus_semantic_logger/datadog_formatter'
require 'nexus_semantic_logger/datadog_singleton'
require 'nexus_semantic_logger/datadog_tracer'
require 'nexus_semantic_logger/ddtrace_ruby3_patch'
require 'nexus_semantic_logger/logger_metrics_subscriber'
module NexusSemanticLogger
......
......@@ -27,7 +27,7 @@ module NexusSemanticLogger
hash.delete(:application)
hash.delete(:environment)
hash.delete('')
# ddtrace correlation inserted via log_tags, but datadog expects them in the root hash.
# datadog correlation inserted via log_tags, but datadog expects them in the root hash.
named_tags = hash.delete(:named_tags)
if named_tags.is_a?(Hash)
hash.deep_merge!(named_tags)
......
# frozen_string_literal: true
require 'datadog/statsd'
require 'ddtrace'
require 'datadog'
module NexusSemanticLogger
class DatadogTracer
......@@ -54,13 +54,13 @@ module NexusSemanticLogger
dd_tracer_enabled = Rails.env.production? || dd_force_tracer
c.tracing.enabled = dd_tracer_enabled
# Profiling is also provided by ddtrace, we synchronise their feature toggles.
# Profiling is also provided by datadog, we synchronise their feature toggles.
c.profiling.enabled = dd_tracer_enabled
end
c.tracing.instrument(:rails, service_name: service)
c.logger.level = Logger::WARN # ddtrace info logging is too verbose.
c.logger.level = Logger::WARN # datadog info logging is too verbose.
end
end
end
......
# frozen_string_literal: true
require 'ddtrace'
# Temporary monkey patch for ddtrace 1.9 in ruby 3.2.
# Supposedly fixed in upstream 1.10, once that is released.
# See https://github.com/DataDog/dd-trace-rb/issues/2534
Datadog::Core::Environment::VMCache.class_eval do
module_function
# Ruby >= 3.2 uses :constant_cache_invalidations instead of :global_constant_state
# This is a temporary workaround, the correct solution is to report both :constant_cache_invalidations and
# :constant_cache_misses in DD
# See https://github.com/ruby/ruby/pull/5433,
# https://github.com/DataDog/dd-trace-rb/blob/v1.5.0/lib/datadog/core/environment/vm_cache.rb#L23-L25
def global_constant_state
RubyVM.stat[:constant_cache_invalidations]
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment