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
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Tracing
|
3
5
|
module Contrib
|
@@ -5,14 +7,14 @@ module Datadog
|
|
5
7
|
# ActionPack integration constants
|
6
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
7
9
|
module Ext
|
8
|
-
ENV_ENABLED = 'DD_TRACE_ACTION_PACK_ENABLED'
|
9
|
-
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_PACK_ANALYTICS_ENABLED'
|
10
|
-
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_PACK_ANALYTICS_SAMPLE_RATE'
|
11
|
-
SPAN_ACTION_CONTROLLER = 'rails.action_controller'
|
12
|
-
TAG_COMPONENT = 'action_pack'
|
13
|
-
TAG_OPERATION_CONTROLLER = 'controller'
|
14
|
-
TAG_ROUTE_ACTION = 'rails.route.action'
|
15
|
-
TAG_ROUTE_CONTROLLER = 'rails.route.controller'
|
10
|
+
ENV_ENABLED = 'DD_TRACE_ACTION_PACK_ENABLED'
|
11
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_PACK_ANALYTICS_ENABLED'
|
12
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_PACK_ANALYTICS_SAMPLE_RATE'
|
13
|
+
SPAN_ACTION_CONTROLLER = 'rails.action_controller'
|
14
|
+
TAG_COMPONENT = 'action_pack'
|
15
|
+
TAG_OPERATION_CONTROLLER = 'controller'
|
16
|
+
TAG_ROUTE_ACTION = 'rails.route.action'
|
17
|
+
TAG_ROUTE_CONTROLLER = 'rails.route.controller'
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
@@ -10,18 +10,21 @@ module Datadog
|
|
10
10
|
# @public_api
|
11
11
|
class Settings < Contrib::Configuration::Settings
|
12
12
|
option :enabled do |o|
|
13
|
-
o.
|
14
|
-
o.
|
13
|
+
o.type :bool
|
14
|
+
o.env Ext::ENV_ENABLED
|
15
|
+
o.default true
|
15
16
|
end
|
16
17
|
|
17
18
|
option :analytics_enabled do |o|
|
18
|
-
o.
|
19
|
-
o.
|
19
|
+
o.type :bool
|
20
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
21
|
+
o.default false
|
20
22
|
end
|
21
23
|
|
22
24
|
option :analytics_sample_rate do |o|
|
23
|
-
o.
|
24
|
-
o.
|
25
|
+
o.type :float
|
26
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
27
|
+
o.default 1.0
|
25
28
|
end
|
26
29
|
|
27
30
|
option :service_name
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Tracing
|
3
5
|
module Contrib
|
@@ -5,16 +7,16 @@ module Datadog
|
|
5
7
|
# ActionView integration constants
|
6
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
7
9
|
module Ext
|
8
|
-
ENV_ENABLED = 'DD_TRACE_ACTION_VIEW_ENABLED'
|
9
|
-
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_VIEW_ANALYTICS_ENABLED'
|
10
|
-
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_VIEW_ANALYTICS_SAMPLE_RATE'
|
11
|
-
SPAN_RENDER_PARTIAL = 'rails.render_partial'
|
12
|
-
SPAN_RENDER_TEMPLATE = 'rails.render_template'
|
13
|
-
TAG_COMPONENT = 'action_view'
|
14
|
-
TAG_LAYOUT = 'rails.layout'
|
15
|
-
TAG_OPERATION_RENDER_PARTIAL = 'render_partial'
|
16
|
-
TAG_OPERATION_RENDER_TEMPLATE = 'render_template'
|
17
|
-
TAG_TEMPLATE_NAME = 'rails.template_name'
|
10
|
+
ENV_ENABLED = 'DD_TRACE_ACTION_VIEW_ENABLED'
|
11
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_VIEW_ANALYTICS_ENABLED'
|
12
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_VIEW_ANALYTICS_SAMPLE_RATE'
|
13
|
+
SPAN_RENDER_PARTIAL = 'rails.render_partial'
|
14
|
+
SPAN_RENDER_TEMPLATE = 'rails.render_template'
|
15
|
+
TAG_COMPONENT = 'action_view'
|
16
|
+
TAG_LAYOUT = 'rails.layout'
|
17
|
+
TAG_OPERATION_RENDER_PARTIAL = 'render_partial'
|
18
|
+
TAG_OPERATION_RENDER_TEMPLATE = 'render_template'
|
19
|
+
TAG_TEMPLATE_NAME = 'rails.template_name'
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
@@ -13,22 +13,28 @@ module Datadog
|
|
13
13
|
# @public_api
|
14
14
|
class Settings < Contrib::Configuration::Settings
|
15
15
|
option :enabled do |o|
|
16
|
-
o.
|
17
|
-
o.
|
16
|
+
o.type :bool
|
17
|
+
o.env Ext::ENV_ENABLED
|
18
|
+
o.default true
|
18
19
|
end
|
19
20
|
|
20
21
|
option :analytics_enabled do |o|
|
21
|
-
o.
|
22
|
-
o.
|
22
|
+
o.type :bool
|
23
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
24
|
+
o.default false
|
23
25
|
end
|
24
26
|
|
25
27
|
option :analytics_sample_rate do |o|
|
26
|
-
o.
|
27
|
-
o.
|
28
|
+
o.type :float
|
29
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
30
|
+
o.default 1.0
|
28
31
|
end
|
29
32
|
|
30
33
|
option :service_name
|
31
|
-
option :error_handler
|
34
|
+
option :error_handler do |o|
|
35
|
+
o.type :proc
|
36
|
+
o.experimental_default_proc(&Tracing::SpanOperation::Events::DEFAULT_ON_ERROR)
|
37
|
+
end
|
32
38
|
end
|
33
39
|
end
|
34
40
|
end
|
@@ -1,35 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Tracing
|
3
5
|
module Contrib
|
4
6
|
module ActiveJob
|
5
7
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
6
8
|
module Ext
|
7
|
-
ENV_ENABLED = 'DD_TRACE_ACTIVE_JOB_ENABLED'
|
8
|
-
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_JOB_ANALYTICS_ENABLED'
|
9
|
-
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_JOB_ANALYTICS_SAMPLE_RATE'
|
9
|
+
ENV_ENABLED = 'DD_TRACE_ACTIVE_JOB_ENABLED'
|
10
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_JOB_ANALYTICS_ENABLED'
|
11
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_JOB_ANALYTICS_SAMPLE_RATE'
|
10
12
|
|
11
|
-
SPAN_DISCARD = 'active_job.discard'
|
12
|
-
SPAN_ENQUEUE = 'active_job.enqueue'
|
13
|
-
SPAN_ENQUEUE_RETRY = 'active_job.enqueue_retry'
|
14
|
-
SPAN_PERFORM = 'active_job.perform'
|
15
|
-
SPAN_RETRY_STOPPED = 'active_job.retry_stopped'
|
13
|
+
SPAN_DISCARD = 'active_job.discard'
|
14
|
+
SPAN_ENQUEUE = 'active_job.enqueue'
|
15
|
+
SPAN_ENQUEUE_RETRY = 'active_job.enqueue_retry'
|
16
|
+
SPAN_PERFORM = 'active_job.perform'
|
17
|
+
SPAN_RETRY_STOPPED = 'active_job.retry_stopped'
|
16
18
|
|
17
|
-
TAG_COMPONENT = 'active_job'
|
18
|
-
TAG_OPERATION_DISCARD = 'discard'
|
19
|
-
TAG_OPERATION_ENQUEUE = 'enqueue'
|
20
|
-
TAG_OPERATION_ENQUEUE_AT = 'enqueue_at'
|
21
|
-
TAG_OPERATION_ENQUEUE_RETRY = 'enqueue_retry'
|
22
|
-
TAG_OPERATION_PERFORM = 'perform'
|
23
|
-
TAG_OPERATION_RETRY_STOPPED = 'retry_stopped'
|
19
|
+
TAG_COMPONENT = 'active_job'
|
20
|
+
TAG_OPERATION_DISCARD = 'discard'
|
21
|
+
TAG_OPERATION_ENQUEUE = 'enqueue'
|
22
|
+
TAG_OPERATION_ENQUEUE_AT = 'enqueue_at'
|
23
|
+
TAG_OPERATION_ENQUEUE_RETRY = 'enqueue_retry'
|
24
|
+
TAG_OPERATION_PERFORM = 'perform'
|
25
|
+
TAG_OPERATION_RETRY_STOPPED = 'retry_stopped'
|
24
26
|
|
25
|
-
TAG_ADAPTER = 'active_job.adapter'
|
26
|
-
TAG_JOB_ERROR = 'active_job.job.error'
|
27
|
-
TAG_JOB_EXECUTIONS = 'active_job.job.executions'
|
28
|
-
TAG_JOB_ID = 'active_job.job.id'
|
29
|
-
TAG_JOB_PRIORITY = 'active_job.job.priority'
|
30
|
-
TAG_JOB_QUEUE = 'active_job.job.queue'
|
31
|
-
TAG_JOB_RETRY_WAIT = 'active_job.job.retry_wait'
|
32
|
-
TAG_JOB_SCHEDULED_AT = 'active_job.job.scheduled_at'
|
27
|
+
TAG_ADAPTER = 'active_job.adapter'
|
28
|
+
TAG_JOB_ERROR = 'active_job.job.error'
|
29
|
+
TAG_JOB_EXECUTIONS = 'active_job.job.executions'
|
30
|
+
TAG_JOB_ID = 'active_job.job.id'
|
31
|
+
TAG_JOB_PRIORITY = 'active_job.job.priority'
|
32
|
+
TAG_JOB_QUEUE = 'active_job.job.queue'
|
33
|
+
TAG_JOB_RETRY_WAIT = 'active_job.job.retry_wait'
|
34
|
+
TAG_JOB_SCHEDULED_AT = 'active_job.job.scheduled_at'
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
@@ -9,7 +9,7 @@ module Datadog
|
|
9
9
|
def self.included(base)
|
10
10
|
base.class_eval do
|
11
11
|
around_perform do |_, block|
|
12
|
-
if logger.respond_to?(:tagged)
|
12
|
+
if Datadog.configuration.tracing.log_injection && logger.respond_to?(:tagged)
|
13
13
|
logger.tagged(Tracing.log_correlation, &block)
|
14
14
|
else
|
15
15
|
block.call
|
@@ -12,18 +12,21 @@ module Datadog
|
|
12
12
|
# @public_api
|
13
13
|
class Settings < Contrib::Configuration::Settings
|
14
14
|
option :enabled do |o|
|
15
|
-
o.
|
16
|
-
o.
|
15
|
+
o.type :bool
|
16
|
+
o.env Ext::ENV_ENABLED
|
17
|
+
o.default true
|
17
18
|
end
|
18
19
|
|
19
20
|
option :analytics_enabled do |o|
|
20
|
-
o.
|
21
|
-
o.
|
21
|
+
o.type :bool
|
22
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
23
|
+
o.default false
|
22
24
|
end
|
23
25
|
|
24
26
|
option :analytics_sample_rate do |o|
|
25
|
-
o.
|
26
|
-
o.
|
27
|
+
o.type :float
|
28
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
29
|
+
o.default 1.0
|
27
30
|
end
|
28
31
|
end
|
29
32
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Tracing
|
3
5
|
module Contrib
|
@@ -5,16 +7,16 @@ module Datadog
|
|
5
7
|
# ActiveModelSerializers integration constants
|
6
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
7
9
|
module Ext
|
8
|
-
ENV_ENABLED = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ENABLED'
|
9
|
-
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_ENABLED'
|
10
|
-
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_SAMPLE_RATE'
|
11
|
-
SPAN_RENDER = 'active_model_serializers.render'
|
12
|
-
SPAN_SERIALIZE = 'active_model_serializers.serialize'
|
13
|
-
TAG_ADAPTER = 'active_model_serializers.adapter'
|
14
|
-
TAG_COMPONENT = 'active_model_serializers'
|
15
|
-
TAG_OPERATION_RENDER = 'render'
|
16
|
-
TAG_OPERATION_SERIALIZE = 'serialize'
|
17
|
-
TAG_SERIALIZER = 'active_model_serializers.serializer'
|
10
|
+
ENV_ENABLED = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ENABLED'
|
11
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_ENABLED'
|
12
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_SAMPLE_RATE'
|
13
|
+
SPAN_RENDER = 'active_model_serializers.render'
|
14
|
+
SPAN_SERIALIZE = 'active_model_serializers.serialize'
|
15
|
+
TAG_ADAPTER = 'active_model_serializers.adapter'
|
16
|
+
TAG_COMPONENT = 'active_model_serializers'
|
17
|
+
TAG_OPERATION_RENDER = 'render'
|
18
|
+
TAG_OPERATION_SERIALIZE = 'serialize'
|
19
|
+
TAG_SERIALIZER = 'active_model_serializers.serializer'
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
@@ -13,18 +13,21 @@ module Datadog
|
|
13
13
|
# @public_api
|
14
14
|
class Settings < Contrib::Configuration::Settings
|
15
15
|
option :enabled do |o|
|
16
|
-
o.
|
17
|
-
o.
|
16
|
+
o.type :bool
|
17
|
+
o.env Ext::ENV_ENABLED
|
18
|
+
o.default true
|
18
19
|
end
|
19
20
|
|
20
21
|
option :analytics_enabled do |o|
|
21
|
-
o.
|
22
|
-
o.
|
22
|
+
o.type :bool
|
23
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
24
|
+
o.default false
|
23
25
|
end
|
24
26
|
|
25
27
|
option :analytics_sample_rate do |o|
|
26
|
-
o.
|
27
|
-
o.
|
28
|
+
o.type :float
|
29
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
30
|
+
o.default 1.0
|
28
31
|
end
|
29
32
|
|
30
33
|
option :service_name do |o|
|
@@ -34,7 +37,6 @@ module Datadog
|
|
34
37
|
Utils.adapter_name
|
35
38
|
)
|
36
39
|
end
|
37
|
-
o.lazy
|
38
40
|
end
|
39
41
|
end
|
40
42
|
end
|
@@ -45,14 +45,6 @@ module Datadog
|
|
45
45
|
span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
|
46
46
|
span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_SQL)
|
47
47
|
|
48
|
-
# Tag as an external peer service
|
49
|
-
if Contrib::SpanAttributeSchema.default_span_attribute_schema?
|
50
|
-
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
|
51
|
-
end
|
52
|
-
|
53
|
-
# TODO: Populate hostname for JDBC connections
|
54
|
-
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, config[:host]) if config[:host]
|
55
|
-
|
56
48
|
# Set analytics sample rate
|
57
49
|
if Contrib::Analytics.enabled?(configuration[:analytics_enabled])
|
58
50
|
Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate])
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Tracing
|
3
5
|
module Contrib
|
@@ -5,21 +7,21 @@ module Datadog
|
|
5
7
|
# ActiveRecord integration constants
|
6
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
7
9
|
module Ext
|
8
|
-
ENV_ENABLED = 'DD_TRACE_ACTIVE_RECORD_ENABLED'
|
9
|
-
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_RECORD_ANALYTICS_ENABLED'
|
10
|
-
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_RECORD_ANALYTICS_SAMPLE_RATE'
|
11
|
-
SERVICE_NAME = 'active_record'
|
12
|
-
SPAN_INSTANTIATION = 'active_record.instantiation'
|
13
|
-
SPAN_SQL = 'active_record.sql'
|
14
|
-
SPAN_TYPE_INSTANTIATION = 'custom'
|
15
|
-
TAG_COMPONENT = 'active_record'
|
16
|
-
TAG_OPERATION_INSTANTIATION = 'instantiation'
|
17
|
-
TAG_OPERATION_SQL = 'sql'
|
18
|
-
TAG_DB_CACHED = 'active_record.db.cached'
|
19
|
-
TAG_DB_NAME = 'active_record.db.name'
|
20
|
-
TAG_DB_VENDOR = 'active_record.db.vendor'
|
21
|
-
TAG_INSTANTIATION_CLASS_NAME = 'active_record.instantiation.class_name'
|
22
|
-
TAG_INSTANTIATION_RECORD_COUNT = 'active_record.instantiation.record_count'
|
10
|
+
ENV_ENABLED = 'DD_TRACE_ACTIVE_RECORD_ENABLED'
|
11
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_RECORD_ANALYTICS_ENABLED'
|
12
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_RECORD_ANALYTICS_SAMPLE_RATE'
|
13
|
+
SERVICE_NAME = 'active_record'
|
14
|
+
SPAN_INSTANTIATION = 'active_record.instantiation'
|
15
|
+
SPAN_SQL = 'active_record.sql'
|
16
|
+
SPAN_TYPE_INSTANTIATION = 'custom'
|
17
|
+
TAG_COMPONENT = 'active_record'
|
18
|
+
TAG_OPERATION_INSTANTIATION = 'instantiation'
|
19
|
+
TAG_OPERATION_SQL = 'sql'
|
20
|
+
TAG_DB_CACHED = 'active_record.db.cached'
|
21
|
+
TAG_DB_NAME = 'active_record.db.name'
|
22
|
+
TAG_DB_VENDOR = 'active_record.db.vendor'
|
23
|
+
TAG_INSTANTIATION_CLASS_NAME = 'active_record.instantiation.class_name'
|
24
|
+
TAG_INSTANTIATION_RECORD_COUNT = 'active_record.instantiation.record_count'
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -42,11 +42,6 @@ module Datadog
|
|
42
42
|
span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
|
43
43
|
span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_CACHE)
|
44
44
|
|
45
|
-
if Contrib::SpanAttributeSchema.default_span_attribute_schema?
|
46
|
-
# Tag as an external peer service
|
47
|
-
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, service)
|
48
|
-
end
|
49
|
-
|
50
45
|
tracing_context[:dd_cache_span] = span
|
51
46
|
rescue StandardError => e
|
52
47
|
Datadog.logger.debug(e.message)
|
@@ -12,18 +12,21 @@ module Datadog
|
|
12
12
|
# @public_api
|
13
13
|
class Settings < Contrib::Configuration::Settings
|
14
14
|
option :enabled do |o|
|
15
|
-
o.
|
16
|
-
o.
|
15
|
+
o.type :bool
|
16
|
+
o.env Ext::ENV_ENABLED
|
17
|
+
o.default true
|
17
18
|
end
|
18
19
|
|
19
20
|
option :analytics_enabled do |o|
|
20
|
-
o.
|
21
|
-
o.
|
21
|
+
o.type :bool
|
22
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
23
|
+
o.default false
|
22
24
|
end
|
23
25
|
|
24
26
|
option :analytics_sample_rate do |o|
|
25
|
-
o.
|
26
|
-
o.
|
27
|
+
o.type :float
|
28
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
29
|
+
o.default 1.0
|
27
30
|
end
|
28
31
|
|
29
32
|
option :cache_service do |o|
|
@@ -33,7 +36,6 @@ module Datadog
|
|
33
36
|
Ext::SERVICE_CACHE
|
34
37
|
)
|
35
38
|
end
|
36
|
-
o.lazy
|
37
39
|
end
|
38
40
|
end
|
39
41
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Tracing
|
3
5
|
module Contrib
|
@@ -5,23 +7,23 @@ module Datadog
|
|
5
7
|
# ActiveSupport integration constants
|
6
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
7
9
|
module Ext
|
8
|
-
ENV_ENABLED = 'DD_TRACE_ACTIVE_SUPPORT_ENABLED'
|
9
|
-
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_SUPPORT_ANALYTICS_ENABLED'
|
10
|
-
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_SUPPORT_ANALYTICS_SAMPLE_RATE'
|
10
|
+
ENV_ENABLED = 'DD_TRACE_ACTIVE_SUPPORT_ENABLED'
|
11
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_SUPPORT_ANALYTICS_ENABLED'
|
12
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_SUPPORT_ANALYTICS_SAMPLE_RATE'
|
11
13
|
QUANTIZE_CACHE_MAX_KEY_SIZE = 300
|
12
|
-
RESOURCE_CACHE_DELETE = 'DELETE'
|
13
|
-
RESOURCE_CACHE_GET = 'GET'
|
14
|
-
RESOURCE_CACHE_MGET = 'MGET'
|
15
|
-
RESOURCE_CACHE_SET = 'SET'
|
16
|
-
RESOURCE_CACHE_MSET = 'MSET'
|
17
|
-
SERVICE_CACHE = 'active_support-cache'
|
18
|
-
SPAN_CACHE = 'rails.cache'
|
19
|
-
SPAN_TYPE_CACHE = 'cache'
|
20
|
-
TAG_CACHE_BACKEND = 'rails.cache.backend'
|
21
|
-
TAG_CACHE_KEY = 'rails.cache.key'
|
22
|
-
TAG_CACHE_KEY_MULTI = 'rails.cache.keys'
|
23
|
-
TAG_COMPONENT = 'active_support'
|
24
|
-
TAG_OPERATION_CACHE = 'cache'
|
14
|
+
RESOURCE_CACHE_DELETE = 'DELETE'
|
15
|
+
RESOURCE_CACHE_GET = 'GET'
|
16
|
+
RESOURCE_CACHE_MGET = 'MGET'
|
17
|
+
RESOURCE_CACHE_SET = 'SET'
|
18
|
+
RESOURCE_CACHE_MSET = 'MSET'
|
19
|
+
SERVICE_CACHE = 'active_support-cache'
|
20
|
+
SPAN_CACHE = 'rails.cache'
|
21
|
+
SPAN_TYPE_CACHE = 'cache'
|
22
|
+
TAG_CACHE_BACKEND = 'rails.cache.backend'
|
23
|
+
TAG_CACHE_KEY = 'rails.cache.key'
|
24
|
+
TAG_CACHE_KEY_MULTI = 'rails.cache.keys'
|
25
|
+
TAG_COMPONENT = 'active_support'
|
26
|
+
TAG_OPERATION_CACHE = 'cache'
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
@@ -13,18 +13,21 @@ module Datadog
|
|
13
13
|
# @public_api
|
14
14
|
class Settings < Contrib::Configuration::Settings
|
15
15
|
option :enabled do |o|
|
16
|
-
o.
|
17
|
-
o.
|
16
|
+
o.type :bool
|
17
|
+
o.env Ext::ENV_ENABLED
|
18
|
+
o.default true
|
18
19
|
end
|
19
20
|
|
20
21
|
option :analytics_enabled do |o|
|
21
|
-
o.
|
22
|
-
o.
|
22
|
+
o.type :bool
|
23
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
24
|
+
o.default false
|
23
25
|
end
|
24
26
|
|
25
27
|
option :analytics_sample_rate do |o|
|
26
|
-
o.
|
27
|
-
o.
|
28
|
+
o.type :float
|
29
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
30
|
+
o.default 1.0
|
28
31
|
end
|
29
32
|
|
30
33
|
option :service_name do |o|
|
@@ -34,7 +37,11 @@ module Datadog
|
|
34
37
|
Ext::DEFAULT_PEER_SERVICE_NAME
|
35
38
|
)
|
36
39
|
end
|
37
|
-
|
40
|
+
end
|
41
|
+
|
42
|
+
option :peer_service do |o|
|
43
|
+
o.type :string, nilable: true
|
44
|
+
o.env Ext::ENV_PEER_SERVICE
|
38
45
|
end
|
39
46
|
end
|
40
47
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Tracing
|
3
5
|
module Contrib
|
@@ -5,30 +7,41 @@ module Datadog
|
|
5
7
|
# AWS integration constants
|
6
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
7
9
|
module Ext
|
8
|
-
ENV_ENABLED = 'DD_TRACE_AWS_ENABLED'
|
9
|
-
ENV_SERVICE_NAME = 'DD_TRACE_AWS_SERVICE_NAME'
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
10
|
+
ENV_ENABLED = 'DD_TRACE_AWS_ENABLED'
|
11
|
+
ENV_SERVICE_NAME = 'DD_TRACE_AWS_SERVICE_NAME'
|
12
|
+
ENV_PEER_SERVICE = 'DD_TRACE_AWS_PEER_SERVICE'
|
13
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_AWS_ANALYTICS_ENABLED'
|
14
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_AWS_ANALYTICS_SAMPLE_RATE'
|
15
|
+
DEFAULT_PEER_SERVICE_NAME = 'aws'
|
16
|
+
SPAN_COMMAND = 'aws.command'
|
17
|
+
TAG_AGENT = 'aws.agent'
|
18
|
+
TAG_COMPONENT = 'aws'
|
19
|
+
TAG_DEFAULT_AGENT = 'aws-sdk-ruby'
|
20
|
+
TAG_HOST = 'host'
|
21
|
+
TAG_OPERATION = 'aws.operation'
|
22
|
+
TAG_OPERATION_COMMAND = 'command'
|
23
|
+
TAG_PATH = 'path'
|
24
|
+
TAG_AWS_REGION = 'aws.region'
|
25
|
+
TAG_REGION = 'region'
|
26
|
+
TAG_AWS_SERVICE = 'aws_service'
|
27
|
+
TAG_AWS_ACCOUNT = 'aws_account'
|
28
|
+
TAG_QUEUE_NAME = 'queuename'
|
29
|
+
TAG_TOPIC_NAME = 'topicname'
|
30
|
+
TAG_TABLE_NAME = 'tablename'
|
31
|
+
TAG_STREAM_NAME = 'streamname'
|
32
|
+
TAG_RULE_NAME = 'rulename'
|
33
|
+
TAG_STATE_MACHINE_NAME = 'statemachinename'
|
34
|
+
TAG_BUCKET_NAME = 'bucketname'
|
35
|
+
PEER_SERVICE_SOURCES = Array[TAG_QUEUE_NAME,
|
36
|
+
TAG_TOPIC_NAME,
|
37
|
+
TAG_STREAM_NAME,
|
38
|
+
TAG_TABLE_NAME,
|
39
|
+
TAG_BUCKET_NAME,
|
40
|
+
TAG_RULE_NAME,
|
41
|
+
TAG_STATE_MACHINE_NAME,
|
42
|
+
Tracing::Metadata::Ext::TAG_PEER_HOSTNAME,
|
43
|
+
Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME,
|
44
|
+
Tracing::Metadata::Ext::NET::TAG_TARGET_HOST,].freeze
|
32
45
|
end
|
33
46
|
end
|
34
47
|
end
|
@@ -40,16 +40,18 @@ module Datadog
|
|
40
40
|
handler.add_tags(span, params)
|
41
41
|
end
|
42
42
|
|
43
|
+
if configuration[:peer_service]
|
44
|
+
span.set_tag(
|
45
|
+
Tracing::Metadata::Ext::TAG_PEER_SERVICE,
|
46
|
+
configuration[:peer_service]
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
43
50
|
span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_CLIENT)
|
44
51
|
|
45
52
|
span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
|
46
53
|
span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_COMMAND)
|
47
54
|
|
48
|
-
# Tag as an external peer service
|
49
|
-
if Contrib::SpanAttributeSchema.default_span_attribute_schema?
|
50
|
-
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
|
51
|
-
end
|
52
|
-
|
53
55
|
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, context.safely(:host))
|
54
56
|
|
55
57
|
# Set analytics sample rate
|
@@ -66,6 +68,8 @@ module Datadog
|
|
66
68
|
span.set_tag(Ext::TAG_HOST, context.safely(:host))
|
67
69
|
span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_METHOD, context.safely(:http_method))
|
68
70
|
span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_STATUS_CODE, context.safely(:status_code))
|
71
|
+
|
72
|
+
Contrib::SpanAttributeSchema.set_peer_service!(span, Ext::PEER_SERVICE_SOURCES)
|
69
73
|
end
|
70
74
|
|
71
75
|
def configuration
|
@@ -12,8 +12,9 @@ module Datadog
|
|
12
12
|
# @public_api
|
13
13
|
class Settings < Contrib::Configuration::Settings
|
14
14
|
option :enabled do |o|
|
15
|
-
o.
|
16
|
-
o.
|
15
|
+
o.type :bool
|
16
|
+
o.env Ext::ENV_ENABLED
|
17
|
+
o.default true
|
17
18
|
end
|
18
19
|
end
|
19
20
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Tracing
|
3
5
|
module Contrib
|
@@ -5,8 +7,8 @@ module Datadog
|
|
5
7
|
# ConcurrentRuby integration constants
|
6
8
|
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
7
9
|
module Ext
|
8
|
-
APP = 'concurrent-ruby'
|
9
|
-
ENV_ENABLED = 'DD_TRACE_CONCURRENT_RUBY_ENABLED'
|
10
|
+
APP = 'concurrent-ruby'
|
11
|
+
ENV_ENABLED = 'DD_TRACE_CONCURRENT_RUBY_ENABLED'
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|