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
@@ -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 :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,45 +7,46 @@ module Datadog
|
|
5
7
|
# Kafka 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_KAFKA_ENABLED'
|
9
|
-
ENV_ANALYTICS_ENABLED = 'DD_TRACE_KAFKA_ANALYTICS_ENABLED'
|
10
|
-
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_KAFKA_ANALYTICS_SAMPLE_RATE'
|
11
|
-
SPAN_CONNECTION_REQUEST = 'kafka.connection.request'
|
12
|
-
SPAN_CONSUMER_HEARTBEAT = 'kafka.consumer.heartbeat'
|
13
|
-
SPAN_CONSUMER_JOIN_GROUP = 'kafka.consumer.join_group'
|
14
|
-
SPAN_CONSUMER_LEAVE_GROUP = 'kafka.consumer.leave_group'
|
15
|
-
SPAN_CONSUMER_SYNC_GROUP = 'kafka.consumer.sync_group'
|
16
|
-
SPAN_DELIVER_MESSAGES = 'kafka.producer.deliver_messages'
|
17
|
-
SPAN_PROCESS_BATCH = 'kafka.consumer.process_batch'
|
18
|
-
SPAN_PROCESS_MESSAGE = 'kafka.consumer.process_message'
|
19
|
-
SPAN_SEND_MESSAGES = 'kafka.producer.send_messages'
|
20
|
-
TAG_ATTEMPTS = 'kafka.attempts'
|
21
|
-
TAG_API = 'kafka.api'
|
22
|
-
TAG_CLIENT = 'kafka.client'
|
23
|
-
TAG_GROUP = 'kafka.group'
|
24
|
-
TAG_HIGHWATER_MARK_OFFSET = 'kafka.highwater_mark_offset'
|
25
|
-
TAG_MESSAGE_COUNT = 'kafka.message_count'
|
26
|
-
TAG_MESSAGE_KEY = 'kafka.message_key'
|
27
|
-
TAG_DELIVERED_MESSAGE_COUNT = 'kafka.delivered_message_count'
|
28
|
-
TAG_OFFSET = 'kafka.offset'
|
29
|
-
TAG_OFFSET_LAG = 'kafka.offset_lag'
|
30
|
-
TAG_PARTITION = 'kafka.partition'
|
31
|
-
TAG_REQUEST_SIZE = 'kafka.request_size'
|
32
|
-
TAG_RESPONSE_SIZE = 'kafka.response_size'
|
33
|
-
TAG_SENT_MESSAGE_COUNT = 'kafka.sent_message_count'
|
34
|
-
TAG_TOPIC = 'kafka.topic'
|
35
|
-
TAG_TOPIC_PARTITIONS = 'kafka.topic_partitions'
|
36
|
-
TAG_COMPONENT = 'kafka'
|
37
|
-
TAG_OPERATION_CONNECTION_REQUEST = 'connection.request'
|
38
|
-
TAG_OPERATION_CONSUMER_HEARTBEAT = 'consumer.heartbeat'
|
39
|
-
TAG_OPERATION_CONSUMER_JOIN_GROUP = 'consumer.join_group'
|
40
|
-
TAG_OPERATION_CONSUMER_LEAVE_GROUP = 'consumer.leave_group'
|
41
|
-
TAG_OPERATION_CONSUMER_SYNC_GROUP = 'consumer.sync_group'
|
42
|
-
TAG_OPERATION_DELIVER_MESSAGES = 'producer.deliver_messages'
|
43
|
-
TAG_OPERATION_PROCESS_BATCH = 'consumer.process_batch'
|
44
|
-
TAG_OPERATION_PROCESS_MESSAGE = 'consumer.process_message'
|
45
|
-
TAG_OPERATION_SEND_MESSAGES = 'producer.send_messages'
|
46
|
-
TAG_MESSAGING_SYSTEM = 'kafka'
|
10
|
+
ENV_ENABLED = 'DD_TRACE_KAFKA_ENABLED'
|
11
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_KAFKA_ANALYTICS_ENABLED'
|
12
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_KAFKA_ANALYTICS_SAMPLE_RATE'
|
13
|
+
SPAN_CONNECTION_REQUEST = 'kafka.connection.request'
|
14
|
+
SPAN_CONSUMER_HEARTBEAT = 'kafka.consumer.heartbeat'
|
15
|
+
SPAN_CONSUMER_JOIN_GROUP = 'kafka.consumer.join_group'
|
16
|
+
SPAN_CONSUMER_LEAVE_GROUP = 'kafka.consumer.leave_group'
|
17
|
+
SPAN_CONSUMER_SYNC_GROUP = 'kafka.consumer.sync_group'
|
18
|
+
SPAN_DELIVER_MESSAGES = 'kafka.producer.deliver_messages'
|
19
|
+
SPAN_PROCESS_BATCH = 'kafka.consumer.process_batch'
|
20
|
+
SPAN_PROCESS_MESSAGE = 'kafka.consumer.process_message'
|
21
|
+
SPAN_SEND_MESSAGES = 'kafka.producer.send_messages'
|
22
|
+
TAG_ATTEMPTS = 'kafka.attempts'
|
23
|
+
TAG_API = 'kafka.api'
|
24
|
+
TAG_CLIENT = 'kafka.client'
|
25
|
+
TAG_GROUP = 'kafka.group'
|
26
|
+
TAG_HIGHWATER_MARK_OFFSET = 'kafka.highwater_mark_offset'
|
27
|
+
TAG_MESSAGE_COUNT = 'kafka.message_count'
|
28
|
+
TAG_MESSAGE_KEY = 'kafka.message_key'
|
29
|
+
TAG_DELIVERED_MESSAGE_COUNT = 'kafka.delivered_message_count'
|
30
|
+
TAG_OFFSET = 'kafka.offset'
|
31
|
+
TAG_OFFSET_LAG = 'kafka.offset_lag'
|
32
|
+
TAG_PARTITION = 'kafka.partition'
|
33
|
+
TAG_REQUEST_SIZE = 'kafka.request_size'
|
34
|
+
TAG_RESPONSE_SIZE = 'kafka.response_size'
|
35
|
+
TAG_SENT_MESSAGE_COUNT = 'kafka.sent_message_count'
|
36
|
+
TAG_TOPIC = 'kafka.topic'
|
37
|
+
TAG_TOPIC_PARTITIONS = 'kafka.topic_partitions'
|
38
|
+
TAG_COMPONENT = 'kafka'
|
39
|
+
TAG_OPERATION_CONNECTION_REQUEST = 'connection.request'
|
40
|
+
TAG_OPERATION_CONSUMER_HEARTBEAT = 'consumer.heartbeat'
|
41
|
+
TAG_OPERATION_CONSUMER_JOIN_GROUP = 'consumer.join_group'
|
42
|
+
TAG_OPERATION_CONSUMER_LEAVE_GROUP = 'consumer.leave_group'
|
43
|
+
TAG_OPERATION_CONSUMER_SYNC_GROUP = 'consumer.sync_group'
|
44
|
+
TAG_OPERATION_DELIVER_MESSAGES = 'producer.deliver_messages'
|
45
|
+
TAG_OPERATION_PROCESS_BATCH = 'consumer.process_batch'
|
46
|
+
TAG_OPERATION_PROCESS_MESSAGE = 'consumer.process_message'
|
47
|
+
TAG_OPERATION_SEND_MESSAGES = 'producer.send_messages'
|
48
|
+
TAG_MESSAGING_SYSTEM = 'kafka'
|
49
|
+
TAG_KAFKA_BOOTSTRAP_SERVERS = 'messaging.kafka.bootstrap.servers'
|
47
50
|
end
|
48
51
|
end
|
49
52
|
end
|
@@ -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,7 +7,7 @@ module Datadog
|
|
5
7
|
# Lograge 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_LOGRAGE_ENABLED'
|
10
|
+
ENV_ENABLED = 'DD_TRACE_LOGRAGE_ENABLED'
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
@@ -15,6 +15,7 @@ module Datadog
|
|
15
15
|
# Instance methods for configuration
|
16
16
|
module InstanceMethods
|
17
17
|
def custom_options(event)
|
18
|
+
return super unless Datadog.configuration.tracing.log_injection
|
18
19
|
return super unless Datadog.configuration.tracing[:lograge].enabled
|
19
20
|
|
20
21
|
original_custom_options = super(event)
|
@@ -14,18 +14,21 @@ module Datadog
|
|
14
14
|
DEFAULT_QUANTIZE = { show: [:collection, :database, :operation] }.freeze
|
15
15
|
|
16
16
|
option :enabled do |o|
|
17
|
-
o.
|
18
|
-
o.
|
17
|
+
o.type :bool
|
18
|
+
o.env Ext::ENV_ENABLED
|
19
|
+
o.default true
|
19
20
|
end
|
20
21
|
|
21
22
|
option :analytics_enabled do |o|
|
22
|
-
o.
|
23
|
-
o.
|
23
|
+
o.type :bool
|
24
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
25
|
+
o.default false
|
24
26
|
end
|
25
27
|
|
26
28
|
option :analytics_sample_rate do |o|
|
27
|
-
o.
|
28
|
-
o.
|
29
|
+
o.type :float
|
30
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
31
|
+
o.default 1.0
|
29
32
|
end
|
30
33
|
|
31
34
|
option :quantize, default: DEFAULT_QUANTIZE
|
@@ -37,7 +40,11 @@ module Datadog
|
|
37
40
|
Ext::DEFAULT_PEER_SERVICE_NAME
|
38
41
|
)
|
39
42
|
end
|
40
|
-
|
43
|
+
end
|
44
|
+
|
45
|
+
option :peer_service do |o|
|
46
|
+
o.type :string, nilable: true
|
47
|
+
o.env Ext::ENV_PEER_SERVICE
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Datadog
|
2
4
|
module Tracing
|
3
5
|
module Contrib
|
@@ -5,26 +7,28 @@ module Datadog
|
|
5
7
|
# MongoDB 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_MONGO_ENABLED'
|
9
|
-
ENV_SERVICE_NAME = 'DD_TRACE_MONGO_SERVICE_NAME'
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
10
|
+
ENV_ENABLED = 'DD_TRACE_MONGO_ENABLED'
|
11
|
+
ENV_SERVICE_NAME = 'DD_TRACE_MONGO_SERVICE_NAME'
|
12
|
+
ENV_PEER_SERVICE = 'DD_TRACE_MONGO_PEER_SERVICE'
|
13
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_MONGO_ANALYTICS_ENABLED'
|
14
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_MONGO_ANALYTICS_SAMPLE_RATE'
|
15
|
+
DEFAULT_PEER_SERVICE_NAME = 'mongodb'
|
16
|
+
SPAN_COMMAND = 'mongo.cmd'
|
17
|
+
SPAN_TYPE_COMMAND = 'mongodb'
|
18
|
+
TAG_COLLECTION = 'mongodb.collection'
|
19
|
+
TAG_DB = 'mongodb.db'
|
20
|
+
TAG_OPERATION = 'mongodb.operation'
|
21
|
+
TAG_QUERY = 'mongodb.query'
|
22
|
+
TAG_ROWS = 'mongodb.rows'
|
23
|
+
TAG_COMPONENT = 'mongodb'
|
24
|
+
TAG_OPERATION_COMMAND = 'command'
|
25
|
+
TAG_SYSTEM = 'mongodb'
|
26
|
+
PEER_SERVICE_SOURCES = (Array[Ext::TAG_DB] + Contrib::Ext::DB::PEER_SERVICE_SOURCES).freeze
|
23
27
|
|
24
28
|
# Temporary namespace to accommodate unified tags which has naming collision, before
|
25
29
|
# making breaking changes
|
26
30
|
module DB
|
27
|
-
TAG_COLLECTION = 'db.mongodb.collection'
|
31
|
+
TAG_COLLECTION = 'db.mongodb.collection'
|
28
32
|
end
|
29
33
|
end
|
30
34
|
end
|
@@ -29,6 +29,13 @@ module Datadog
|
|
29
29
|
query = MongoDB.query_builder(event.command_name, event.database_name, event.command)
|
30
30
|
serialized_query = query.to_s
|
31
31
|
|
32
|
+
if datadog_configuration[:peer_service]
|
33
|
+
span.set_tag(
|
34
|
+
Tracing::Metadata::Ext::TAG_PEER_SERVICE,
|
35
|
+
datadog_configuration[:peer_service]
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
32
39
|
span.set_tag(Contrib::Ext::DB::TAG_SYSTEM, Ext::TAG_SYSTEM)
|
33
40
|
|
34
41
|
span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_CLIENT)
|
@@ -36,11 +43,6 @@ module Datadog
|
|
36
43
|
span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
|
37
44
|
span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_COMMAND)
|
38
45
|
|
39
|
-
if Contrib::SpanAttributeSchema.default_span_attribute_schema?
|
40
|
-
# Tag as an external peer service
|
41
|
-
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
|
42
|
-
end
|
43
|
-
|
44
46
|
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, event.address.host)
|
45
47
|
|
46
48
|
# Set analytics sample rate
|
@@ -56,6 +58,8 @@ module Datadog
|
|
56
58
|
span.set_tag(Tracing::Metadata::Ext::NET::TAG_TARGET_HOST, event.address.host)
|
57
59
|
span.set_tag(Tracing::Metadata::Ext::NET::TAG_TARGET_PORT, event.address.port)
|
58
60
|
|
61
|
+
Contrib::SpanAttributeSchema.set_peer_service!(span, Ext::PEER_SERVICE_SOURCES)
|
62
|
+
|
59
63
|
# set the resource with the quantized query
|
60
64
|
span.resource = serialized_query
|
61
65
|
end
|
@@ -14,18 +14,21 @@ module Datadog
|
|
14
14
|
# @public_api
|
15
15
|
class Settings < Contrib::Configuration::Settings
|
16
16
|
option :enabled do |o|
|
17
|
-
o.
|
18
|
-
o.
|
17
|
+
o.type :bool
|
18
|
+
o.env Ext::ENV_ENABLED
|
19
|
+
o.default true
|
19
20
|
end
|
20
21
|
|
21
22
|
option :analytics_enabled do |o|
|
22
|
-
o.
|
23
|
-
o.
|
23
|
+
o.type :bool
|
24
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
25
|
+
o.default false
|
24
26
|
end
|
25
27
|
|
26
28
|
option :analytics_sample_rate do |o|
|
27
|
-
o.
|
28
|
-
o.
|
29
|
+
o.type :float
|
30
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
31
|
+
o.default 1.0
|
29
32
|
end
|
30
33
|
|
31
34
|
option :service_name do |o|
|
@@ -35,17 +38,17 @@ module Datadog
|
|
35
38
|
Ext::DEFAULT_PEER_SERVICE_NAME
|
36
39
|
)
|
37
40
|
end
|
38
|
-
o.lazy
|
39
41
|
end
|
40
42
|
|
41
43
|
option :comment_propagation do |o|
|
42
|
-
o.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
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
|
49
52
|
end
|
50
53
|
end
|
51
54
|
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,19 @@ module Datadog
|
|
5
7
|
# Mysql2 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_MYSQL2_ENABLED'
|
9
|
-
ENV_SERVICE_NAME = 'DD_TRACE_MYSQL2_SERVICE_NAME'
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
ENV_ENABLED = 'DD_TRACE_MYSQL2_ENABLED'
|
11
|
+
ENV_SERVICE_NAME = 'DD_TRACE_MYSQL2_SERVICE_NAME'
|
12
|
+
ENV_PEER_SERVICE = 'DD_TRACE_MYSQL2_PEER_SERVICE'
|
13
|
+
|
14
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_MYSQL2_ANALYTICS_ENABLED'
|
15
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_MYSQL2_ANALYTICS_SAMPLE_RATE'
|
16
|
+
DEFAULT_PEER_SERVICE_NAME = 'mysql2'
|
17
|
+
SPAN_QUERY = 'mysql2.query'
|
18
|
+
TAG_DB_NAME = 'mysql2.db.name'
|
19
|
+
TAG_COMPONENT = 'mysql2'
|
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
|
18
23
|
end
|
19
24
|
end
|
20
25
|
end
|
@@ -26,17 +26,19 @@ module Datadog
|
|
26
26
|
span.resource = sql
|
27
27
|
span.span_type = Tracing::Metadata::Ext::SQL::TYPE
|
28
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
|
+
|
29
36
|
span.set_tag(Contrib::Ext::DB::TAG_SYSTEM, Ext::TAG_SYSTEM)
|
30
37
|
span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_CLIENT)
|
31
38
|
|
32
39
|
span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
|
33
40
|
span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_QUERY)
|
34
41
|
|
35
|
-
if Contrib::SpanAttributeSchema.default_span_attribute_schema?
|
36
|
-
# Tag as an external peer service
|
37
|
-
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
|
38
|
-
end
|
39
|
-
|
40
42
|
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, query_options[:host])
|
41
43
|
|
42
44
|
# Set analytics sample rate
|
@@ -51,6 +53,8 @@ module Datadog
|
|
51
53
|
Contrib::Propagation::SqlComment.annotate!(span, propagation_mode)
|
52
54
|
sql = Contrib::Propagation::SqlComment.prepend_comment(sql, span, trace_op, propagation_mode)
|
53
55
|
|
56
|
+
Contrib::SpanAttributeSchema.set_peer_service!(span, Ext::PEER_SERVICE_SOURCES)
|
57
|
+
|
54
58
|
super(sql, options)
|
55
59
|
end
|
56
60
|
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../configuration/settings'
|
4
|
+
require_relative '../ext'
|
5
|
+
|
6
|
+
module Datadog
|
7
|
+
module Tracing
|
8
|
+
module Contrib
|
9
|
+
module OpenSearch
|
10
|
+
module Configuration
|
11
|
+
# Custom settings for the OpenSearch integration
|
12
|
+
# @public_api
|
13
|
+
class Settings < Contrib::Configuration::Settings
|
14
|
+
option :enabled do |o|
|
15
|
+
o.type :bool
|
16
|
+
o.env Ext::ENV_ENABLED
|
17
|
+
o.default true
|
18
|
+
end
|
19
|
+
|
20
|
+
option :analytics_enabled do |o|
|
21
|
+
o.type :bool
|
22
|
+
o.env Ext::ENV_ANALYTICS_ENABLED
|
23
|
+
o.default false
|
24
|
+
end
|
25
|
+
|
26
|
+
option :analytics_sample_rate do |o|
|
27
|
+
o.type :float
|
28
|
+
o.env Ext::ENV_ANALYTICS_SAMPLE_RATE
|
29
|
+
o.default 1.0
|
30
|
+
end
|
31
|
+
|
32
|
+
option :quantize, default: {}
|
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 :peer_service do |o|
|
44
|
+
o.type :string, nilable: true
|
45
|
+
o.env Ext::ENV_PEER_SERVICE
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
module Tracing
|
5
|
+
module Contrib
|
6
|
+
module OpenSearch
|
7
|
+
# OpenSearch integration constants
|
8
|
+
# @public_api Changing resource names, tag names, or environment variables creates breaking changes.
|
9
|
+
module Ext
|
10
|
+
ENV_ENABLED = 'DD_TRACE_OPENSEARCH_ENABLED'
|
11
|
+
ENV_SERVICE_NAME = 'DD_TRACE_OPENSEARCH_SERVICE_NAME'
|
12
|
+
ENV_PEER_SERVICE = 'DD_TRACE_OPENSEARCH_PEER_SERVICE'
|
13
|
+
ENV_ANALYTICS_ENABLED = 'DD_TRACE_OPENSEARCH_ANALYTICS_ENABLED'
|
14
|
+
ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_OPENSEARCH_ANALYTICS_SAMPLE_RATE'
|
15
|
+
DEFAULT_PEER_SERVICE_NAME = 'opensearch'
|
16
|
+
SPAN_QUERY = 'opensearch.query'
|
17
|
+
SPAN_TYPE_QUERY = 'opensearch'
|
18
|
+
TAG_COMPONENT = 'opensearch'
|
19
|
+
TAG_SYSTEM = 'opensearch'
|
20
|
+
TAG_METHOD = 'http.method'
|
21
|
+
TAG_PATH = 'http.url_details.path'
|
22
|
+
TAG_PARAMS = 'opensearch.params'
|
23
|
+
TAG_BODY = 'opensearch.body'
|
24
|
+
TAG_URL = 'http.url'
|
25
|
+
TAG_HOST = 'http.url_details.host'
|
26
|
+
TAG_PORT = 'http.url_details.port'
|
27
|
+
TAG_SCHEME = 'http.url_details.scheme'
|
28
|
+
TAG_RESPONSE_CONTENT_LENGTH = 'http.response.content_length'
|
29
|
+
PEER_SERVICE_SOURCES = Array[
|
30
|
+
Tracing::Metadata::Ext::TAG_PEER_HOSTNAME,
|
31
|
+
Tracing::Metadata::Ext::NET::TAG_DESTINATION_NAME,
|
32
|
+
Tracing::Metadata::Ext::NET::TAG_TARGET_HOST,].freeze
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,44 @@
|
|
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 OpenSearch
|
11
|
+
# Description of OpenSearch integration
|
12
|
+
class Integration
|
13
|
+
include Contrib::Integration
|
14
|
+
|
15
|
+
MINIMUM_VERSION = Gem::Version.new('1.0.0')
|
16
|
+
|
17
|
+
# @public_api Changing the integration name or integration options can cause breaking changes
|
18
|
+
register_as :opensearch, auto_patch: true
|
19
|
+
|
20
|
+
def self.version
|
21
|
+
Gem.loaded_specs['opensearch-transport'] \
|
22
|
+
&& Gem.loaded_specs['opensearch-transport'].version
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.loaded?
|
26
|
+
!defined?(::OpenSearch::Transport).nil?
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.compatible?
|
30
|
+
super && version >= MINIMUM_VERSION
|
31
|
+
end
|
32
|
+
|
33
|
+
def new_configuration
|
34
|
+
Configuration::Settings.new
|
35
|
+
end
|
36
|
+
|
37
|
+
def patcher
|
38
|
+
Patcher
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|