ddtrace 1.18.0 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +82 -1
- data/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +96 -66
- data/ext/ddtrace_profiling_native_extension/collectors_discrete_dynamic_sampler.c +349 -0
- data/ext/ddtrace_profiling_native_extension/collectors_discrete_dynamic_sampler.h +89 -0
- data/ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.c +22 -14
- data/ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h +4 -0
- data/ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.c +156 -0
- data/ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.h +5 -0
- data/ext/ddtrace_profiling_native_extension/collectors_stack.c +43 -102
- data/ext/ddtrace_profiling_native_extension/collectors_stack.h +10 -3
- data/ext/ddtrace_profiling_native_extension/collectors_thread_context.c +159 -124
- data/ext/ddtrace_profiling_native_extension/collectors_thread_context.h +2 -1
- data/ext/ddtrace_profiling_native_extension/extconf.rb +19 -0
- data/ext/ddtrace_profiling_native_extension/heap_recorder.c +970 -0
- data/ext/ddtrace_profiling_native_extension/heap_recorder.h +155 -0
- data/ext/ddtrace_profiling_native_extension/helpers.h +6 -0
- data/ext/ddtrace_profiling_native_extension/libdatadog_helpers.c +20 -0
- data/ext/ddtrace_profiling_native_extension/libdatadog_helpers.h +11 -0
- data/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +5 -0
- data/ext/ddtrace_profiling_native_extension/profiling.c +17 -0
- data/ext/ddtrace_profiling_native_extension/ruby_helpers.c +147 -0
- data/ext/ddtrace_profiling_native_extension/ruby_helpers.h +28 -0
- data/ext/ddtrace_profiling_native_extension/stack_recorder.c +329 -10
- data/ext/ddtrace_profiling_native_extension/stack_recorder.h +3 -0
- data/ext/ddtrace_profiling_native_extension/time_helpers.h +2 -0
- data/lib/datadog/appsec/contrib/rack/request_middleware.rb +2 -1
- data/lib/datadog/core/configuration/settings.rb +153 -21
- data/lib/datadog/core/environment/class_count.rb +6 -6
- data/lib/datadog/core/remote/component.rb +25 -12
- data/lib/datadog/core/remote/ext.rb +1 -0
- data/lib/datadog/core/remote/tie/tracing.rb +39 -0
- data/lib/datadog/core/remote/tie.rb +27 -0
- data/lib/datadog/core/telemetry/collector.rb +10 -0
- data/lib/datadog/core/telemetry/event.rb +2 -1
- data/lib/datadog/core/telemetry/ext.rb +3 -0
- data/lib/datadog/core/telemetry/v1/app_event.rb +8 -1
- data/lib/datadog/core/telemetry/v1/install_signature.rb +38 -0
- data/lib/datadog/opentelemetry/sdk/propagator.rb +3 -2
- data/lib/datadog/opentelemetry.rb +3 -0
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +5 -12
- data/lib/datadog/profiling/component.rb +183 -13
- data/lib/datadog/profiling/scheduler.rb +4 -6
- data/lib/datadog/profiling/stack_recorder.rb +13 -2
- data/lib/datadog/tracing/configuration/ext.rb +0 -1
- data/lib/datadog/tracing/configuration/settings.rb +2 -1
- data/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/action_cable/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/action_mailer/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/action_pack/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/action_view/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/action_view/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/active_job/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/active_job/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/active_model_serializers/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/active_record/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/active_record/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/active_support/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/active_support/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/analytics.rb +0 -1
- data/lib/datadog/tracing/contrib/aws/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/aws/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/dalli/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/dalli/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/delayed_job/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/elasticsearch/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/ethon/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/ethon/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/excon/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/excon/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/faraday/configuration/settings.rb +7 -0
- data/lib/datadog/tracing/contrib/faraday/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/faraday/middleware.rb +1 -1
- data/lib/datadog/tracing/contrib/grape/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/grape/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/graphql/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/graphql/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/grpc/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/grpc/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/http/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/http/distributed/fetcher.rb +2 -2
- data/lib/datadog/tracing/contrib/http/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/httpclient/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/httprb/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/kafka/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/kafka/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/mongodb/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +5 -0
- data/lib/datadog/tracing/contrib/mysql2/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +2 -1
- data/lib/datadog/tracing/contrib/opensearch/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/opensearch/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/pg/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/pg/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/presto/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/presto/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/qless/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/qless/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/que/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/que/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/racecar/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/racecar/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/rack/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/rack/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/rack/middlewares.rb +9 -2
- data/lib/datadog/tracing/contrib/rails/auto_instrument_railtie.rb +0 -2
- data/lib/datadog/tracing/contrib/rails/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/rails/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/rake/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/rake/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/redis/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/redis/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/redis/instrumentation.rb +2 -2
- data/lib/datadog/tracing/contrib/redis/patcher.rb +34 -21
- data/lib/datadog/tracing/contrib/resque/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/resque/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/rest_client/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/roda/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/roda/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/sequel/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/sequel/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/shoryuken/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/sidekiq/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/sinatra/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/sinatra/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/sneakers/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/sneakers/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/stripe/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/stripe/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb +1 -0
- data/lib/datadog/tracing/contrib/sucker_punch/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/trilogy/configuration/settings.rb +58 -0
- data/lib/datadog/tracing/contrib/trilogy/ext.rb +27 -0
- data/lib/datadog/tracing/contrib/trilogy/instrumentation.rb +94 -0
- data/lib/datadog/tracing/contrib/trilogy/integration.rb +43 -0
- data/lib/datadog/tracing/contrib/trilogy/patcher.rb +31 -0
- data/lib/datadog/tracing/contrib.rb +1 -0
- data/lib/datadog/tracing.rb +8 -2
- data/lib/ddtrace/version.rb +1 -1
- metadata +20 -6
@@ -9,6 +9,7 @@ module Datadog
|
|
9
9
|
module Ext
|
10
10
|
CLIENT_SERVICE_NAME = 'sidekiq-client'
|
11
11
|
ENV_ENABLED = 'DD_TRACE_SIDEKIQ_ENABLED'
|
12
|
+
# @!visibility private
|
12
13
|
ENV_ANALYTICS_ENABLED = 'DD_TRACE_SIDEKIQ_ANALYTICS_ENABLED'
|
13
14
|
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_SIDEKIQ_ANALYTICS_SAMPLE_RATE'
|
14
15
|
ENV_TAG_JOB_ARGS = 'DD_SIDEKIQ_TAG_JOB_ARGS'
|
@@ -8,6 +8,7 @@ module Datadog
|
|
8
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
9
9
|
module Ext
|
10
10
|
ENV_ENABLED = 'DD_TRACE_SINATRA_ENABLED'
|
11
|
+
# @!visibility private
|
11
12
|
ENV_ANALYTICS_ENABLED = 'DD_TRACE_SINATRA_ANALYTICS_ENABLED'
|
12
13
|
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_SINATRA_ANALYTICS_SAMPLE_RATE'
|
13
14
|
RACK_ENV_SINATRA_REQUEST_SPAN = 'datadog.sinatra_request_span'
|
@@ -8,6 +8,7 @@ module Datadog
|
|
8
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
9
9
|
module Ext
|
10
10
|
ENV_ENABLED = 'DD_TRACE_SNEAKERS_ENABLED'
|
11
|
+
# @!visibility private
|
11
12
|
ENV_ANALYTICS_ENABLED = 'DD_TRACE_SNEAKERS_ANALYTICS_ENABLED'
|
12
13
|
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_SNEAKERS_ANALYTICS_SAMPLE_RATE'
|
13
14
|
SERVICE_NAME = 'sneakers'
|
@@ -8,6 +8,7 @@ module Datadog
|
|
8
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
9
9
|
module Ext
|
10
10
|
ENV_ENABLED = 'DD_TRACE_STRIPE_ENABLED'
|
11
|
+
# @!visibility private
|
11
12
|
ENV_ANALYTICS_ENABLED = 'DD_TRACE_STRIPE_ANALYTICS_ENABLED'
|
12
13
|
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_STRIPE_ANALYTICS_SAMPLE_RATE'
|
13
14
|
SPAN_REQUEST = 'stripe.request'
|
@@ -8,6 +8,7 @@ module Datadog
|
|
8
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
9
9
|
module Ext
|
10
10
|
ENV_ENABLED = 'DD_TRACE_SUCKER_PUNCH_ENABLED'
|
11
|
+
# @!visibility private
|
11
12
|
ENV_ANALYTICS_ENABLED = 'DD_TRACE_SUCKER_PUNCH_ANALYTICS_ENABLED'
|
12
13
|
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_SUCKER_PUNCH_ANALYTICS_SAMPLE_RATE'
|
13
14
|
SERVICE_NAME = 'sucker_punch'
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../configuration/settings'
|
4
|
+
require_relative '../ext'
|
5
|
+
|
6
|
+
require_relative '../../propagation/sql_comment'
|
7
|
+
|
8
|
+
module Datadog
|
9
|
+
module Tracing
|
10
|
+
module Contrib
|
11
|
+
module Trilogy
|
12
|
+
module Configuration
|
13
|
+
# Custom settings for the Trilogy integration
|
14
|
+
# @public_api
|
15
|
+
class Settings < Contrib::Configuration::Settings
|
16
|
+
option :enabled do |o|
|
17
|
+
o.type :bool
|
18
|
+
o.env Ext::ENV_ENABLED
|
19
|
+
o.default true
|
20
|
+
end
|
21
|
+
|
22
|
+
option :analytics_enabled do |o|
|
23
|
+
o.type :bool
|
24
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
25
|
+
o.default false
|
26
|
+
end
|
27
|
+
|
28
|
+
option :analytics_sample_rate do |o|
|
29
|
+
o.type :float
|
30
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
31
|
+
o.default 1.0
|
32
|
+
end
|
33
|
+
|
34
|
+
option :service_name do |o|
|
35
|
+
o.default do
|
36
|
+
Contrib::SpanAttributeSchema.fetch_service_name(
|
37
|
+
Ext::ENV_SERVICE_NAME,
|
38
|
+
Ext::DEFAULT_PEER_SERVICE_NAME
|
39
|
+
)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
option :comment_propagation do |o|
|
44
|
+
o.type :string
|
45
|
+
o.env Contrib::Propagation::SqlComment::Ext::ENV_DBM_PROPAGATION_MODE
|
46
|
+
o.default Contrib::Propagation::SqlComment::Ext::DISABLED
|
47
|
+
end
|
48
|
+
|
49
|
+
option :peer_service do |o|
|
50
|
+
o.type :string, nilable: true
|
51
|
+
o.env Ext::ENV_PEER_SERVICE
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
module Tracing
|
5
|
+
module Contrib
|
6
|
+
module Trilogy
|
7
|
+
# Trilogy integration constants
|
8
|
+
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
9
|
+
module Ext
|
10
|
+
ENV_ENABLED = 'DD_TRACE_TRILOGY_ENABLED'
|
11
|
+
ENV_SERVICE_NAME = 'DD_TRACE_TRILOGY_SERVICE_NAME'
|
12
|
+
ENV_PEER_SERVICE = 'DD_TRACE_TRILOGY_PEER_SERVICE'
|
13
|
+
|
14
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_TRILOGY_ANALYTICS_ENABLED'
|
15
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_TRILOGY_ANALYTICS_SAMPLE_RATE'
|
16
|
+
DEFAULT_PEER_SERVICE_NAME = 'trilogy'
|
17
|
+
SPAN_QUERY = 'trilogy.query'
|
18
|
+
TAG_DB_NAME = 'trilogy.db.name'
|
19
|
+
TAG_COMPONENT = 'trilogy'
|
20
|
+
TAG_OPERATION_QUERY = 'query'
|
21
|
+
TAG_SYSTEM = 'mysql'
|
22
|
+
PEER_SERVICE_SOURCES = (Array[Ext::TAG_DB_NAME] + Contrib::Ext::DB::PEER_SERVICE_SOURCES).freeze
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../metadata/ext'
|
4
|
+
require_relative '../analytics'
|
5
|
+
require_relative 'ext'
|
6
|
+
require_relative '../ext'
|
7
|
+
require_relative '../propagation/sql_comment'
|
8
|
+
require_relative '../propagation/sql_comment/mode'
|
9
|
+
|
10
|
+
module Datadog
|
11
|
+
module Tracing
|
12
|
+
module Contrib
|
13
|
+
module Trilogy
|
14
|
+
# Trilogy patch module
|
15
|
+
module Instrumentation
|
16
|
+
def self.included(base)
|
17
|
+
base.prepend(InstanceMethods)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Trilogy patch instance methods
|
21
|
+
module InstanceMethods
|
22
|
+
def query(sql)
|
23
|
+
service = Datadog.configuration_for(self, :service_name) || datadog_configuration[:service_name]
|
24
|
+
|
25
|
+
Tracing.trace(Ext::SPAN_QUERY, service: service) do |span, trace_op|
|
26
|
+
span.resource = sql
|
27
|
+
span.span_type = Tracing::Metadata::Ext::SQL::TYPE
|
28
|
+
|
29
|
+
if datadog_configuration[:peer_service]
|
30
|
+
span.set_tag(
|
31
|
+
Tracing::Metadata::Ext::TAG_PEER_SERVICE,
|
32
|
+
datadog_configuration[:peer_service]
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Tag original global service name if not used
|
37
|
+
if span.service != Datadog.configuration.service
|
38
|
+
span.set_tag(Tracing::Contrib::Ext::Metadata::TAG_BASE_SERVICE, Datadog.configuration.service)
|
39
|
+
end
|
40
|
+
|
41
|
+
span.set_tag(Contrib::Ext::DB::TAG_SYSTEM, Ext::TAG_SYSTEM)
|
42
|
+
span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_CLIENT)
|
43
|
+
|
44
|
+
span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
|
45
|
+
span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_QUERY)
|
46
|
+
|
47
|
+
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, connection_options[:host])
|
48
|
+
|
49
|
+
# Set analytics sample rate
|
50
|
+
Contrib::Analytics.set_sample_rate(span, analytics_sample_rate) if analytics_enabled?
|
51
|
+
|
52
|
+
span.set_tag(Ext::TAG_DB_NAME, connection_options[:database])
|
53
|
+
span.set_tag(Tracing::Metadata::Ext::NET::TAG_TARGET_HOST, connection_options[:host])
|
54
|
+
span.set_tag(Tracing::Metadata::Ext::NET::TAG_TARGET_PORT, connection_options[:port])
|
55
|
+
|
56
|
+
Contrib::SpanAttributeSchema.set_peer_service!(span, Ext::PEER_SERVICE_SOURCES)
|
57
|
+
|
58
|
+
propagation_mode = Contrib::Propagation::SqlComment::Mode.new(comment_propagation)
|
59
|
+
|
60
|
+
Contrib::Propagation::SqlComment.annotate!(span, propagation_mode)
|
61
|
+
sql = Contrib::Propagation::SqlComment.prepend_comment(
|
62
|
+
sql,
|
63
|
+
span,
|
64
|
+
trace_op,
|
65
|
+
propagation_mode
|
66
|
+
)
|
67
|
+
|
68
|
+
super(sql)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
def datadog_configuration
|
75
|
+
Datadog.configuration.tracing[:trilogy]
|
76
|
+
end
|
77
|
+
|
78
|
+
def analytics_enabled?
|
79
|
+
datadog_configuration[:analytics_enabled]
|
80
|
+
end
|
81
|
+
|
82
|
+
def analytics_sample_rate
|
83
|
+
datadog_configuration[:analytics_sample_rate]
|
84
|
+
end
|
85
|
+
|
86
|
+
def comment_propagation
|
87
|
+
datadog_configuration[:comment_propagation]
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../integration'
|
4
|
+
require_relative 'configuration/settings'
|
5
|
+
require_relative 'patcher'
|
6
|
+
|
7
|
+
module Datadog
|
8
|
+
module Tracing
|
9
|
+
module Contrib
|
10
|
+
module Trilogy
|
11
|
+
# Description of Trilogy integration
|
12
|
+
class Integration
|
13
|
+
include Contrib::Integration
|
14
|
+
|
15
|
+
MINIMUM_VERSION = Gem::Version.new('2.0.0')
|
16
|
+
|
17
|
+
# @public_api Changing the integration name or integration options can cause breaking changes
|
18
|
+
register_as :trilogy
|
19
|
+
|
20
|
+
def self.version
|
21
|
+
Gem.loaded_specs['trilogy'] && Gem.loaded_specs['trilogy'].version
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.loaded?
|
25
|
+
!defined?(::Trilogy).nil?
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.compatible?
|
29
|
+
super && version >= MINIMUM_VERSION
|
30
|
+
end
|
31
|
+
|
32
|
+
def new_configuration
|
33
|
+
Configuration::Settings.new
|
34
|
+
end
|
35
|
+
|
36
|
+
def patcher
|
37
|
+
Patcher
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../patcher'
|
4
|
+
require_relative 'instrumentation'
|
5
|
+
|
6
|
+
module Datadog
|
7
|
+
module Tracing
|
8
|
+
module Contrib
|
9
|
+
module Trilogy
|
10
|
+
# Patcher enables patching of 'trilogy' module.
|
11
|
+
module Patcher
|
12
|
+
include Contrib::Patcher
|
13
|
+
|
14
|
+
module_function
|
15
|
+
|
16
|
+
def target_version
|
17
|
+
Integration.version
|
18
|
+
end
|
19
|
+
|
20
|
+
def patch
|
21
|
+
patch_trilogy_client
|
22
|
+
end
|
23
|
+
|
24
|
+
def patch_trilogy_client
|
25
|
+
::Trilogy.include(Instrumentation)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/datadog/tracing.rb
CHANGED
@@ -73,8 +73,14 @@ module Datadog
|
|
73
73
|
# (see Datadog::Tracing::Tracer#active_correlation)
|
74
74
|
# @public_api
|
75
75
|
def correlation
|
76
|
-
|
77
|
-
|
76
|
+
# We access this in this way as:
|
77
|
+
# * If the components have not been initialized, it doesn't make sense to initialize ddtrace just to say
|
78
|
+
# 'nil' here
|
79
|
+
# * It prevents recursive initialization attempts, see https://github.com/DataDog/dd-trace-rb/issues/3385
|
80
|
+
components = Datadog.send(:components, allow_initialization: false)
|
81
|
+
current_tracer = components.tracer if components
|
82
|
+
|
83
|
+
return Datadog::Tracing::Correlation::Identifier.new unless current_tracer
|
78
84
|
|
79
85
|
current_tracer.active_correlation
|
80
86
|
end
|
data/lib/ddtrace/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddtrace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: 3.3.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.
|
40
|
+
version: 3.3.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: libddwaf
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.7.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.7.0
|
83
83
|
description: |
|
84
84
|
ddtrace is Datadog's tracing client for Ruby. It is used to trace requests
|
85
85
|
as they flow across web servers, databases and microservices so that developers
|
@@ -108,8 +108,12 @@ files:
|
|
108
108
|
- ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c
|
109
109
|
- ext/ddtrace_profiling_native_extension/clock_id_noop.c
|
110
110
|
- ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c
|
111
|
+
- ext/ddtrace_profiling_native_extension/collectors_discrete_dynamic_sampler.c
|
112
|
+
- ext/ddtrace_profiling_native_extension/collectors_discrete_dynamic_sampler.h
|
111
113
|
- ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.c
|
112
114
|
- ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
|
115
|
+
- ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.c
|
116
|
+
- ext/ddtrace_profiling_native_extension/collectors_gc_profiling_helper.h
|
113
117
|
- ext/ddtrace_profiling_native_extension/collectors_idle_sampling_helper.c
|
114
118
|
- ext/ddtrace_profiling_native_extension/collectors_idle_sampling_helper.h
|
115
119
|
- ext/ddtrace_profiling_native_extension/collectors_stack.c
|
@@ -117,6 +121,8 @@ files:
|
|
117
121
|
- ext/ddtrace_profiling_native_extension/collectors_thread_context.c
|
118
122
|
- ext/ddtrace_profiling_native_extension/collectors_thread_context.h
|
119
123
|
- ext/ddtrace_profiling_native_extension/extconf.rb
|
124
|
+
- ext/ddtrace_profiling_native_extension/heap_recorder.c
|
125
|
+
- ext/ddtrace_profiling_native_extension/heap_recorder.h
|
120
126
|
- ext/ddtrace_profiling_native_extension/helpers.h
|
121
127
|
- ext/ddtrace_profiling_native_extension/http_transport.c
|
122
128
|
- ext/ddtrace_profiling_native_extension/libdatadog_helpers.c
|
@@ -272,6 +278,8 @@ files:
|
|
272
278
|
- lib/datadog/core/remote/dispatcher.rb
|
273
279
|
- lib/datadog/core/remote/ext.rb
|
274
280
|
- lib/datadog/core/remote/negotiation.rb
|
281
|
+
- lib/datadog/core/remote/tie.rb
|
282
|
+
- lib/datadog/core/remote/tie/tracing.rb
|
275
283
|
- lib/datadog/core/remote/transport/config.rb
|
276
284
|
- lib/datadog/core/remote/transport/http.rb
|
277
285
|
- lib/datadog/core/remote/transport/http/api.rb
|
@@ -301,6 +309,7 @@ files:
|
|
301
309
|
- lib/datadog/core/telemetry/v1/configuration.rb
|
302
310
|
- lib/datadog/core/telemetry/v1/dependency.rb
|
303
311
|
- lib/datadog/core/telemetry/v1/host.rb
|
312
|
+
- lib/datadog/core/telemetry/v1/install_signature.rb
|
304
313
|
- lib/datadog/core/telemetry/v1/integration.rb
|
305
314
|
- lib/datadog/core/telemetry/v1/product.rb
|
306
315
|
- lib/datadog/core/telemetry/v1/telemetry_request.rb
|
@@ -787,6 +796,11 @@ files:
|
|
787
796
|
- lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb
|
788
797
|
- lib/datadog/tracing/contrib/sucker_punch/integration.rb
|
789
798
|
- lib/datadog/tracing/contrib/sucker_punch/patcher.rb
|
799
|
+
- lib/datadog/tracing/contrib/trilogy/configuration/settings.rb
|
800
|
+
- lib/datadog/tracing/contrib/trilogy/ext.rb
|
801
|
+
- lib/datadog/tracing/contrib/trilogy/instrumentation.rb
|
802
|
+
- lib/datadog/tracing/contrib/trilogy/integration.rb
|
803
|
+
- lib/datadog/tracing/contrib/trilogy/patcher.rb
|
790
804
|
- lib/datadog/tracing/contrib/utils/database.rb
|
791
805
|
- lib/datadog/tracing/contrib/utils/quantization/hash.rb
|
792
806
|
- lib/datadog/tracing/contrib/utils/quantization/http.rb
|