ddtrace 1.12.1 → 1.13.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 +109 -9
- data/ext/ddtrace_profiling_native_extension/collectors_thread_context.c +97 -14
- data/ext/ddtrace_profiling_native_extension/extconf.rb +6 -0
- data/ext/ddtrace_profiling_native_extension/http_transport.c +19 -6
- data/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +1 -1
- data/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +41 -2
- data/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +6 -0
- data/ext/ddtrace_profiling_native_extension/stack_recorder.c +6 -10
- data/ext/ddtrace_profiling_native_extension/time_helpers.c +40 -4
- data/ext/ddtrace_profiling_native_extension/time_helpers.h +14 -0
- data/lib/datadog/appsec/component.rb +9 -0
- data/lib/datadog/appsec/configuration/settings.rb +104 -195
- data/lib/datadog/appsec/configuration.rb +0 -79
- data/lib/datadog/appsec/contrib/auto_instrument.rb +2 -4
- data/lib/datadog/appsec/contrib/devise/event.rb +57 -0
- data/lib/datadog/appsec/contrib/devise/ext.rb +13 -0
- data/lib/datadog/appsec/contrib/devise/integration.rb +42 -0
- data/lib/datadog/appsec/contrib/devise/patcher/authenticatable_patch.rb +76 -0
- data/lib/datadog/appsec/contrib/devise/patcher/registration_controller_patch.rb +52 -0
- data/lib/datadog/appsec/contrib/devise/patcher.rb +45 -0
- data/lib/datadog/appsec/contrib/devise/resource.rb +35 -0
- data/lib/datadog/appsec/contrib/devise/tracking.rb +49 -0
- data/lib/datadog/appsec/contrib/rack/ext.rb +2 -1
- data/lib/datadog/appsec/contrib/rack/reactive/request.rb +1 -1
- data/lib/datadog/appsec/contrib/rack/reactive/request_body.rb +1 -1
- data/lib/datadog/appsec/contrib/rack/reactive/response.rb +1 -1
- data/lib/datadog/appsec/contrib/rack/request_middleware.rb +12 -7
- data/lib/datadog/appsec/contrib/rails/ext.rb +3 -2
- data/lib/datadog/appsec/contrib/rails/framework.rb +1 -3
- data/lib/datadog/appsec/contrib/rails/patcher.rb +8 -8
- data/lib/datadog/appsec/contrib/rails/reactive/action.rb +1 -1
- data/lib/datadog/appsec/contrib/sinatra/ext.rb +2 -1
- data/lib/datadog/appsec/contrib/sinatra/framework.rb +1 -3
- data/lib/datadog/appsec/contrib/sinatra/reactive/routed.rb +1 -1
- data/lib/datadog/appsec/event.rb +1 -1
- data/lib/datadog/appsec/extensions.rb +1 -130
- data/lib/datadog/appsec/monitor/reactive/set_user.rb +1 -1
- data/lib/datadog/appsec/processor.rb +1 -1
- data/lib/datadog/appsec/rate_limiter.rb +1 -1
- data/lib/datadog/appsec/remote.rb +1 -1
- data/lib/datadog/appsec.rb +1 -2
- data/lib/datadog/ci/configuration/settings.rb +6 -8
- data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +7 -5
- data/lib/datadog/ci/contrib/cucumber/ext.rb +10 -8
- data/lib/datadog/ci/contrib/minitest/configuration/settings.rb +35 -0
- data/lib/datadog/ci/contrib/minitest/ext.rb +21 -0
- data/lib/datadog/ci/contrib/minitest/integration.rb +49 -0
- data/lib/datadog/ci/contrib/minitest/patcher.rb +27 -0
- data/lib/datadog/ci/contrib/minitest/test_helper.rb +68 -0
- data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +7 -5
- data/lib/datadog/ci/contrib/rspec/ext.rb +9 -7
- data/lib/datadog/ci.rb +1 -0
- data/lib/datadog/core/backport.rb +51 -0
- data/lib/datadog/core/configuration/base.rb +5 -5
- data/lib/datadog/core/configuration/components.rb +6 -1
- data/lib/datadog/core/configuration/ext.rb +7 -5
- data/lib/datadog/core/configuration/option.rb +269 -19
- data/lib/datadog/core/configuration/option_definition.rb +76 -11
- data/lib/datadog/core/configuration/options.rb +22 -10
- data/lib/datadog/core/configuration/settings.rb +116 -61
- data/lib/datadog/core/environment/ext.rb +13 -11
- data/lib/datadog/core/environment/yjit.rb +58 -0
- data/lib/datadog/core/git/ext.rb +24 -22
- data/lib/datadog/core/logging/ext.rb +3 -1
- data/lib/datadog/core/metrics/ext.rb +7 -5
- data/lib/datadog/core/remote/client/capabilities.rb +5 -0
- data/lib/datadog/core/remote/client.rb +3 -0
- data/lib/datadog/core/remote/component.rb +25 -34
- data/lib/datadog/core/remote/configuration/content.rb +28 -1
- data/lib/datadog/core/remote/configuration/repository.rb +3 -1
- data/lib/datadog/core/remote/ext.rb +1 -1
- data/lib/datadog/core/remote/negotiation.rb +17 -4
- data/lib/datadog/core/runtime/ext.rb +22 -12
- data/lib/datadog/core/runtime/metrics.rb +43 -0
- data/lib/datadog/core/telemetry/client.rb +12 -2
- data/lib/datadog/core/telemetry/emitter.rb +4 -2
- data/lib/datadog/core/telemetry/event.rb +19 -4
- data/lib/datadog/core/telemetry/ext.rb +4 -1
- data/lib/datadog/core/telemetry/heartbeat.rb +2 -4
- data/lib/datadog/core/telemetry/http/ext.rb +10 -8
- data/lib/datadog/core/telemetry/http/transport.rb +1 -0
- data/lib/datadog/core/telemetry/v2/app_client_configuration_change.rb +41 -0
- data/lib/datadog/core/telemetry/v2/request.rb +29 -0
- data/lib/datadog/core/transport/http/client.rb +1 -1
- data/lib/datadog/core/transport/http/config.rb +10 -0
- data/lib/datadog/core/utils/duration.rb +52 -0
- data/lib/datadog/core/utils/hash.rb +47 -0
- data/lib/datadog/core/utils/network.rb +1 -1
- data/lib/datadog/core/utils/safe_dup.rb +27 -20
- data/lib/datadog/core/utils.rb +1 -1
- data/lib/datadog/core/workers/async.rb +2 -2
- data/lib/datadog/kit/appsec/events.rb +139 -89
- data/lib/datadog/kit/identity.rb +80 -65
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +3 -0
- data/lib/datadog/profiling/collectors/idle_sampling_helper.rb +1 -0
- data/lib/datadog/profiling/collectors/thread_context.rb +9 -2
- data/lib/datadog/profiling/component.rb +41 -9
- data/lib/datadog/profiling/exporter.rb +5 -1
- data/lib/datadog/profiling/flush.rb +9 -2
- data/lib/datadog/profiling/http_transport.rb +4 -1
- data/lib/datadog/profiling/load_native_extension.rb +7 -1
- data/lib/datadog/profiling.rb +11 -1
- data/lib/datadog/tracing/component.rb +58 -6
- data/lib/datadog/tracing/configuration/dynamic/option.rb +71 -0
- data/lib/datadog/tracing/configuration/dynamic.rb +64 -0
- data/lib/datadog/tracing/configuration/ext.rb +35 -32
- data/lib/datadog/tracing/configuration/http.rb +74 -0
- data/lib/datadog/tracing/configuration/settings.rb +106 -92
- data/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb +9 -6
- data/lib/datadog/tracing/contrib/action_cable/ext.rb +20 -18
- data/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb +9 -6
- data/lib/datadog/tracing/contrib/action_mailer/ext.rb +20 -18
- data/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb +8 -6
- data/lib/datadog/tracing/contrib/action_pack/ext.rb +10 -8
- data/lib/datadog/tracing/contrib/action_view/configuration/settings.rb +9 -6
- data/lib/datadog/tracing/contrib/action_view/ext.rb +12 -10
- data/lib/datadog/tracing/contrib/active_job/configuration/settings.rb +13 -7
- data/lib/datadog/tracing/contrib/active_job/ext.rb +25 -23
- data/lib/datadog/tracing/contrib/active_job/log_injection.rb +1 -1
- data/lib/datadog/tracing/contrib/active_job/patcher.rb +1 -1
- data/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb +9 -6
- data/lib/datadog/tracing/contrib/active_model_serializers/ext.rb +12 -10
- data/lib/datadog/tracing/contrib/active_record/configuration/settings.rb +9 -7
- data/lib/datadog/tracing/contrib/active_record/events/sql.rb +0 -8
- data/lib/datadog/tracing/contrib/active_record/ext.rb +17 -15
- data/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +0 -5
- data/lib/datadog/tracing/contrib/active_support/configuration/settings.rb +9 -7
- data/lib/datadog/tracing/contrib/active_support/ext.rb +18 -16
- data/lib/datadog/tracing/contrib/aws/configuration/settings.rb +14 -7
- data/lib/datadog/tracing/contrib/aws/ext.rb +37 -24
- data/lib/datadog/tracing/contrib/aws/instrumentation.rb +9 -5
- data/lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb +3 -2
- data/lib/datadog/tracing/contrib/concurrent_ruby/ext.rb +4 -2
- data/lib/datadog/tracing/contrib/dalli/configuration/settings.rb +14 -7
- data/lib/datadog/tracing/contrib/dalli/ext.rb +19 -11
- data/lib/datadog/tracing/contrib/dalli/instrumentation.rb +8 -6
- data/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb +13 -7
- data/lib/datadog/tracing/contrib/delayed_job/ext.rb +16 -14
- data/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb +14 -7
- data/lib/datadog/tracing/contrib/elasticsearch/ext.rb +21 -15
- data/lib/datadog/tracing/contrib/elasticsearch/patcher.rb +8 -5
- data/lib/datadog/tracing/contrib/ethon/configuration/settings.rb +16 -9
- data/lib/datadog/tracing/contrib/ethon/easy_patch.rb +43 -3
- data/lib/datadog/tracing/contrib/ethon/ext.rb +19 -11
- data/lib/datadog/tracing/contrib/ethon/multi_patch.rb +0 -5
- data/lib/datadog/tracing/contrib/excon/configuration/settings.rb +19 -10
- data/lib/datadog/tracing/contrib/excon/ext.rb +16 -8
- data/lib/datadog/tracing/contrib/excon/middleware.rb +20 -5
- data/lib/datadog/tracing/contrib/ext.rb +23 -1
- data/lib/datadog/tracing/contrib/extensions.rb +32 -0
- data/lib/datadog/tracing/contrib/faraday/configuration/settings.rb +20 -10
- data/lib/datadog/tracing/contrib/faraday/ext.rb +16 -8
- data/lib/datadog/tracing/contrib/faraday/middleware.rb +16 -5
- data/lib/datadog/tracing/contrib/grape/configuration/settings.rb +8 -6
- data/lib/datadog/tracing/contrib/grape/ext.rb +16 -14
- data/lib/datadog/tracing/contrib/graphql/configuration/settings.rb +8 -6
- data/lib/datadog/tracing/contrib/graphql/ext.rb +7 -5
- data/lib/datadog/tracing/contrib/grpc/configuration/settings.rb +19 -9
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb +29 -20
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb +21 -20
- data/lib/datadog/tracing/contrib/grpc/ext.rb +16 -13
- data/lib/datadog/tracing/contrib/grpc/formatting.rb +127 -0
- data/lib/datadog/tracing/contrib/hanami/configuration/settings.rb +3 -2
- data/lib/datadog/tracing/contrib/hanami/ext.rb +10 -8
- data/lib/datadog/tracing/contrib/http/circuit_breaker.rb +4 -7
- data/lib/datadog/tracing/contrib/http/configuration/settings.rb +33 -11
- data/lib/datadog/tracing/contrib/http/ext.rb +16 -9
- data/lib/datadog/tracing/contrib/http/instrumentation.rb +17 -5
- data/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +33 -11
- data/lib/datadog/tracing/contrib/httpclient/ext.rb +17 -9
- data/lib/datadog/tracing/contrib/httpclient/instrumentation.rb +17 -5
- data/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +33 -11
- data/lib/datadog/tracing/contrib/httprb/ext.rb +16 -9
- data/lib/datadog/tracing/contrib/httprb/instrumentation.rb +17 -5
- data/lib/datadog/tracing/contrib/kafka/configuration/settings.rb +9 -6
- data/lib/datadog/tracing/contrib/kafka/ext.rb +42 -39
- data/lib/datadog/tracing/contrib/lograge/configuration/settings.rb +3 -2
- data/lib/datadog/tracing/contrib/lograge/ext.rb +3 -1
- data/lib/datadog/tracing/contrib/lograge/instrumentation.rb +1 -0
- data/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb +14 -7
- data/lib/datadog/tracing/contrib/mongodb/ext.rb +20 -16
- data/lib/datadog/tracing/contrib/mongodb/subscribers.rb +9 -5
- data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +17 -14
- data/lib/datadog/tracing/contrib/mysql2/ext.rb +15 -10
- data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +9 -5
- data/lib/datadog/tracing/contrib/opensearch/configuration/settings.rb +52 -0
- data/lib/datadog/tracing/contrib/opensearch/ext.rb +37 -0
- data/lib/datadog/tracing/contrib/opensearch/integration.rb +44 -0
- data/lib/datadog/tracing/contrib/opensearch/patcher.rb +128 -0
- data/lib/datadog/tracing/contrib/opensearch/quantize.rb +81 -0
- data/lib/datadog/tracing/contrib/pg/configuration/settings.rb +17 -14
- data/lib/datadog/tracing/contrib/pg/ext.rb +22 -19
- data/lib/datadog/tracing/contrib/pg/instrumentation.rb +9 -5
- data/lib/datadog/tracing/contrib/presto/configuration/settings.rb +14 -7
- data/lib/datadog/tracing/contrib/presto/ext.rb +25 -20
- data/lib/datadog/tracing/contrib/presto/instrumentation.rb +9 -5
- data/lib/datadog/tracing/contrib/propagation/sql_comment/ext.rb +12 -10
- data/lib/datadog/tracing/contrib/qless/configuration/settings.rb +12 -8
- data/lib/datadog/tracing/contrib/qless/ext.rb +14 -12
- data/lib/datadog/tracing/contrib/que/configuration/settings.rb +21 -12
- data/lib/datadog/tracing/contrib/racecar/configuration/settings.rb +9 -7
- data/lib/datadog/tracing/contrib/racecar/event.rb +0 -5
- data/lib/datadog/tracing/contrib/racecar/ext.rb +20 -18
- data/lib/datadog/tracing/contrib/rack/configuration/settings.rb +16 -12
- data/lib/datadog/tracing/contrib/rack/ext.rb +18 -16
- data/lib/datadog/tracing/contrib/rack/header_collection.rb +3 -0
- data/lib/datadog/tracing/contrib/rack/header_tagging.rb +53 -0
- data/lib/datadog/tracing/contrib/rack/middlewares.rb +8 -49
- data/lib/datadog/tracing/contrib/rails/configuration/settings.rb +15 -11
- data/lib/datadog/tracing/contrib/rails/ext.rb +7 -5
- data/lib/datadog/tracing/contrib/rails/log_injection.rb +4 -10
- data/lib/datadog/tracing/contrib/rails/patcher.rb +10 -41
- data/lib/datadog/tracing/contrib/rails/railtie.rb +3 -3
- data/lib/datadog/tracing/contrib/rake/configuration/settings.rb +12 -9
- data/lib/datadog/tracing/contrib/rake/ext.rb +14 -12
- data/lib/datadog/tracing/contrib/redis/configuration/settings.rb +17 -9
- data/lib/datadog/tracing/contrib/redis/ext.rb +22 -15
- data/lib/datadog/tracing/contrib/redis/tags.rb +9 -5
- data/lib/datadog/tracing/contrib/resque/configuration/settings.rb +13 -7
- data/lib/datadog/tracing/contrib/resque/ext.rb +9 -7
- data/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +16 -9
- data/lib/datadog/tracing/contrib/rest_client/ext.rb +15 -8
- data/lib/datadog/tracing/contrib/rest_client/request_patch.rb +20 -5
- data/lib/datadog/tracing/contrib/roda/configuration/settings.rb +9 -6
- data/lib/datadog/tracing/contrib/semantic_logger/configuration/settings.rb +3 -2
- data/lib/datadog/tracing/contrib/semantic_logger/ext.rb +3 -1
- data/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb +1 -0
- data/lib/datadog/tracing/contrib/sequel/configuration/settings.rb +9 -6
- data/lib/datadog/tracing/contrib/sequel/ext.rb +10 -8
- data/lib/datadog/tracing/contrib/sequel/utils.rb +2 -7
- data/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb +14 -8
- data/lib/datadog/tracing/contrib/shoryuken/ext.rb +14 -12
- data/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb +18 -11
- data/lib/datadog/tracing/contrib/sidekiq/ext.rb +32 -30
- data/lib/datadog/tracing/contrib/sinatra/configuration/settings.rb +11 -9
- data/lib/datadog/tracing/contrib/sinatra/env.rb +0 -17
- data/lib/datadog/tracing/contrib/sinatra/ext.rb +21 -19
- data/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +3 -14
- data/lib/datadog/tracing/contrib/sneakers/configuration/settings.rb +14 -8
- data/lib/datadog/tracing/contrib/sneakers/ext.rb +1 -0
- data/lib/datadog/tracing/contrib/sneakers/tracer.rb +1 -1
- data/lib/datadog/tracing/contrib/span_attribute_schema.rb +74 -10
- data/lib/datadog/tracing/contrib/stripe/configuration/settings.rb +9 -6
- data/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb +9 -6
- data/lib/datadog/tracing/contrib/sucker_punch/ext.rb +15 -13
- data/lib/datadog/tracing/contrib/utils/database.rb +5 -3
- data/lib/datadog/tracing/correlation.rb +9 -12
- data/lib/datadog/tracing/diagnostics/ext.rb +21 -19
- data/lib/datadog/tracing/distributed/b3_multi.rb +2 -2
- data/lib/datadog/tracing/distributed/b3_single.rb +1 -1
- data/lib/datadog/tracing/distributed/trace_context.rb +52 -17
- data/lib/datadog/tracing/metadata/ext.rb +9 -6
- data/lib/datadog/tracing/remote.rb +78 -0
- data/lib/datadog/tracing/sampling/rule_sampler.rb +29 -0
- data/lib/datadog/tracing/span_operation.rb +3 -15
- data/lib/datadog/tracing/trace_operation.rb +16 -3
- data/lib/datadog/tracing/trace_segment.rb +5 -2
- data/lib/datadog/tracing/tracer.rb +10 -1
- data/lib/ddtrace/transport/ext.rb +15 -9
- data/lib/ddtrace/transport/trace_formatter.rb +9 -0
- data/lib/ddtrace/version.rb +9 -12
- metadata +38 -10
- data/lib/datadog/tracing/contrib/sinatra/headers.rb +0 -35
@@ -79,8 +79,8 @@ module Datadog
|
|
79
79
|
# @default `DD_API_KEY` environment variable, otherwise `nil`
|
80
80
|
# @return [String,nil]
|
81
81
|
option :api_key do |o|
|
82
|
-
o.
|
83
|
-
o.
|
82
|
+
o.type :string, nilable: true
|
83
|
+
o.env Core::Environment::Ext::ENV_API_KEY
|
84
84
|
end
|
85
85
|
|
86
86
|
# Datadog diagnostic settings.
|
@@ -99,8 +99,9 @@ module Datadog
|
|
99
99
|
# @default `DD_TRACE_DEBUG` environment variable, otherwise `false`
|
100
100
|
# @return [Boolean]
|
101
101
|
option :debug do |o|
|
102
|
-
o.
|
103
|
-
o.
|
102
|
+
o.env Datadog::Core::Configuration::Ext::Diagnostics::ENV_DEBUG_ENABLED
|
103
|
+
o.default false
|
104
|
+
o.type :bool
|
104
105
|
o.on_set do |enabled|
|
105
106
|
# Enable rich debug print statements.
|
106
107
|
# We do not need to unnecessarily load 'pp' unless in debugging mode.
|
@@ -117,8 +118,9 @@ module Datadog
|
|
117
118
|
# @default `DD_HEALTH_METRICS_ENABLED` environment variable, otherwise `false`
|
118
119
|
# @return [Boolean]
|
119
120
|
option :enabled do |o|
|
120
|
-
o.
|
121
|
-
o.
|
121
|
+
o.env Datadog::Core::Configuration::Ext::Diagnostics::ENV_HEALTH_METRICS_ENABLED
|
122
|
+
o.default false
|
123
|
+
o.type :bool
|
122
124
|
end
|
123
125
|
|
124
126
|
# {Datadog::Statsd} instance to collect health metrics.
|
@@ -140,11 +142,11 @@ module Datadog
|
|
140
142
|
# is *not* running in a development environment.
|
141
143
|
#
|
142
144
|
# @default `DD_TRACE_STARTUP_LOGS` environment variable, otherwise `nil`
|
143
|
-
# @return [Boolean,nil]
|
145
|
+
# @return [Boolean, nil]
|
144
146
|
option :enabled do |o|
|
147
|
+
o.env Datadog::Core::Configuration::Ext::Diagnostics::ENV_STARTUP_LOGS_ENABLED
|
145
148
|
# Defaults to nil as we want to know when the default value is being used
|
146
|
-
o.
|
147
|
-
o.lazy
|
149
|
+
o.type :bool, nilable: true
|
148
150
|
end
|
149
151
|
end
|
150
152
|
end
|
@@ -158,8 +160,7 @@ module Datadog
|
|
158
160
|
o.setter { |v| v.to_s if v }
|
159
161
|
|
160
162
|
# NOTE: env also gets set as a side effect of tags. See the WORKAROUND note in #initialize for details.
|
161
|
-
o.
|
162
|
-
o.lazy
|
163
|
+
o.env Core::Environment::Ext::ENV_ENVIRONMENT
|
163
164
|
end
|
164
165
|
|
165
166
|
# Internal `Datadog.logger` configuration.
|
@@ -194,8 +195,9 @@ module Datadog
|
|
194
195
|
# @default `DD_PROFILING_ENABLED` environment variable, otherwise `false`
|
195
196
|
# @return [Boolean]
|
196
197
|
option :enabled do |o|
|
197
|
-
o.
|
198
|
-
o.
|
198
|
+
o.env Profiling::Ext::ENV_ENABLED
|
199
|
+
o.default false
|
200
|
+
o.type :bool
|
199
201
|
end
|
200
202
|
|
201
203
|
# @public_api
|
@@ -228,8 +230,9 @@ module Datadog
|
|
228
230
|
#
|
229
231
|
# @default `DD_PROFILING_MAX_FRAMES` environment variable, otherwise 400
|
230
232
|
option :max_frames do |o|
|
231
|
-
o.
|
232
|
-
o.
|
233
|
+
o.type :int
|
234
|
+
o.env Profiling::Ext::ENV_MAX_FRAMES
|
235
|
+
o.default 400
|
233
236
|
end
|
234
237
|
|
235
238
|
# @public_api
|
@@ -241,8 +244,9 @@ module Datadog
|
|
241
244
|
# @default `DD_PROFILING_ENDPOINT_COLLECTION_ENABLED` environment variable, otherwise `true`
|
242
245
|
# @return [Boolean]
|
243
246
|
option :enabled do |o|
|
244
|
-
o.
|
245
|
-
o.
|
247
|
+
o.env Profiling::Ext::ENV_ENDPOINT_COLLECTION_ENABLED
|
248
|
+
o.default true
|
249
|
+
o.type :bool
|
246
250
|
end
|
247
251
|
end
|
248
252
|
end
|
@@ -284,8 +288,9 @@ module Datadog
|
|
284
288
|
#
|
285
289
|
# @default `DD_PROFILING_FORCE_ENABLE_LEGACY` environment variable, otherwise `false`
|
286
290
|
option :force_enable_legacy_profiler do |o|
|
287
|
-
o.
|
288
|
-
o.
|
291
|
+
o.env 'DD_PROFILING_FORCE_ENABLE_LEGACY'
|
292
|
+
o.default false
|
293
|
+
o.type :bool
|
289
294
|
o.on_set do |value|
|
290
295
|
if value
|
291
296
|
Datadog.logger.warn(
|
@@ -317,8 +322,9 @@ module Datadog
|
|
317
322
|
#
|
318
323
|
# @default `DD_PROFILING_FORCE_ENABLE_GC` environment variable, otherwise `false`
|
319
324
|
option :force_enable_gc_profiling do |o|
|
320
|
-
o.
|
321
|
-
o.
|
325
|
+
o.env 'DD_PROFILING_FORCE_ENABLE_GC'
|
326
|
+
o.type :bool
|
327
|
+
o.default false
|
322
328
|
end
|
323
329
|
|
324
330
|
# Can be used to enable/disable the Datadog::Profiling.allocation_count feature.
|
@@ -339,8 +345,18 @@ module Datadog
|
|
339
345
|
#
|
340
346
|
# @default `DD_PROFILING_SKIP_MYSQL2_CHECK` environment variable, otherwise `false`
|
341
347
|
option :skip_mysql2_check do |o|
|
342
|
-
o.
|
343
|
-
o.
|
348
|
+
o.type :bool
|
349
|
+
o.env 'DD_PROFILING_SKIP_MYSQL2_CHECK'
|
350
|
+
o.default false
|
351
|
+
end
|
352
|
+
|
353
|
+
# Enables data collection for the timeline feature. This is still experimental and not recommended yet.
|
354
|
+
#
|
355
|
+
# @default `DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED` environment variable as a boolean, otherwise `false`
|
356
|
+
option :experimental_timeline_enabled do |o|
|
357
|
+
o.type :bool
|
358
|
+
o.env 'DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED'
|
359
|
+
o.default false
|
344
360
|
end
|
345
361
|
|
346
362
|
# The profiler gathers data by sending `SIGPROF` unix signals to Ruby application threads.
|
@@ -363,8 +379,14 @@ module Datadog
|
|
363
379
|
#
|
364
380
|
# @default `DD_PROFILING_NO_SIGNALS_WORKAROUND_ENABLED` environment variable as a boolean, otherwise `:auto`
|
365
381
|
option :no_signals_workaround_enabled do |o|
|
366
|
-
o.
|
367
|
-
o.
|
382
|
+
o.env 'DD_PROFILING_NO_SIGNALS_WORKAROUND_ENABLED'
|
383
|
+
o.default :auto
|
384
|
+
o.env_parser do |value|
|
385
|
+
if value
|
386
|
+
value = value.strip.downcase
|
387
|
+
['true', '1'].include?(value)
|
388
|
+
end
|
389
|
+
end
|
368
390
|
end
|
369
391
|
end
|
370
392
|
|
@@ -374,9 +396,9 @@ module Datadog
|
|
374
396
|
#
|
375
397
|
# @default `DD_PROFILING_UPLOAD_TIMEOUT` environment variable, otherwise `30.0`
|
376
398
|
option :timeout_seconds do |o|
|
377
|
-
o.
|
378
|
-
o.
|
379
|
-
o.
|
399
|
+
o.type :float
|
400
|
+
o.env Profiling::Ext::ENV_UPLOAD_TIMEOUT
|
401
|
+
o.default 30.0
|
380
402
|
end
|
381
403
|
end
|
382
404
|
end
|
@@ -389,11 +411,12 @@ module Datadog
|
|
389
411
|
# @default `DD_RUNTIME_METRICS_ENABLED` environment variable, otherwise `false`
|
390
412
|
# @return [Boolean]
|
391
413
|
option :enabled do |o|
|
392
|
-
o.
|
393
|
-
o.
|
414
|
+
o.env Core::Runtime::Ext::Metrics::ENV_ENABLED
|
415
|
+
o.default false
|
416
|
+
o.type :bool
|
394
417
|
end
|
395
418
|
|
396
|
-
option :opts, default:
|
419
|
+
option :opts, default: {}, type: :hash
|
397
420
|
option :statsd
|
398
421
|
end
|
399
422
|
|
@@ -406,8 +429,8 @@ module Datadog
|
|
406
429
|
o.setter { |v| v.to_s if v }
|
407
430
|
|
408
431
|
# NOTE: service also gets set as a side effect of tags. See the WORKAROUND note in #initialize for details.
|
409
|
-
o.
|
410
|
-
o.
|
432
|
+
o.env Core::Environment::Ext::ENV_SERVICE
|
433
|
+
o.default Core::Environment::Ext::FALLBACK_SERVICE_NAME
|
411
434
|
|
412
435
|
# There's a few cases where we don't want to use the fallback service name, so this helper allows us to get a
|
413
436
|
# nil instead so that one can do
|
@@ -429,8 +452,8 @@ module Datadog
|
|
429
452
|
# @default `DD_SITE` environment variable, otherwise `nil` which sends data to `app.datadoghq.com`
|
430
453
|
# @return [String,nil]
|
431
454
|
option :site do |o|
|
432
|
-
o.
|
433
|
-
o.
|
455
|
+
o.type :string, nilable: true
|
456
|
+
o.env Core::Environment::Ext::ENV_SITE
|
434
457
|
end
|
435
458
|
|
436
459
|
# Default tags
|
@@ -440,44 +463,57 @@ module Datadog
|
|
440
463
|
# @default `DD_TAGS` environment variable (in the format `'tag1:value1,tag2:value2'`), otherwise `{}`
|
441
464
|
# @return [Hash<String,String>]
|
442
465
|
option :tags do |o|
|
443
|
-
o.
|
444
|
-
|
466
|
+
o.type :hash, nilable: true
|
467
|
+
o.env Core::Environment::Ext::ENV_TAGS
|
468
|
+
o.env_parser do |env_value|
|
469
|
+
values = if env_value.include?(',')
|
470
|
+
env_value.split(',')
|
471
|
+
else
|
472
|
+
env_value.split(' ') # rubocop:disable Style/RedundantArgument
|
473
|
+
end
|
474
|
+
|
475
|
+
values.map! do |v|
|
476
|
+
v.gsub!(/\A[\s,]*|[\s,]*\Z/, '')
|
477
|
+
|
478
|
+
v.empty? ? nil : v
|
479
|
+
end
|
445
480
|
|
446
|
-
|
447
|
-
|
481
|
+
values.compact!
|
482
|
+
values.each_with_object({}) do |tag, tags|
|
448
483
|
key, value = tag.split(':', 2)
|
449
484
|
tags[key] = value if value && !value.empty?
|
450
485
|
end
|
486
|
+
end
|
487
|
+
o.setter do |new_value, old_value|
|
488
|
+
raw_tags = new_value || {}
|
451
489
|
|
452
|
-
|
453
|
-
|
454
|
-
|
490
|
+
env_value = env
|
491
|
+
version_value = version
|
492
|
+
service_name = service_without_fallback
|
455
493
|
|
456
|
-
tags
|
457
|
-
|
494
|
+
# Override tags if defined
|
495
|
+
raw_tags[Core::Environment::Ext::TAG_ENV] = env_value unless env_value.nil?
|
496
|
+
raw_tags[Core::Environment::Ext::TAG_VERSION] = version_value unless version_value.nil?
|
458
497
|
|
459
|
-
o.setter do |new_value, old_value|
|
460
498
|
# Coerce keys to strings
|
461
|
-
string_tags =
|
499
|
+
string_tags = raw_tags.collect { |k, v| [k.to_s, v] }.to_h
|
462
500
|
|
463
501
|
# Cross-populate tag values with other settings
|
464
|
-
if
|
502
|
+
if env_value.nil? && string_tags.key?(Core::Environment::Ext::TAG_ENV)
|
465
503
|
self.env = string_tags[Core::Environment::Ext::TAG_ENV]
|
466
504
|
end
|
467
505
|
|
468
|
-
if
|
506
|
+
if version_value.nil? && string_tags.key?(Core::Environment::Ext::TAG_VERSION)
|
469
507
|
self.version = string_tags[Core::Environment::Ext::TAG_VERSION]
|
470
508
|
end
|
471
509
|
|
472
|
-
if
|
510
|
+
if service_name.nil? && string_tags.key?(Core::Environment::Ext::TAG_SERVICE)
|
473
511
|
self.service = string_tags[Core::Environment::Ext::TAG_SERVICE]
|
474
512
|
end
|
475
513
|
|
476
514
|
# Merge with previous tags
|
477
515
|
(old_value || {}).merge(string_tags)
|
478
516
|
end
|
479
|
-
|
480
|
-
o.lazy
|
481
517
|
end
|
482
518
|
|
483
519
|
# The time provider used by Datadog. It must respect the interface of [Time](https://ruby-doc.org/core-3.0.1/Time.html).
|
@@ -490,7 +526,8 @@ module Datadog
|
|
490
526
|
# @default `->{ Time.now }`
|
491
527
|
# @return [Proc<Time>]
|
492
528
|
option :time_now_provider do |o|
|
493
|
-
o.
|
529
|
+
o.experimental_default_proc { ::Time.now }
|
530
|
+
o.type :proc
|
494
531
|
|
495
532
|
o.on_set do |time_provider|
|
496
533
|
Core::Utils::Time.now_provider = time_provider
|
@@ -511,8 +548,8 @@ module Datadog
|
|
511
548
|
# @return [String,nil]
|
512
549
|
option :version do |o|
|
513
550
|
# NOTE: version also gets set as a side effect of tags. See the WORKAROUND note in #initialize for details.
|
514
|
-
o.
|
515
|
-
o.
|
551
|
+
o.type :string, nilable: true
|
552
|
+
o.env Core::Environment::Ext::ENV_VERSION
|
516
553
|
end
|
517
554
|
|
518
555
|
# Client-side telemetry configuration
|
@@ -524,8 +561,22 @@ module Datadog
|
|
524
561
|
# Can be disabled as documented [here](https://docs.datadoghq.com/tracing/configure_data_security/#telemetry-collection).
|
525
562
|
# @return [Boolean]
|
526
563
|
option :enabled do |o|
|
527
|
-
o.
|
528
|
-
o.
|
564
|
+
o.env Core::Telemetry::Ext::ENV_ENABLED
|
565
|
+
o.default true
|
566
|
+
o.type :bool
|
567
|
+
end
|
568
|
+
|
569
|
+
# The interval in seconds when telemetry must be sent.
|
570
|
+
#
|
571
|
+
# This method is used internally, for testing purposes only.
|
572
|
+
#
|
573
|
+
# @default `DD_TELEMETRY_HEARTBEAT_INTERVAL` environment variable, otherwise `60`.
|
574
|
+
# @return [Float]
|
575
|
+
# @!visibility private
|
576
|
+
option :heartbeat_interval_seconds do |o|
|
577
|
+
o.type :float
|
578
|
+
o.env Core::Telemetry::Ext::ENV_HEARTBEAT_INTERVAL
|
579
|
+
o.default 60.0
|
529
580
|
end
|
530
581
|
end
|
531
582
|
|
@@ -537,17 +588,21 @@ module Datadog
|
|
537
588
|
# @default `DD_REMOTE_CONFIGURATION_ENABLED` environment variable, otherwise `true`.
|
538
589
|
# @return [Boolean]
|
539
590
|
option :enabled do |o|
|
540
|
-
o.
|
541
|
-
o.
|
591
|
+
o.env Core::Remote::Ext::ENV_ENABLED
|
592
|
+
o.default true
|
593
|
+
o.type :bool
|
542
594
|
end
|
543
595
|
|
544
596
|
# Tune remote configuration polling interval.
|
597
|
+
# This is a private setting. Do not use outside of Datadog. It might change at any point in time.
|
545
598
|
#
|
546
|
-
# @default `
|
599
|
+
# @default `DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS` environment variable, otherwise `5.0` seconds.
|
547
600
|
# @return [Float]
|
601
|
+
# @!visibility private
|
548
602
|
option :poll_interval_seconds do |o|
|
549
|
-
o.
|
550
|
-
o.
|
603
|
+
o.env Core::Remote::Ext::ENV_POLL_INTERVAL_SECONDS
|
604
|
+
o.type :float
|
605
|
+
o.default 5.0
|
551
606
|
end
|
552
607
|
|
553
608
|
# Declare service name to bind to remote configuration. Use when
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative '../../../ddtrace/version'
|
2
4
|
|
3
5
|
module Datadog
|
@@ -13,12 +15,12 @@ module Datadog
|
|
13
15
|
RUBY_VERSION
|
14
16
|
end
|
15
17
|
|
16
|
-
ENV_API_KEY = 'DD_API_KEY'
|
17
|
-
ENV_ENVIRONMENT = 'DD_ENV'
|
18
|
-
ENV_SERVICE = 'DD_SERVICE'
|
19
|
-
ENV_SITE = 'DD_SITE'
|
20
|
-
ENV_TAGS = 'DD_TAGS'
|
21
|
-
ENV_VERSION = 'DD_VERSION'
|
18
|
+
ENV_API_KEY = 'DD_API_KEY'
|
19
|
+
ENV_ENVIRONMENT = 'DD_ENV'
|
20
|
+
ENV_SERVICE = 'DD_SERVICE'
|
21
|
+
ENV_SITE = 'DD_SITE'
|
22
|
+
ENV_TAGS = 'DD_TAGS'
|
23
|
+
ENV_VERSION = 'DD_VERSION'
|
22
24
|
FALLBACK_SERVICE_NAME =
|
23
25
|
begin
|
24
26
|
File.basename($PROGRAM_NAME, '.*')
|
@@ -26,15 +28,15 @@ module Datadog
|
|
26
28
|
'ruby'
|
27
29
|
end.freeze
|
28
30
|
|
29
|
-
LANG = 'ruby'
|
31
|
+
LANG = 'ruby'
|
30
32
|
LANG_ENGINE = RUBY_ENGINE
|
31
|
-
LANG_INTERPRETER = "#{RUBY_ENGINE}-#{RUBY_PLATFORM}"
|
33
|
+
LANG_INTERPRETER = "#{RUBY_ENGINE}-#{RUBY_PLATFORM}"
|
32
34
|
LANG_PLATFORM = RUBY_PLATFORM
|
33
35
|
LANG_VERSION = RUBY_VERSION
|
34
36
|
RUBY_ENGINE = ::RUBY_ENGINE # e.g. 'ruby', 'jruby', 'truffleruby'
|
35
|
-
TAG_ENV = 'env'
|
36
|
-
TAG_SERVICE = 'service'
|
37
|
-
TAG_VERSION = 'version'
|
37
|
+
TAG_ENV = 'env'
|
38
|
+
TAG_SERVICE = 'service'
|
39
|
+
TAG_VERSION = 'version'
|
38
40
|
|
39
41
|
# TODO: Migrate to Datadog::Tracing
|
40
42
|
TRACER_VERSION = DDTrace::VERSION::STRING
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
module Core
|
5
|
+
module Environment
|
6
|
+
# Reports YJIT primitive runtime statistics.
|
7
|
+
module YJIT
|
8
|
+
module_function
|
9
|
+
|
10
|
+
# Inline code size
|
11
|
+
def inline_code_size
|
12
|
+
::RubyVM::YJIT.runtime_stats[:inline_code_size]
|
13
|
+
end
|
14
|
+
|
15
|
+
# Outlined code size
|
16
|
+
def outlined_code_size
|
17
|
+
::RubyVM::YJIT.runtime_stats[:outlined_code_size]
|
18
|
+
end
|
19
|
+
|
20
|
+
# GCed pages
|
21
|
+
def freed_page_count
|
22
|
+
::RubyVM::YJIT.runtime_stats[:freed_page_count]
|
23
|
+
end
|
24
|
+
|
25
|
+
# GCed code size
|
26
|
+
def freed_code_size
|
27
|
+
::RubyVM::YJIT.runtime_stats[:freed_code_size]
|
28
|
+
end
|
29
|
+
|
30
|
+
# Live pages
|
31
|
+
def live_page_count
|
32
|
+
::RubyVM::YJIT.runtime_stats[:live_page_count]
|
33
|
+
end
|
34
|
+
|
35
|
+
# Code GC count
|
36
|
+
def code_gc_count
|
37
|
+
::RubyVM::YJIT.runtime_stats[:code_gc_count]
|
38
|
+
end
|
39
|
+
|
40
|
+
# Size of memory region allocated for JIT code
|
41
|
+
def code_region_size
|
42
|
+
::RubyVM::YJIT.runtime_stats[:code_region_size]
|
43
|
+
end
|
44
|
+
|
45
|
+
# Total number of object shapes
|
46
|
+
def object_shape_count
|
47
|
+
::RubyVM::YJIT.runtime_stats[:object_shape_count]
|
48
|
+
end
|
49
|
+
|
50
|
+
def available?
|
51
|
+
defined?(::RubyVM::YJIT) \
|
52
|
+
&& ::RubyVM::YJIT.enabled? \
|
53
|
+
&& ::RubyVM::YJIT.respond_to?(:runtime_stats)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/datadog/core/git/ext.rb
CHANGED
@@ -1,32 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Core
|
3
5
|
module Git
|
4
6
|
# Defines constants for Git tags
|
5
7
|
module Ext
|
6
|
-
TAG_BRANCH = 'git.branch'
|
7
|
-
TAG_REPOSITORY_URL = 'git.repository_url'
|
8
|
-
TAG_TAG = 'git.tag'
|
8
|
+
TAG_BRANCH = 'git.branch'
|
9
|
+
TAG_REPOSITORY_URL = 'git.repository_url'
|
10
|
+
TAG_TAG = 'git.tag'
|
9
11
|
|
10
|
-
TAG_COMMIT_AUTHOR_DATE = 'git.commit.author.date'
|
11
|
-
TAG_COMMIT_AUTHOR_EMAIL = 'git.commit.author.email'
|
12
|
-
TAG_COMMIT_AUTHOR_NAME = 'git.commit.author.name'
|
13
|
-
TAG_COMMIT_COMMITTER_DATE = 'git.commit.committer.date'
|
14
|
-
TAG_COMMIT_COMMITTER_EMAIL = 'git.commit.committer.email'
|
15
|
-
TAG_COMMIT_COMMITTER_NAME = 'git.commit.committer.name'
|
16
|
-
TAG_COMMIT_MESSAGE = 'git.commit.message'
|
17
|
-
TAG_COMMIT_SHA = 'git.commit.sha'
|
12
|
+
TAG_COMMIT_AUTHOR_DATE = 'git.commit.author.date'
|
13
|
+
TAG_COMMIT_AUTHOR_EMAIL = 'git.commit.author.email'
|
14
|
+
TAG_COMMIT_AUTHOR_NAME = 'git.commit.author.name'
|
15
|
+
TAG_COMMIT_COMMITTER_DATE = 'git.commit.committer.date'
|
16
|
+
TAG_COMMIT_COMMITTER_EMAIL = 'git.commit.committer.email'
|
17
|
+
TAG_COMMIT_COMMITTER_NAME = 'git.commit.committer.name'
|
18
|
+
TAG_COMMIT_MESSAGE = 'git.commit.message'
|
19
|
+
TAG_COMMIT_SHA = 'git.commit.sha'
|
18
20
|
|
19
|
-
ENV_REPOSITORY_URL = 'DD_GIT_REPOSITORY_URL'
|
20
|
-
ENV_COMMIT_SHA = 'DD_GIT_COMMIT_SHA'
|
21
|
-
ENV_BRANCH = 'DD_GIT_BRANCH'
|
22
|
-
ENV_TAG = 'DD_GIT_TAG'
|
23
|
-
ENV_COMMIT_MESSAGE = 'DD_GIT_COMMIT_MESSAGE'
|
24
|
-
ENV_COMMIT_AUTHOR_NAME = 'DD_GIT_COMMIT_AUTHOR_NAME'
|
25
|
-
ENV_COMMIT_AUTHOR_EMAIL = 'DD_GIT_COMMIT_AUTHOR_EMAIL'
|
26
|
-
ENV_COMMIT_AUTHOR_DATE = 'DD_GIT_COMMIT_AUTHOR_DATE'
|
27
|
-
ENV_COMMIT_COMMITTER_NAME = 'DD_GIT_COMMIT_COMMITTER_NAME'
|
28
|
-
ENV_COMMIT_COMMITTER_EMAIL = 'DD_GIT_COMMIT_COMMITTER_EMAIL'
|
29
|
-
ENV_COMMIT_COMMITTER_DATE = 'DD_GIT_COMMIT_COMMITTER_DATE'
|
21
|
+
ENV_REPOSITORY_URL = 'DD_GIT_REPOSITORY_URL'
|
22
|
+
ENV_COMMIT_SHA = 'DD_GIT_COMMIT_SHA'
|
23
|
+
ENV_BRANCH = 'DD_GIT_BRANCH'
|
24
|
+
ENV_TAG = 'DD_GIT_TAG'
|
25
|
+
ENV_COMMIT_MESSAGE = 'DD_GIT_COMMIT_MESSAGE'
|
26
|
+
ENV_COMMIT_AUTHOR_NAME = 'DD_GIT_COMMIT_AUTHOR_NAME'
|
27
|
+
ENV_COMMIT_AUTHOR_EMAIL = 'DD_GIT_COMMIT_AUTHOR_EMAIL'
|
28
|
+
ENV_COMMIT_AUTHOR_DATE = 'DD_GIT_COMMIT_AUTHOR_DATE'
|
29
|
+
ENV_COMMIT_COMMITTER_NAME = 'DD_GIT_COMMIT_COMMITTER_NAME'
|
30
|
+
ENV_COMMIT_COMMITTER_EMAIL = 'DD_GIT_COMMIT_COMMITTER_EMAIL'
|
31
|
+
ENV_COMMIT_COMMITTER_DATE = 'DD_GIT_COMMIT_COMMITTER_DATE'
|
30
32
|
end
|
31
33
|
end
|
32
34
|
end
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Core
|
3
5
|
module Logging
|
4
6
|
module Ext
|
5
7
|
# The technology from which the log originated.
|
6
8
|
# @see https://docs.datadoghq.com/api/latest/logs/#send-logs
|
7
|
-
DD_SOURCE = 'ruby'
|
9
|
+
DD_SOURCE = 'ruby'
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
@@ -1,15 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Core
|
3
5
|
module Metrics
|
4
6
|
# @public_api
|
5
7
|
module Ext
|
6
|
-
DEFAULT_HOST = '127.0.0.1'
|
8
|
+
DEFAULT_HOST = '127.0.0.1'
|
7
9
|
DEFAULT_PORT = 8125
|
8
10
|
|
9
|
-
TAG_LANG = 'language'
|
10
|
-
TAG_LANG_INTERPRETER = 'language-interpreter'
|
11
|
-
TAG_LANG_VERSION = 'language-version'
|
12
|
-
TAG_TRACER_VERSION = 'tracer-version'
|
11
|
+
TAG_LANG = 'language'
|
12
|
+
TAG_LANG_INTERPRETER = 'language-interpreter'
|
13
|
+
TAG_LANG_VERSION = 'language-version'
|
14
|
+
TAG_TRACER_VERSION = 'tracer-version'
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../../../appsec/remote'
|
4
|
+
require_relative '../../../tracing/remote'
|
4
5
|
|
5
6
|
module Datadog
|
6
7
|
module Core
|
@@ -28,6 +29,10 @@ module Datadog
|
|
28
29
|
register_products(Datadog::AppSec::Remote.products)
|
29
30
|
register_receivers(Datadog::AppSec::Remote.receivers)
|
30
31
|
end
|
32
|
+
|
33
|
+
register_capabilities(Datadog::Tracing::Remote.capabilities)
|
34
|
+
register_products(Datadog::Tracing::Remote.products)
|
35
|
+
register_receivers(Datadog::Tracing::Remote.receivers)
|
31
36
|
end
|
32
37
|
|
33
38
|
def register_capabilities(capabilities)
|
@@ -10,6 +10,7 @@ module Datadog
|
|
10
10
|
module Remote
|
11
11
|
# Client communicates with the agent and sync remote configuration
|
12
12
|
class Client
|
13
|
+
class TransportError < StandardError; end
|
13
14
|
class SyncError < StandardError; end
|
14
15
|
|
15
16
|
attr_reader :transport, :repository, :id, :dispatcher
|
@@ -107,6 +108,8 @@ module Datadog
|
|
107
108
|
else
|
108
109
|
dispatcher.dispatch(changes, repository)
|
109
110
|
end
|
111
|
+
elsif response.internal_error?
|
112
|
+
raise TransportError, response.to_s
|
110
113
|
end
|
111
114
|
end
|
112
115
|
# rubocop:enable Metrics/AbcSize,Metrics/PerceivedComplexity,Metrics/MethodLength,Metrics/CyclomaticComplexity
|