datadog 2.46.0 → 2.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +56 -2
- data/LICENSE-3rdparty.csv +1 -0
- data/ext/datadog_profiling_native_extension/collectors_stack.c +143 -86
- data/ext/datadog_profiling_native_extension/collectors_stack.h +9 -1
- data/ext/datadog_profiling_native_extension/collectors_thread_context.c +6 -1
- data/ext/datadog_profiling_native_extension/extconf.rb +7 -13
- data/ext/datadog_profiling_native_extension/native_extension_helpers.rb +3 -3
- data/ext/datadog_profiling_native_extension/private_vm_api_access.c +67 -14
- data/ext/datadog_profiling_native_extension/private_vm_api_access.h +8 -1
- data/ext/datadog_profiling_native_extension/profiling.c +1 -1
- data/ext/libdatadog_api/extconf.rb +9 -7
- data/ext/libdatadog_api/trace_exporter.c +34 -7
- data/ext/libdatadog_extconf_helpers.rb +2 -2
- data/lib/datadog/ai_guard/component.rb +1 -1
- data/lib/datadog/ai_guard/contrib/rack/request_middleware.rb +1 -9
- data/lib/datadog/ai_guard/contrib/rails/patcher.rb +1 -1
- data/lib/datadog/ai_guard/contrib/ruby_llm/message_adapter.rb +1 -1
- data/lib/datadog/ai_guard/contrib/ruby_llm/redaction_change_set.rb +3 -3
- data/lib/datadog/ai_guard/evaluation/client.rb +3 -3
- data/lib/datadog/ai_guard/evaluation.rb +2 -2
- data/lib/datadog/ai_guard/http_client.rb +3 -2
- data/lib/datadog/ai_guard/redaction.rb +1 -1
- data/lib/datadog/appsec/api_security/endpoint_collection/rails_collector.rb +1 -1
- data/lib/datadog/appsec/assets/waf_rules/README.md +3 -3
- data/lib/datadog/appsec/assets/waf_rules/recommended.json +5366 -1517
- data/lib/datadog/appsec/assets/waf_rules/strict.json +2 -2
- data/lib/datadog/appsec/autoload.rb +1 -1
- data/lib/datadog/appsec/component.rb +1 -1
- data/lib/datadog/appsec/compressed_json.rb +1 -1
- data/lib/datadog/appsec/configuration.rb +3 -3
- data/lib/datadog/appsec/context.rb +1 -1
- data/lib/datadog/appsec/contrib/active_record/instrumentation.rb +11 -1
- data/lib/datadog/appsec/contrib/active_record/patcher.rb +12 -4
- data/lib/datadog/appsec/contrib/aws_lambda/gateway/watcher.rb +2 -2
- data/lib/datadog/appsec/contrib/aws_lambda/waf_addresses.rb +1 -1
- data/lib/datadog/appsec/contrib/devise/configuration.rb +1 -1
- data/lib/datadog/appsec/contrib/devise/patches/signin_tracking_patch.rb +1 -1
- data/lib/datadog/appsec/contrib/devise/patches/signup_tracking_patch.rb +1 -1
- data/lib/datadog/appsec/contrib/devise/tracking_middleware.rb +1 -1
- data/lib/datadog/appsec/contrib/excon/ssrf_detection_middleware.rb +1 -1
- data/lib/datadog/appsec/contrib/faraday/ssrf_detection_middleware.rb +1 -1
- data/lib/datadog/appsec/contrib/graphql/gateway/multiplex.rb +7 -7
- data/lib/datadog/appsec/contrib/graphql/gateway/watcher.rb +1 -1
- data/lib/datadog/appsec/contrib/rack/gateway/watcher.rb +3 -3
- data/lib/datadog/appsec/contrib/rack/request_middleware.rb +5 -5
- data/lib/datadog/appsec/contrib/rails/gateway/watcher.rb +31 -4
- data/lib/datadog/appsec/contrib/rails/patcher.rb +2 -2
- data/lib/datadog/appsec/contrib/rails/patches/render_to_body_patch.rb +8 -7
- data/lib/datadog/appsec/contrib/rest_client/request_ssrf_detection_patch.rb +1 -1
- data/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb +17 -5
- data/lib/datadog/appsec/contrib/sinatra/patcher.rb +1 -1
- data/lib/datadog/appsec/contrib/sinatra/patches/json_patch.rb +8 -7
- data/lib/datadog/appsec/metrics/collector.rb +5 -5
- data/lib/datadog/appsec/metrics/telemetry_exporter.rb +3 -3
- data/lib/datadog/appsec/monitor/gateway/watcher.rb +2 -2
- data/lib/datadog/appsec/processor/rule_loader.rb +1 -1
- data/lib/datadog/appsec/response.rb +1 -1
- data/lib/datadog/appsec/security_engine/engine.rb +8 -7
- data/lib/datadog/appsec/security_engine/runner.rb +2 -2
- data/lib/datadog/appsec/trace_keeper.rb +1 -1
- data/lib/datadog/appsec.rb +1 -1
- data/lib/datadog/core/configuration/agent_settings_resolver.rb +14 -13
- data/lib/datadog/core/configuration/agentless_settings_resolver.rb +2 -2
- data/lib/datadog/core/configuration/components.rb +12 -11
- data/lib/datadog/core/configuration/components_state.rb +8 -1
- data/lib/datadog/core/configuration/settings.rb +5 -2
- data/lib/datadog/core/configuration/supported_configurations.rb +3 -0
- data/lib/datadog/core/configuration.rb +2 -2
- data/lib/datadog/core/crashtracking/component.rb +1 -1
- data/lib/datadog/core/diagnostics/environment_logger.rb +1 -1
- data/lib/datadog/core/environment/cgroup.rb +2 -2
- data/lib/datadog/core/environment/container.rb +3 -3
- data/lib/datadog/core/metrics/client.rb +6 -6
- data/lib/datadog/core/process_discovery.rb +1 -1
- data/lib/datadog/core/remote/client.rb +44 -3
- data/lib/datadog/core/remote/dispatcher.rb +34 -3
- data/lib/datadog/core/remote/tie/tracing.rb +4 -3
- data/lib/datadog/core/remote/transport/http.rb +2 -2
- data/lib/datadog/core/runtime/metrics.rb +14 -14
- data/lib/datadog/core/semaphore.rb +3 -1
- data/lib/datadog/core/telemetry/event/app_started.rb +9 -9
- data/lib/datadog/core/telemetry/logger.rb +1 -1
- data/lib/datadog/core/telemetry/logging.rb +1 -1
- data/lib/datadog/core/telemetry/request.rb +9 -3
- data/lib/datadog/core/telemetry/transport/http.rb +2 -2
- data/lib/datadog/core/telemetry/worker.rb +1 -1
- data/lib/datadog/core/transport/http/adapters/net.rb +1 -1
- data/lib/datadog/core/transport/http/adapters/unix_socket.rb +1 -1
- data/lib/datadog/core/transport/http/builder.rb +1 -1
- data/lib/datadog/core/transport/http.rb +3 -3
- data/lib/datadog/core/utils/at_fork_monkey_patch.rb +2 -2
- data/lib/datadog/core/workers/async.rb +1 -1
- data/lib/datadog/core/workers/runtime_metrics.rb +2 -2
- data/lib/datadog/data_streams/pathway_context.rb +1 -1
- data/lib/datadog/data_streams/processor.rb +48 -27
- data/lib/datadog/data_streams/transport/http.rb +1 -1
- data/lib/datadog/data_streams.rb +16 -0
- data/lib/datadog/di/capture_expression_evaluator.rb +48 -11
- data/lib/datadog/di/component.rb +73 -2
- data/lib/datadog/di/configuration.rb +19 -0
- data/lib/datadog/di/contrib/active_record.rb +1 -1
- data/lib/datadog/di/el/compiler.rb +4 -4
- data/lib/datadog/di/el/evaluator.rb +247 -43
- data/lib/datadog/di/el/expression.rb +36 -6
- data/lib/datadog/di/error.rb +16 -0
- data/lib/datadog/di/guardrails_telemetry/reason.rb +3 -2
- data/lib/datadog/di/instrumenter.rb +39 -10
- data/lib/datadog/di/probe_notification_builder.rb +58 -10
- data/lib/datadog/di/probe_notifier_worker.rb +1 -1
- data/lib/datadog/di/remote.rb +46 -2
- data/lib/datadog/di/serializer.rb +47 -13
- data/lib/datadog/di.rb +27 -0
- data/lib/datadog/error_tracking/component.rb +1 -1
- data/lib/datadog/error_tracking/configuration.rb +1 -1
- data/lib/datadog/kit/appsec/events/v2.rb +6 -6
- data/lib/datadog/kit/appsec/events.rb +1 -1
- data/lib/datadog/kit/enable_core_dumps.rb +1 -1
- data/lib/datadog/kit/identity.rb +1 -1
- data/lib/datadog/open_feature/activation.rb +26 -1
- data/lib/datadog/open_feature/agentless/configuration_source.rb +94 -15
- data/lib/datadog/open_feature/component.rb +22 -2
- data/lib/datadog/open_feature/configuration/agentless_endpoint.rb +6 -0
- data/lib/datadog/open_feature/configuration.rb +10 -4
- data/lib/datadog/open_feature/evaluation_engine.rb +62 -4
- data/lib/datadog/open_feature/exposures/buffer.rb +4 -0
- data/lib/datadog/open_feature/exposures/reporter.rb +17 -4
- data/lib/datadog/open_feature/exposures/worker.rb +37 -6
- data/lib/datadog/open_feature/flag_evaluation/aggregator.rb +5 -5
- data/lib/datadog/open_feature/flag_evaluation/writer.rb +1 -1
- data/lib/datadog/open_feature/hooks/debug_logging_hook.rb +56 -0
- data/lib/datadog/open_feature/hooks/evaluation_telemetry_opt_out_hook.rb +25 -0
- data/lib/datadog/open_feature/hooks/span_enrichment_hook.rb +2 -2
- data/lib/datadog/open_feature/metrics/flag_eval_metrics.rb +1 -1
- data/lib/datadog/open_feature/native_evaluator.rb +1 -1
- data/lib/datadog/open_feature/noop_evaluator.rb +1 -1
- data/lib/datadog/open_feature/provider.rb +69 -12
- data/lib/datadog/open_feature/remote.rb +8 -1
- data/lib/datadog/open_feature/resolution_details.rb +2 -2
- data/lib/datadog/open_feature/transport.rb +6 -6
- data/lib/datadog/opentelemetry/api/context.rb +3 -3
- data/lib/datadog/opentelemetry/logs.rb +5 -5
- data/lib/datadog/opentelemetry/metrics.rb +3 -3
- data/lib/datadog/opentelemetry/sdk/propagator.rb +3 -3
- data/lib/datadog/opentelemetry/sdk/span_processor.rb +2 -2
- data/lib/datadog/opentelemetry/sdk/trace/span.rb +1 -1
- data/lib/datadog/profiling/collectors/code_provenance.rb +3 -3
- data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +4 -4
- data/lib/datadog/profiling/collectors/idle_sampling_helper.rb +1 -1
- data/lib/datadog/profiling/collectors/info.rb +37 -6
- data/lib/datadog/profiling/collectors/thread_context.rb +1 -1
- data/lib/datadog/profiling/component.rb +41 -39
- data/lib/datadog/profiling/exporter.rb +4 -6
- data/lib/datadog/profiling/http_transport.rb +3 -3
- data/lib/datadog/profiling/profiler.rb +2 -2
- data/lib/datadog/profiling/scheduler.rb +2 -2
- data/lib/datadog/profiling/tag_builder.rb +1 -1
- data/lib/datadog/symbol_database/extractor.rb +8 -8
- data/lib/datadog/symbol_database/uploader.rb +1 -1
- data/lib/datadog/tracing/buffer.rb +3 -3
- data/lib/datadog/tracing/client_ip.rb +1 -1
- data/lib/datadog/tracing/component.rb +15 -10
- data/lib/datadog/tracing/configuration/dynamic/option.rb +2 -2
- data/lib/datadog/tracing/configuration/ext.rb +2 -0
- data/lib/datadog/tracing/configuration/settings.rb +14 -3
- data/lib/datadog/tracing/context.rb +1 -1
- data/lib/datadog/tracing/context_provider.rb +8 -0
- data/lib/datadog/tracing/contrib/action_cable/instrumentation.rb +2 -2
- data/lib/datadog/tracing/contrib/active_job/data_streams.rb +27 -2
- data/lib/datadog/tracing/contrib/active_record/configuration/resolver.rb +2 -2
- data/lib/datadog/tracing/contrib/active_record/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/active_record/utils.rb +1 -1
- data/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +1 -1
- data/lib/datadog/tracing/contrib/active_support/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb +2 -2
- data/lib/datadog/tracing/contrib/active_support/notifications/subscription.rb +2 -2
- data/lib/datadog/tracing/contrib/aws/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/aws/instrumentation.rb +1 -1
- data/lib/datadog/tracing/contrib/dalli/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/dalli/instrumentation.rb +1 -1
- data/lib/datadog/tracing/contrib/delayed_job/plugin.rb +2 -2
- data/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/elasticsearch/patcher.rb +3 -3
- data/lib/datadog/tracing/contrib/ethon/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/ethon/easy_patch.rb +17 -12
- data/lib/datadog/tracing/contrib/ethon/multi_patch.rb +1 -1
- data/lib/datadog/tracing/contrib/excon/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/excon/middleware.rb +16 -9
- data/lib/datadog/tracing/contrib/faraday/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/faraday/middleware.rb +14 -8
- data/lib/datadog/tracing/contrib/grape/endpoint.rb +4 -4
- data/lib/datadog/tracing/contrib/graphql/patcher.rb +1 -1
- data/lib/datadog/tracing/contrib/graphql/unified_trace.rb +3 -3
- data/lib/datadog/tracing/contrib/grpc/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb +2 -2
- data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb +1 -1
- data/lib/datadog/tracing/contrib/grpc.rb +1 -1
- data/lib/datadog/tracing/contrib/hanami/action_tracer.rb +1 -1
- data/lib/datadog/tracing/contrib/hanami/plugin.rb +1 -1
- data/lib/datadog/tracing/contrib/hanami/renderer_policy_tracing.rb +1 -1
- data/lib/datadog/tracing/contrib/hanami/router_tracing.rb +1 -1
- data/lib/datadog/tracing/contrib/http/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/http/instrumentation.rb +21 -6
- data/lib/datadog/tracing/contrib/http.rb +1 -1
- data/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/httpclient/instrumentation.rb +14 -8
- data/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/httprb/instrumentation.rb +14 -8
- data/lib/datadog/tracing/contrib/kafka/instrumentation/consumer.rb +2 -2
- data/lib/datadog/tracing/contrib/kafka/instrumentation/producer.rb +2 -2
- data/lib/datadog/tracing/contrib/karafka/monitor.rb +1 -1
- data/lib/datadog/tracing/contrib/karafka/patcher.rb +1 -1
- data/lib/datadog/tracing/contrib/karafka.rb +1 -1
- data/lib/datadog/tracing/contrib/lograge/patcher.rb +1 -1
- data/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/mongodb/parsers.rb +1 -1
- data/lib/datadog/tracing/contrib/mongodb/subscribers.rb +1 -1
- data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +3 -3
- data/lib/datadog/tracing/contrib/opensearch/configuration/settings.rb +2 -2
- data/lib/datadog/tracing/contrib/opensearch/patcher.rb +3 -3
- data/lib/datadog/tracing/contrib/pg/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/pg/instrumentation.rb +4 -4
- data/lib/datadog/tracing/contrib/presto/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/presto/instrumentation.rb +4 -4
- data/lib/datadog/tracing/contrib/propagation/sql_comment.rb +1 -1
- data/lib/datadog/tracing/contrib/que/tracer.rb +1 -1
- data/lib/datadog/tracing/contrib/racecar/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/racecar/events/batch.rb +1 -1
- data/lib/datadog/tracing/contrib/racecar/events/message.rb +1 -1
- data/lib/datadog/tracing/contrib/rack/middlewares.rb +3 -3
- data/lib/datadog/tracing/contrib/rack/patcher.rb +1 -1
- data/lib/datadog/tracing/contrib/rails/framework.rb +7 -7
- data/lib/datadog/tracing/contrib/rails/log_injection.rb +1 -1
- data/lib/datadog/tracing/contrib/rails/runner.rb +4 -4
- data/lib/datadog/tracing/contrib/redis/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/redis/quantize.rb +1 -1
- data/lib/datadog/tracing/contrib/redis/tags.rb +1 -1
- data/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/rest_client/request_patch.rb +17 -10
- data/lib/datadog/tracing/contrib/sequel/database.rb +1 -1
- data/lib/datadog/tracing/contrib/sequel/dataset.rb +1 -1
- data/lib/datadog/tracing/contrib/shoryuken/tracer.rb +1 -1
- data/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb +2 -2
- data/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb +2 -2
- data/lib/datadog/tracing/contrib/sidekiq.rb +1 -1
- data/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +1 -1
- data/lib/datadog/tracing/contrib/status_range_env_parser.rb +1 -1
- data/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb +1 -1
- data/lib/datadog/tracing/contrib/trilogy/configuration/settings.rb +1 -1
- data/lib/datadog/tracing/contrib/trilogy/instrumentation.rb +3 -3
- data/lib/datadog/tracing/contrib/utils/quantization/http.rb +102 -0
- data/lib/datadog/tracing/contrib/waterdrop/middleware.rb +2 -2
- data/lib/datadog/tracing/contrib/waterdrop.rb +1 -1
- data/lib/datadog/tracing/diagnostics/environment_logger.rb +1 -1
- data/lib/datadog/tracing/distributed/b3_multi.rb +1 -1
- data/lib/datadog/tracing/distributed/b3_single.rb +1 -1
- data/lib/datadog/tracing/distributed/baggage.rb +3 -3
- data/lib/datadog/tracing/distributed/datadog.rb +3 -3
- data/lib/datadog/tracing/distributed/propagation.rb +7 -7
- data/lib/datadog/tracing/distributed/trace_context.rb +1 -1
- data/lib/datadog/tracing/distributed/trace_state/open_telemetry.rb +1 -1
- data/lib/datadog/tracing/otel_thread_context.rb +3 -3
- data/lib/datadog/tracing/pipeline.rb +1 -1
- data/lib/datadog/tracing/remote.rb +50 -19
- data/lib/datadog/tracing/sampling/priority_sampler.rb +1 -1
- data/lib/datadog/tracing/sampling/rule.rb +1 -1
- data/lib/datadog/tracing/sampling/rule_sampler.rb +1 -1
- data/lib/datadog/tracing/sampling/span/rule_parser.rb +2 -2
- data/lib/datadog/tracing/span_operation.rb +1 -1
- data/lib/datadog/tracing/trace_digest.rb +1 -1
- data/lib/datadog/tracing/trace_operation.rb +6 -6
- data/lib/datadog/tracing/tracer.rb +6 -6
- data/lib/datadog/tracing/transport/http/telemetry.rb +1 -1
- data/lib/datadog/tracing/transport/http.rb +2 -2
- data/lib/datadog/tracing/transport/io.rb +1 -1
- data/lib/datadog/tracing/transport/native.rb +3 -3
- data/lib/datadog/tracing/transport/statistics.rb +2 -2
- data/lib/datadog/tracing/transport/telemetry.rb +3 -1
- data/lib/datadog/tracing/transport/trace_formatter.rb +12 -12
- data/lib/datadog/tracing/transport/traces.rb +1 -1
- data/lib/datadog/tracing/utils.rb +1 -1
- data/lib/datadog/tracing/workers.rb +1 -1
- data/lib/datadog/version.rb +1 -1
- metadata +9 -8
- data/lib/datadog/appsec/utils/hash_coercion.rb +0 -23
|
@@ -38,7 +38,7 @@ module Datadog
|
|
|
38
38
|
Datadog::Tracing::SpanEvent.new(
|
|
39
39
|
event.name,
|
|
40
40
|
attributes: event.attributes,
|
|
41
|
-
time_unix_nano: event.timestamp
|
|
41
|
+
time_unix_nano: event.timestamp,
|
|
42
42
|
)
|
|
43
43
|
end
|
|
44
44
|
end
|
|
@@ -112,7 +112,7 @@ module Datadog
|
|
|
112
112
|
trace_state: tracestate && ::Datadog::Core::Utils.utf8_encode(tracestate, placeholder: nil),
|
|
113
113
|
span_remote: link.span_context.remote?,
|
|
114
114
|
),
|
|
115
|
-
attributes: link.attributes
|
|
115
|
+
attributes: link.attributes,
|
|
116
116
|
)
|
|
117
117
|
end
|
|
118
118
|
end
|
|
@@ -34,7 +34,7 @@ module Datadog
|
|
|
34
34
|
version: RUBY_VERSION,
|
|
35
35
|
path: standard_library_path,
|
|
36
36
|
extra_paths: [ruby_native_filename],
|
|
37
|
-
)
|
|
37
|
+
),
|
|
38
38
|
)
|
|
39
39
|
end
|
|
40
40
|
|
|
@@ -104,7 +104,7 @@ module Datadog
|
|
|
104
104
|
version: spec.version,
|
|
105
105
|
path: spec.gem_dir,
|
|
106
106
|
extra_paths: extra_paths,
|
|
107
|
-
)
|
|
107
|
+
),
|
|
108
108
|
)
|
|
109
109
|
recorded_library = true
|
|
110
110
|
end
|
|
@@ -146,7 +146,7 @@ module Datadog
|
|
|
146
146
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
|
147
147
|
Datadog.logger.debug(
|
|
148
148
|
"CodeProvenance#bundler_bin_path failed. " \
|
|
149
|
-
"Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}"
|
|
149
|
+
"Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}",
|
|
150
150
|
)
|
|
151
151
|
nil
|
|
152
152
|
end
|
|
@@ -55,10 +55,10 @@ module Datadog
|
|
|
55
55
|
)
|
|
56
56
|
unless dynamic_sampling_rate_enabled
|
|
57
57
|
Datadog.logger.warn(
|
|
58
|
-
"Profiling dynamic sampling rate disabled. This should only be used for testing, and will increase overhead!"
|
|
58
|
+
"Profiling dynamic sampling rate disabled. This should only be used for testing, and will increase overhead!",
|
|
59
59
|
)
|
|
60
60
|
Datadog::Core::Telemetry::Logger.error(
|
|
61
|
-
"Profiling dynamic sampling rate disabled. This should only be used for testing, and will increase overhead!"
|
|
61
|
+
"Profiling dynamic sampling rate disabled. This should only be used for testing, and will increase overhead!",
|
|
62
62
|
)
|
|
63
63
|
end
|
|
64
64
|
|
|
@@ -110,7 +110,7 @@ module Datadog
|
|
|
110
110
|
@failure_exception = e
|
|
111
111
|
Datadog.logger.warn(
|
|
112
112
|
"Profiling was not started as another profiler or gem is already using the SIGPROF signal. " \
|
|
113
|
-
"Please disable the other profiler to use Datadog profiling."
|
|
113
|
+
"Please disable the other profiler to use Datadog profiling.",
|
|
114
114
|
)
|
|
115
115
|
on_failure_proc&.call(log_failure: false)
|
|
116
116
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
|
@@ -118,7 +118,7 @@ module Datadog
|
|
|
118
118
|
operation_name = self.class._native_failure_exception_during_operation(self).inspect
|
|
119
119
|
Datadog.logger.warn(
|
|
120
120
|
"CpuAndWallTimeWorker thread error. " \
|
|
121
|
-
"Operation: #{operation_name} Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}"
|
|
121
|
+
"Operation: #{operation_name} Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}",
|
|
122
122
|
)
|
|
123
123
|
on_failure_proc&.call
|
|
124
124
|
Datadog::Core::Telemetry::Logger.report(e, description: "CpuAndWallTimeWorker thread error: #{operation_name}")
|
|
@@ -44,7 +44,7 @@ module Datadog
|
|
|
44
44
|
@failure_exception = e
|
|
45
45
|
Datadog.logger.warn(
|
|
46
46
|
"IdleSamplingHelper thread error. " \
|
|
47
|
-
"Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}"
|
|
47
|
+
"Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}",
|
|
48
48
|
)
|
|
49
49
|
Datadog::Core::Telemetry::Logger.report(e, description: "IdleSamplingHelper thread error")
|
|
50
50
|
end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "json"
|
|
3
4
|
require "libdatadog"
|
|
4
5
|
require_relative "../../core/utils/time"
|
|
5
6
|
|
|
@@ -9,11 +10,11 @@ module Datadog
|
|
|
9
10
|
# Collects information of relevance for profiler. This will get sent alongside
|
|
10
11
|
# the profile and show up in the UI or potentially influence processing in some way.
|
|
11
12
|
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
# gathering and easily support more flexible/dynamic info collection in the future.
|
|
13
|
+
# Most information is static: collected and frozen at construction time. The exception is
|
|
14
|
+
# what `collect_dynamic_info` collects, which can change during the process lifetime.
|
|
15
15
|
class Info
|
|
16
|
-
# @rbs @
|
|
16
|
+
# @rbs @static_info: ::Hash[::Symbol, ::Hash[::Symbol, untyped]]
|
|
17
|
+
# @rbs @info_json_cache: [::Hash[::Symbol, bool], ::String]?
|
|
17
18
|
# @rbs @platform_info: ::Hash[::Symbol, untyped]
|
|
18
19
|
# @rbs @runtime_info: ::Hash[::Symbol, untyped]
|
|
19
20
|
# @rbs @application_info: ::Hash[::Symbol, untyped]
|
|
@@ -24,18 +25,48 @@ module Datadog
|
|
|
24
25
|
def initialize(settings)
|
|
25
26
|
@profiler_info = nil
|
|
26
27
|
|
|
27
|
-
@
|
|
28
|
+
@static_info = {
|
|
28
29
|
platform: collect_platform_info,
|
|
29
30
|
runtime: collect_runtime_info,
|
|
30
31
|
application: collect_application_info(settings),
|
|
31
32
|
profiler: collect_profiler_info(settings),
|
|
32
33
|
}.freeze
|
|
34
|
+
@info_json_cache = nil
|
|
33
35
|
end
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
#: () -> ::Hash[::Symbol, ::Hash[::Symbol, untyped]]
|
|
38
|
+
def info
|
|
39
|
+
build_info(collect_dynamic_info)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Serializing the same info on every flush would be wasteful, so the latest result is
|
|
43
|
+
# cached and reused for as long as the dynamic info is unchanged.
|
|
44
|
+
#: () -> ::String
|
|
45
|
+
def info_json
|
|
46
|
+
dynamic_info = collect_dynamic_info
|
|
47
|
+
cached_dynamic_info, cached_json = @info_json_cache
|
|
48
|
+
return cached_json if cached_json && cached_dynamic_info == dynamic_info
|
|
49
|
+
|
|
50
|
+
json = JSON.generate(build_info(dynamic_info)).freeze
|
|
51
|
+
@info_json_cache = [dynamic_info, json].freeze #: [::Hash[::Symbol, bool], ::String]
|
|
52
|
+
json
|
|
53
|
+
end
|
|
36
54
|
|
|
37
55
|
private
|
|
38
56
|
|
|
57
|
+
#: (::Hash[::Symbol, bool]) -> ::Hash[::Symbol, ::Hash[::Symbol, untyped]]
|
|
58
|
+
def build_info(dynamic_info)
|
|
59
|
+
@static_info.merge(runtime: @static_info.fetch(:runtime).merge(dynamic_info))
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
#: () -> ::Hash[::Symbol, bool]
|
|
63
|
+
def collect_dynamic_info
|
|
64
|
+
{
|
|
65
|
+
yjit_enabled: defined?(::RubyVM::YJIT) ? ::RubyVM::YJIT.enabled? : false,
|
|
66
|
+
zjit_enabled: defined?(::RubyVM::ZJIT) ? ::RubyVM::ZJIT.enabled? : false,
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
39
70
|
# Ruby GC tuning environment variables
|
|
40
71
|
RUBY_GC_TUNING_ENV_VARS = [
|
|
41
72
|
"RUBY_GC_HEAP_FREE_SLOTS",
|
|
@@ -145,14 +145,14 @@ module Datadog
|
|
|
145
145
|
RubyVersion.is?(">= 3.2", "< 3.2.3")
|
|
146
146
|
logger.warn(
|
|
147
147
|
"Current Ruby version (#{RUBY_VERSION}) has a VM bug where enabling GC profiling would cause " \
|
|
148
|
-
"crashes (https://bugs.ruby-lang.org/issues/18464). GC profiling has been disabled."
|
|
148
|
+
"crashes (https://bugs.ruby-lang.org/issues/18464). GC profiling has been disabled.",
|
|
149
149
|
)
|
|
150
150
|
return false
|
|
151
151
|
elsif RubyVersion.is?(">= 3", "< 4")
|
|
152
152
|
logger.debug(
|
|
153
153
|
"Using Ractors may result in GC profiling unexpectedly " \
|
|
154
154
|
"stopping (https://bugs.ruby-lang.org/issues/19112). Note that this stop has no impact in your " \
|
|
155
|
-
"application stability or performance. This issue is fixed on Ruby 4."
|
|
155
|
+
"application stability or performance. This issue is fixed on Ruby 4.",
|
|
156
156
|
)
|
|
157
157
|
end
|
|
158
158
|
|
|
@@ -180,7 +180,7 @@ module Datadog
|
|
|
180
180
|
logger.warn(
|
|
181
181
|
"Allocation profiling is not supported in Ruby versions 3.2.0, 3.2.1 and 3.2.2 and will be forcibly " \
|
|
182
182
|
"disabled. This is due to a VM bug that can lead to crashes (https://bugs.ruby-lang.org/issues/19482). " \
|
|
183
|
-
"Other Ruby versions do not suffer from this issue."
|
|
183
|
+
"Other Ruby versions do not suffer from this issue.",
|
|
184
184
|
)
|
|
185
185
|
return false
|
|
186
186
|
end
|
|
@@ -195,7 +195,7 @@ module Datadog
|
|
|
195
195
|
logger.warn(
|
|
196
196
|
"Current Ruby version (#{RUBY_VERSION}) has a VM bug where enabling allocation profiling while using " \
|
|
197
197
|
"Ractors may cause unexpected issues, including crashes (https://bugs.ruby-lang.org/issues/18464). " \
|
|
198
|
-
"This does not happen if Ractors are not used."
|
|
198
|
+
"This does not happen if Ractors are not used.",
|
|
199
199
|
)
|
|
200
200
|
# ANNOYANCE - Only with Ractors
|
|
201
201
|
# On all known versions of Ruby 3.x, due to https://bugs.ruby-lang.org/issues/19112, when a ractor gets
|
|
@@ -204,7 +204,7 @@ module Datadog
|
|
|
204
204
|
logger.debug(
|
|
205
205
|
"Using Ractors may result in allocation profiling " \
|
|
206
206
|
"stopping (https://bugs.ruby-lang.org/issues/19112). Note that this stop has no impact in your " \
|
|
207
|
-
"application stability or performance. This issue is fixed on Ruby 4."
|
|
207
|
+
"application stability or performance. This issue is fixed on Ruby 4.",
|
|
208
208
|
)
|
|
209
209
|
end
|
|
210
210
|
|
|
@@ -221,7 +221,7 @@ module Datadog
|
|
|
221
221
|
if RubyVersion.is?("< 3.1")
|
|
222
222
|
logger.warn(
|
|
223
223
|
"Current Ruby version (#{RUBY_VERSION}) cannot support heap profiling due to VM limitations. " \
|
|
224
|
-
"Please upgrade to Ruby >= 3.1 in order to use this feature. Heap profiling has been disabled."
|
|
224
|
+
"Please upgrade to Ruby >= 3.1 in order to use this feature. Heap profiling has been disabled.",
|
|
225
225
|
)
|
|
226
226
|
return false
|
|
227
227
|
end
|
|
@@ -232,7 +232,7 @@ module Datadog
|
|
|
232
232
|
logger.warn(
|
|
233
233
|
"Current Ruby version (#{RUBY_VERSION}) cannot support heap profiling due to a VM bug. " \
|
|
234
234
|
"Please upgrade to Ruby >= 3.1.4 or >= 3.2.3 in order to use this feature. " \
|
|
235
|
-
"Heap profiling has been disabled."
|
|
235
|
+
"Heap profiling has been disabled.",
|
|
236
236
|
)
|
|
237
237
|
return false
|
|
238
238
|
end
|
|
@@ -240,7 +240,7 @@ module Datadog
|
|
|
240
240
|
unless allocation_profiling_enabled
|
|
241
241
|
logger.warn(
|
|
242
242
|
"Heap profiling was requested but allocation profiling is not enabled. " \
|
|
243
|
-
"Heap profiling has been disabled."
|
|
243
|
+
"Heap profiling has been disabled.",
|
|
244
244
|
)
|
|
245
245
|
return false
|
|
246
246
|
end
|
|
@@ -262,7 +262,7 @@ module Datadog
|
|
|
262
262
|
unless [true, false, :auto].include?(setting_value)
|
|
263
263
|
logger.warn(
|
|
264
264
|
"Ignoring invalid value for profiling no_signals_workaround_enabled setting: #{setting_value.inspect}. " \
|
|
265
|
-
"Valid options are `true`, `false` or (default) `:auto`."
|
|
265
|
+
"Valid options are `true`, `false` or (default) `:auto`.",
|
|
266
266
|
)
|
|
267
267
|
|
|
268
268
|
setting_value = :auto
|
|
@@ -275,7 +275,7 @@ module Datadog
|
|
|
275
275
|
"This is not recommended " \
|
|
276
276
|
"in production environments, as due to limitations in Ruby APIs, we suspect it may lead to rare crashes " \
|
|
277
277
|
"Please report any issues you run into to Datadog support or " \
|
|
278
|
-
"via <https://github.com/datadog/dd-trace-rb/issues/new>!"
|
|
278
|
+
"via <https://github.com/datadog/dd-trace-rb/issues/new>!",
|
|
279
279
|
)
|
|
280
280
|
else
|
|
281
281
|
logger.warn('Profiling "no signals" workaround disabled via configuration')
|
|
@@ -286,7 +286,7 @@ module Datadog
|
|
|
286
286
|
|
|
287
287
|
if setting_value == true
|
|
288
288
|
logger.warn(
|
|
289
|
-
'Profiling "no signals" workaround enabled via configuration. Profiling data will have lower quality.'
|
|
289
|
+
'Profiling "no signals" workaround enabled via configuration. Profiling data will have lower quality.',
|
|
290
290
|
)
|
|
291
291
|
|
|
292
292
|
return true
|
|
@@ -301,7 +301,7 @@ module Datadog
|
|
|
301
301
|
logger.warn(
|
|
302
302
|
'Enabling the profiling "no signals" workaround because an incompatible version of the mysql2 gem is ' \
|
|
303
303
|
"installed. Profiling data will have lower quality. " \
|
|
304
|
-
"To fix this, upgrade the libmysqlclient in your OS image to version 8.0.0 or above."
|
|
304
|
+
"To fix this, upgrade the libmysqlclient in your OS image to version 8.0.0 or above.",
|
|
305
305
|
)
|
|
306
306
|
return true
|
|
307
307
|
end
|
|
@@ -311,7 +311,7 @@ module Datadog
|
|
|
311
311
|
'Enabling the profiling "no signals" workaround because the rugged gem is installed. ' \
|
|
312
312
|
"This is needed because some operations on this gem are currently incompatible with the normal working mode " \
|
|
313
313
|
"of the profiler, as detailed in <https://github.com/datadog/dd-trace-rb/issues/2721>. " \
|
|
314
|
-
"Profiling data will have lower quality."
|
|
314
|
+
"Profiling data will have lower quality.",
|
|
315
315
|
)
|
|
316
316
|
return true
|
|
317
317
|
end
|
|
@@ -320,7 +320,7 @@ module Datadog
|
|
|
320
320
|
logger.warn(
|
|
321
321
|
'Enabling the profiling "no signals" workaround because an incompatible version of the passenger gem is ' \
|
|
322
322
|
"installed. Profiling data will have lower quality." \
|
|
323
|
-
"To fix this, upgrade the passenger gem to version 6.0.19 or above."
|
|
323
|
+
"To fix this, upgrade the passenger gem to version 6.0.19 or above.",
|
|
324
324
|
)
|
|
325
325
|
return true
|
|
326
326
|
end
|
|
@@ -341,7 +341,7 @@ module Datadog
|
|
|
341
341
|
return true if settings.profiling.advanced.skip_mysql2_check
|
|
342
342
|
|
|
343
343
|
logger.debug(
|
|
344
|
-
"Requiring `mysql2` to check if the `libmysqlclient` version it uses is compatible with profiling"
|
|
344
|
+
"Requiring `mysql2` to check if the `libmysqlclient` version it uses is compatible with profiling",
|
|
345
345
|
)
|
|
346
346
|
|
|
347
347
|
begin
|
|
@@ -371,14 +371,14 @@ module Datadog
|
|
|
371
371
|
|
|
372
372
|
logger.debug(
|
|
373
373
|
"The `mysql2` gem is using #{compatible ? "a compatible" : "an incompatible"} version of " \
|
|
374
|
-
"the `libmysqlclient` library (#{libmysqlclient_version})"
|
|
374
|
+
"the `libmysqlclient` library (#{libmysqlclient_version})",
|
|
375
375
|
)
|
|
376
376
|
|
|
377
377
|
!compatible
|
|
378
378
|
rescue StandardError, LoadError => e
|
|
379
379
|
logger.warn(
|
|
380
380
|
"Failed to probe `mysql2` gem information. " \
|
|
381
|
-
"Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}"
|
|
381
|
+
"Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}",
|
|
382
382
|
)
|
|
383
383
|
|
|
384
384
|
true
|
|
@@ -404,7 +404,7 @@ module Datadog
|
|
|
404
404
|
else
|
|
405
405
|
logger.warn(
|
|
406
406
|
"Ignoring invalid value for profiling overhead_target_percentage setting: " \
|
|
407
|
-
"#{overhead_target_percentage.inspect}. Falling back to default value."
|
|
407
|
+
"#{overhead_target_percentage.inspect}. Falling back to default value.",
|
|
408
408
|
)
|
|
409
409
|
|
|
410
410
|
2.0
|
|
@@ -416,7 +416,7 @@ module Datadog
|
|
|
416
416
|
logger.warn(
|
|
417
417
|
"Profiling cpu_sampling_interval_ms is set to #{cpu_sampling_interval_ms}ms, but values above 10ms are " \
|
|
418
418
|
"not supported. Using 10ms instead. To reduce profiler overhead, consider adjusting the " \
|
|
419
|
-
"overhead_target_percentage setting."
|
|
419
|
+
"overhead_target_percentage setting.",
|
|
420
420
|
)
|
|
421
421
|
10
|
|
422
422
|
elsif cpu_sampling_interval_ms < 10
|
|
@@ -427,33 +427,35 @@ module Datadog
|
|
|
427
427
|
end
|
|
428
428
|
end
|
|
429
429
|
|
|
430
|
-
#
|
|
431
|
-
#
|
|
432
|
-
# incompatible. In fact we have no reports of the mariadb variant needing the "no signals" workaround,
|
|
433
|
-
# so we flag it as compatible when it's in use.
|
|
430
|
+
# MariaDB's client has diverged from Oracle's and has no reported need for the "no signals" workaround, as
|
|
431
|
+
# reported in https://github.com/DataDog/dd-trace-rb/issues/3334, so we flag it as compatible when it's in use.
|
|
434
432
|
#
|
|
435
|
-
#
|
|
436
|
-
#
|
|
433
|
+
# There's no way to ask the mysql2 gem which client it was built against, so we infer it from the two versions
|
|
434
|
+
# that `Mysql2::Client.info` exposes:
|
|
437
435
|
#
|
|
438
|
-
#
|
|
439
|
-
#
|
|
436
|
+
# * `version` is `mysql_get_client_info()`. For MariaDB that's the version of
|
|
437
|
+
# https://github.com/mariadb-corporation/mariadb-connector-c, which is still 3.x.
|
|
438
|
+
# * `header_version` is a constant baked in when mysql2 was compiled. Up to mysql2 0.5.6 it was the MariaDB
|
|
439
|
+
# server version, which is what people usually call "the mariadb version"; 0.5.7 switched it to the
|
|
440
|
+
# Connector/C version (https://github.com/brianmario/mysql2/pull/1406) and that broke our detection, as
|
|
441
|
+
# reported in https://github.com/DataDog/dd-trace-rb/issues/6536.
|
|
440
442
|
#
|
|
441
|
-
#
|
|
442
|
-
#
|
|
443
|
-
#
|
|
443
|
+
# So MariaDB shows up as `{version: "3.3.8", header_version: "11.2.2"}` with mysql2 < 0.5.7 and as
|
|
444
|
+
# `{version: "3.4.9", header_version: "3.4.9"}` from 0.5.7 on. We accept both shapes: a header that is a server
|
|
445
|
+
# version (10 or newer, a sane range for modern releases per https://endoflife.date/mariadb) or one that is a
|
|
446
|
+
# Connector/C version (3.x, matching the client version).
|
|
444
447
|
#
|
|
445
|
-
#
|
|
446
|
-
#
|
|
447
|
-
#
|
|
448
|
-
# Thus our detection is version 4 or older, because libmysqlclient 4 is almost 20 years old so it's most probably
|
|
449
|
-
# not that one + header_version being 10 or newer, since according to https://endoflife.date/mariadb that's a
|
|
450
|
-
# sane range for modern mariadb releases.
|
|
448
|
+
# Oracle's client repeats one version in both fields (`{version: "8.0.35", header_version: "8.0.35"}`), and our
|
|
449
|
+
# caller already considers 8.0.0 and above compatible, so only a client older than 5.0.0 gets this far -- and
|
|
450
|
+
# no Oracle release has been one since libmysqlclient 4.1, which is from 2004.
|
|
451
451
|
private_class_method def self.looks_like_mariadb?(info, libmysqlclient_version)
|
|
452
452
|
header_version = Gem::Version.new(info[:header_version]) if info[:header_version]
|
|
453
453
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
454
|
+
return false unless header_version && libmysqlclient_version < Gem::Version.new("5.0.0")
|
|
455
|
+
return true if header_version >= Gem::Version.new("10.0.0")
|
|
456
|
+
|
|
457
|
+
connector_c_versions = Gem::Requirement.new(">= 3.0.0", "< 4.0.0")
|
|
458
|
+
connector_c_versions.satisfied_by?(libmysqlclient_version) && connector_c_versions.satisfied_by?(header_version)
|
|
457
459
|
end
|
|
458
460
|
|
|
459
461
|
private_class_method def self.dir_interruption_workaround_enabled?(settings, no_signals_workaround_enabled)
|
|
@@ -27,7 +27,7 @@ module Datadog
|
|
|
27
27
|
attr_reader :last_flush_finish_at #: ::Time?
|
|
28
28
|
attr_reader :created_at #: ::Time
|
|
29
29
|
attr_reader :internal_metadata #: ::Hash[::Symbol, untyped]
|
|
30
|
-
attr_reader :
|
|
30
|
+
attr_reader :info_collector #: Datadog::Profiling::Collectors::Info
|
|
31
31
|
attr_reader :sequence_tracker #: singleton(Datadog::Profiling::SequenceTracker)
|
|
32
32
|
|
|
33
33
|
public
|
|
@@ -56,9 +56,7 @@ module Datadog
|
|
|
56
56
|
@last_flush_finish_at = nil
|
|
57
57
|
@created_at = time_provider.now.utc
|
|
58
58
|
@internal_metadata = internal_metadata
|
|
59
|
-
|
|
60
|
-
# it on startup to prevent serializing the same info on every flush.
|
|
61
|
-
@info_json = JSON.generate(info_collector.info).freeze
|
|
59
|
+
@info_collector = info_collector
|
|
62
60
|
@sequence_tracker = sequence_tracker
|
|
63
61
|
end
|
|
64
62
|
|
|
@@ -109,9 +107,9 @@ module Datadog
|
|
|
109
107
|
profile_stats: profile_stats,
|
|
110
108
|
recorder_stats: pprof_recorder.stats,
|
|
111
109
|
gc: gc_stats,
|
|
112
|
-
}
|
|
110
|
+
},
|
|
113
111
|
),
|
|
114
|
-
info_json: info_json,
|
|
112
|
+
info_json: info_collector.info_json,
|
|
115
113
|
)
|
|
116
114
|
end
|
|
117
115
|
|
|
@@ -40,7 +40,7 @@ module Datadog
|
|
|
40
40
|
def export(flush)
|
|
41
41
|
status, result = self.class._native_do_export(
|
|
42
42
|
exporter_configuration,
|
|
43
|
-
flush
|
|
43
|
+
flush,
|
|
44
44
|
)
|
|
45
45
|
|
|
46
46
|
if status == :ok
|
|
@@ -50,10 +50,10 @@ module Datadog
|
|
|
50
50
|
else
|
|
51
51
|
Datadog.logger.warn(
|
|
52
52
|
"Failed to report profiling data (#{config_without_api_key}): " \
|
|
53
|
-
"server returned unexpected HTTP #{result} status code"
|
|
53
|
+
"server returned unexpected HTTP #{result} status code",
|
|
54
54
|
)
|
|
55
55
|
Datadog::Core::Telemetry::Logger.error(
|
|
56
|
-
"Failed to report profiling data: unexpected HTTP #{result} status code"
|
|
56
|
+
"Failed to report profiling data: unexpected HTTP #{result} status code",
|
|
57
57
|
)
|
|
58
58
|
false
|
|
59
59
|
end
|
|
@@ -32,7 +32,7 @@ module Datadog
|
|
|
32
32
|
on_failure_proc: ->(log_failure: true) do
|
|
33
33
|
# @type var log_failure: bool
|
|
34
34
|
component_failed(:worker, log_failure: log_failure)
|
|
35
|
-
end
|
|
35
|
+
end,
|
|
36
36
|
)
|
|
37
37
|
scheduler.start(on_failure_proc: proc { component_failed(:scheduler) })
|
|
38
38
|
end
|
|
@@ -67,7 +67,7 @@ module Datadog
|
|
|
67
67
|
if log_failure
|
|
68
68
|
Datadog.logger.warn(
|
|
69
69
|
"Detected issue with profiler (#{failed_component} component), stopping profiling. " \
|
|
70
|
-
"See previous log messages for details."
|
|
70
|
+
"See previous log messages for details.",
|
|
71
71
|
)
|
|
72
72
|
Datadog::Core::Telemetry::Logger
|
|
73
73
|
.error("Detected issue with profiler (#{failed_component} component), stopping profiling")
|
|
@@ -65,7 +65,7 @@ module Datadog
|
|
|
65
65
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
|
66
66
|
Datadog.logger.warn(
|
|
67
67
|
"Profiling::Scheduler thread error. " \
|
|
68
|
-
"Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}"
|
|
68
|
+
"Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}",
|
|
69
69
|
)
|
|
70
70
|
on_failure_proc&.call
|
|
71
71
|
Datadog::Core::Telemetry::Logger.report(e, description: "Profiling::Scheduler thread error")
|
|
@@ -136,7 +136,7 @@ module Datadog
|
|
|
136
136
|
transport.export(flush)
|
|
137
137
|
rescue => e
|
|
138
138
|
Datadog.logger.warn(
|
|
139
|
-
"Unable to report profile. Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}"
|
|
139
|
+
"Unable to report profile. Cause: #{e.class}: #{e.message} Location: #{Array(e.backtrace).first}",
|
|
140
140
|
)
|
|
141
141
|
Datadog::Core::Telemetry::Logger.report(e, description: "Unable to report profile")
|
|
142
142
|
end
|
|
@@ -491,7 +491,7 @@ module Datadog
|
|
|
491
491
|
start_line: UNKNOWN_MIN_LINE,
|
|
492
492
|
end_line: UNKNOWN_MAX_LINE,
|
|
493
493
|
language_specifics: lang,
|
|
494
|
-
scopes: inner_scopes
|
|
494
|
+
scopes: inner_scopes,
|
|
495
495
|
)
|
|
496
496
|
end
|
|
497
497
|
|
|
@@ -507,7 +507,7 @@ module Datadog
|
|
|
507
507
|
source_file: source_file,
|
|
508
508
|
start_line: UNKNOWN_MIN_LINE,
|
|
509
509
|
end_line: UNKNOWN_MAX_LINE,
|
|
510
|
-
symbols: extract_scope_symbols(mod)
|
|
510
|
+
symbols: extract_scope_symbols(mod),
|
|
511
511
|
)
|
|
512
512
|
end
|
|
513
513
|
|
|
@@ -527,7 +527,7 @@ module Datadog
|
|
|
527
527
|
end_line: end_line,
|
|
528
528
|
language_specifics: build_class_language_specifics(klass),
|
|
529
529
|
scopes: method_scopes,
|
|
530
|
-
symbols: extract_scope_symbols(klass)
|
|
530
|
+
symbols: extract_scope_symbols(klass),
|
|
531
531
|
)
|
|
532
532
|
end
|
|
533
533
|
|
|
@@ -997,7 +997,7 @@ module Datadog
|
|
|
997
997
|
end_line: end_line,
|
|
998
998
|
language_specifics: lang,
|
|
999
999
|
scopes: method_scopes + child_scopes,
|
|
1000
|
-
symbols: symbols
|
|
1000
|
+
symbols: symbols,
|
|
1001
1001
|
)
|
|
1002
1002
|
end
|
|
1003
1003
|
|
|
@@ -1023,11 +1023,11 @@ module Datadog
|
|
|
1023
1023
|
end_line: end_line,
|
|
1024
1024
|
targetable_lines: targetable_lines,
|
|
1025
1025
|
language_specifics: {
|
|
1026
|
-
visibility: klass ? method_visibility(klass, method_name) : "public",
|
|
1026
|
+
visibility: klass ? method_visibility(klass, method_name) : "public",
|
|
1027
1027
|
method_type: "instance",
|
|
1028
1028
|
arity: method.arity,
|
|
1029
1029
|
},
|
|
1030
|
-
symbols: extract_method_parameters(method)
|
|
1030
|
+
symbols: extract_method_parameters(method),
|
|
1031
1031
|
)
|
|
1032
1032
|
rescue Exception => e # standard:disable Lint/RescueException
|
|
1033
1033
|
Datadog::DI.reraise_if_fatal(e)
|
|
@@ -1049,7 +1049,7 @@ module Datadog
|
|
|
1049
1049
|
symbols << Symbol.new(
|
|
1050
1050
|
symbol_type: "STATIC_FIELD",
|
|
1051
1051
|
name: var_name.to_s,
|
|
1052
|
-
line: UNKNOWN_MIN_LINE
|
|
1052
|
+
line: UNKNOWN_MIN_LINE,
|
|
1053
1053
|
)
|
|
1054
1054
|
end
|
|
1055
1055
|
end
|
|
@@ -1065,7 +1065,7 @@ module Datadog
|
|
|
1065
1065
|
symbol_type: "STATIC_FIELD",
|
|
1066
1066
|
name: const_name.to_s,
|
|
1067
1067
|
line: UNKNOWN_MIN_LINE,
|
|
1068
|
-
type: safe_mod_name(KERNEL_CLASS.bind(const_value).call)
|
|
1068
|
+
type: safe_mod_name(KERNEL_CLASS.bind(const_value).call),
|
|
1069
1069
|
)
|
|
1070
1070
|
rescue NameError, LoadError, NoMethodError, TypeError => e # standard:disable Lint/ShadowedException
|
|
1071
1071
|
# Expected: constant removed/undefined (NameError), autoload failure (LoadError),
|
|
@@ -73,7 +73,7 @@ module Datadog
|
|
|
73
73
|
@telemetry&.distribution(
|
|
74
74
|
Tracing::Ext::TELEMETRY_METRICS_NAMESPACE,
|
|
75
75
|
"symbol_database.payload_size",
|
|
76
|
-
compressed_data.bytesize
|
|
76
|
+
compressed_data.bytesize,
|
|
77
77
|
)
|
|
78
78
|
|
|
79
79
|
# Symbols for very large applications (>50MB after gzip) are dropped:
|
|
@@ -56,7 +56,7 @@ module Datadog
|
|
|
56
56
|
@buffer_spans += trace.length
|
|
57
57
|
rescue => e
|
|
58
58
|
Datadog.logger.debug(
|
|
59
|
-
"Failed to measure queue accept. Cause: #{e.class}: #{e.message} Source: #{Array(e.backtrace).first}"
|
|
59
|
+
"Failed to measure queue accept. Cause: #{e.class}: #{e.message} Source: #{Array(e.backtrace).first}",
|
|
60
60
|
)
|
|
61
61
|
end
|
|
62
62
|
|
|
@@ -66,7 +66,7 @@ module Datadog
|
|
|
66
66
|
@buffer_spans -= trace.length
|
|
67
67
|
rescue => e
|
|
68
68
|
Datadog.logger.debug(
|
|
69
|
-
"Failed to measure queue drop. Cause: #{e.class}: #{e.message} Source: #{Array(e.backtrace).first}"
|
|
69
|
+
"Failed to measure queue drop. Cause: #{e.class}: #{e.message} Source: #{Array(e.backtrace).first}",
|
|
70
70
|
)
|
|
71
71
|
end
|
|
72
72
|
|
|
@@ -91,7 +91,7 @@ module Datadog
|
|
|
91
91
|
@buffer_spans = 0
|
|
92
92
|
rescue => e
|
|
93
93
|
Datadog.logger.debug(
|
|
94
|
-
"Failed to measure queue. Cause: #{e.class}: #{e.message} Source: #{Array(e.backtrace).first}"
|
|
94
|
+
"Failed to measure queue. Cause: #{e.class}: #{e.message} Source: #{Array(e.backtrace).first}",
|
|
95
95
|
)
|
|
96
96
|
end
|
|
97
97
|
end
|
|
@@ -41,7 +41,7 @@ module Datadog
|
|
|
41
41
|
if headers && configuration.header_name
|
|
42
42
|
return Datadog::Core::Utils::Network.stripped_ip_from_request_headers(
|
|
43
43
|
headers,
|
|
44
|
-
ip_headers_to_check: Array(configuration.header_name)
|
|
44
|
+
ip_headers_to_check: Array(configuration.header_name),
|
|
45
45
|
)
|
|
46
46
|
end
|
|
47
47
|
|