Module: Datadog::Tracing

Defined in:
lib/datadog/tracing.rb,
lib/datadog/tracing/span.rb,
lib/datadog/tracing/event.rb,
lib/datadog/tracing/flush.rb,
lib/datadog/tracing/utils.rb,
lib/datadog/tracing/buffer.rb,
lib/datadog/tracing/remote.rb,
lib/datadog/tracing/tracer.rb,
lib/datadog/tracing/writer.rb,
lib/datadog/tracing/context.rb,
lib/datadog/tracing/contrib.rb,
lib/datadog/tracing/workers.rb,
lib/datadog/tracing/metadata.rb,
lib/datadog/tracing/pipeline.rb,
lib/datadog/tracing/analytics.rb,
lib/datadog/tracing/client_ip.rb,
lib/datadog/tracing/component.rb,
lib/datadog/tracing/contrib/ext.rb,
lib/datadog/tracing/correlation.rb,
lib/datadog/tracing/sync_writer.rb,
lib/datadog/tracing/metadata/ext.rb,
lib/datadog/tracing/sampling/ext.rb,
lib/datadog/tracing/trace_digest.rb,
lib/datadog/tracing/transport/io.rb,
lib/datadog/tracing/sampling/rule.rb,
lib/datadog/tracing/trace_segment.rb,
lib/datadog/tracing/contrib/pg/ext.rb,
lib/datadog/tracing/span_operation.rb,
lib/datadog/tracing/transport/http.rb,
lib/datadog/tracing/contrib/aws/ext.rb,
lib/datadog/tracing/contrib/patcher.rb,
lib/datadog/tracing/contrib/que/ext.rb,
lib/datadog/tracing/diagnostics/ext.rb,
lib/datadog/tracing/metadata/errors.rb,
lib/datadog/tracing/runtime/metrics.rb,
lib/datadog/tracing/trace_operation.rb,
lib/datadog/tracing/context_provider.rb,
lib/datadog/tracing/contrib/grpc/ext.rb,
lib/datadog/tracing/contrib/http/ext.rb,
lib/datadog/tracing/contrib/rack/ext.rb,
lib/datadog/tracing/contrib/rake/ext.rb,
lib/datadog/tracing/contrib/registry.rb,
lib/datadog/tracing/contrib/roda/ext.rb,
lib/datadog/tracing/distributed/none.rb,
lib/datadog/tracing/metadata/tagging.rb,
lib/datadog/tracing/propagation/http.rb,
lib/datadog/tracing/sampling/matcher.rb,
lib/datadog/tracing/sampling/sampler.rb,
lib/datadog/tracing/transport/traces.rb,
lib/datadog/tracing/configuration/ext.rb,
lib/datadog/tracing/contrib/analytics.rb,
lib/datadog/tracing/contrib/dalli/ext.rb,
lib/datadog/tracing/contrib/ethon/ext.rb,
lib/datadog/tracing/contrib/excon/ext.rb,
lib/datadog/tracing/contrib/grape/ext.rb,
lib/datadog/tracing/contrib/kafka/ext.rb,
lib/datadog/tracing/contrib/patchable.rb,
lib/datadog/tracing/contrib/qless/ext.rb,
lib/datadog/tracing/contrib/rails/ext.rb,
lib/datadog/tracing/contrib/redis/ext.rb,
lib/datadog/tracing/sampling/span/ext.rb,
lib/datadog/tracing/configuration/http.rb,
lib/datadog/tracing/contrib/extensions.rb,
lib/datadog/tracing/contrib/hanami/ext.rb,
lib/datadog/tracing/contrib/httprb/ext.rb,
lib/datadog/tracing/contrib/mysql2/ext.rb,
lib/datadog/tracing/contrib/pg/patcher.rb,
lib/datadog/tracing/contrib/presto/ext.rb,
lib/datadog/tracing/contrib/que/tracer.rb,
lib/datadog/tracing/contrib/redis/tags.rb,
lib/datadog/tracing/contrib/resque/ext.rb,
lib/datadog/tracing/contrib/sequel/ext.rb,
lib/datadog/tracing/contrib/stripe/ext.rb,
lib/datadog/tracing/diagnostics/health.rb,
lib/datadog/tracing/metadata/analytics.rb,
lib/datadog/tracing/sampling/span/rule.rb,
lib/datadog/tracing/transport/http/api.rb,
lib/datadog/tracing/contrib/aws/patcher.rb,
lib/datadog/tracing/contrib/faraday/ext.rb,
lib/datadog/tracing/contrib/graphql/ext.rb,
lib/datadog/tracing/contrib/integration.rb,
lib/datadog/tracing/contrib/kafka/event.rb,
lib/datadog/tracing/contrib/lograge/ext.rb,
lib/datadog/tracing/contrib/mongodb/ext.rb,
lib/datadog/tracing/contrib/que/patcher.rb,
lib/datadog/tracing/contrib/racecar/ext.rb,
lib/datadog/tracing/contrib/rails/utils.rb,
lib/datadog/tracing/contrib/sidekiq/ext.rb,
lib/datadog/tracing/contrib/sinatra/env.rb,
lib/datadog/tracing/contrib/sinatra/ext.rb,
lib/datadog/tracing/contrib/trilogy/ext.rb,
lib/datadog/tracing/distributed/datadog.rb,
lib/datadog/tracing/distributed/fetcher.rb,
lib/datadog/tracing/distributed/helpers.rb,
lib/datadog/tracing/transport/io/client.rb,
lib/datadog/tracing/transport/io/traces.rb,
lib/datadog/tracing/contrib/aws/services.rb,
lib/datadog/tracing/contrib/configurable.rb,
lib/datadog/tracing/contrib/grpc/patcher.rb,
lib/datadog/tracing/contrib/http/patcher.rb,
lib/datadog/tracing/contrib/kafka/events.rb,
lib/datadog/tracing/contrib/rack/patcher.rb,
lib/datadog/tracing/contrib/rake/patcher.rb,
lib/datadog/tracing/contrib/registerable.rb,
lib/datadog/tracing/contrib/roda/patcher.rb,
lib/datadog/tracing/contrib/sequel/utils.rb,
lib/datadog/tracing/contrib/sneakers/ext.rb,
lib/datadog/tracing/distributed/b3_multi.rb,
lib/datadog/tracing/pipeline/span_filter.rb,
lib/datadog/tracing/sampling/all_sampler.rb,
lib/datadog/tracing/transport/statistics.rb,
lib/datadog/tracing/workers/trace_writer.rb,
lib/datadog/tracing/configuration/dynamic.rb,
lib/datadog/tracing/contrib/dalli/patcher.rb,
lib/datadog/tracing/contrib/ethon/patcher.rb,
lib/datadog/tracing/contrib/excon/patcher.rb,
lib/datadog/tracing/contrib/grape/patcher.rb,
lib/datadog/tracing/contrib/kafka/patcher.rb,
lib/datadog/tracing/contrib/qless/patcher.rb,
lib/datadog/tracing/contrib/racecar/event.rb,
lib/datadog/tracing/contrib/rails/patcher.rb,
lib/datadog/tracing/contrib/redis/patcher.rb,
lib/datadog/tracing/contrib/shoryuken/ext.rb,
lib/datadog/tracing/contrib/sidekiq/utils.rb,
lib/datadog/tracing/distributed/b3_single.rb,
lib/datadog/tracing/sampling/rate_limiter.rb,
lib/datadog/tracing/sampling/rate_sampler.rb,
lib/datadog/tracing/sampling/rule_sampler.rb,
lib/datadog/tracing/sampling/span/matcher.rb,
lib/datadog/tracing/sampling/span/sampler.rb,
lib/datadog/tracing/transport/http/client.rb,
lib/datadog/tracing/transport/http/traces.rb,
lib/datadog/tracing/transport/io/response.rb,
lib/datadog/tracing/configuration/settings.rb,
lib/datadog/tracing/contrib/active_job/ext.rb,
lib/datadog/tracing/contrib/aws/service/s3.rb,
lib/datadog/tracing/contrib/dalli/quantize.rb,
lib/datadog/tracing/contrib/grape/endpoint.rb,
lib/datadog/tracing/contrib/hanami/patcher.rb,
lib/datadog/tracing/contrib/httpclient/ext.rb,
lib/datadog/tracing/contrib/httprb/patcher.rb,
lib/datadog/tracing/contrib/mysql2/patcher.rb,
lib/datadog/tracing/contrib/opensearch/ext.rb,
lib/datadog/tracing/contrib/pg/integration.rb,
lib/datadog/tracing/contrib/presto/patcher.rb,
lib/datadog/tracing/contrib/racecar/events.rb,
lib/datadog/tracing/contrib/redis/quantize.rb,
lib/datadog/tracing/contrib/resque/patcher.rb,
lib/datadog/tracing/contrib/sequel/dataset.rb,
lib/datadog/tracing/contrib/sequel/patcher.rb,
lib/datadog/tracing/contrib/sinatra/tracer.rb,
lib/datadog/tracing/contrib/stripe/patcher.rb,
lib/datadog/tracing/contrib/stripe/request.rb,
lib/datadog/tracing/contrib/utils/database.rb,
lib/datadog/tracing/transport/http/builder.rb,
lib/datadog/tracing/contrib/action_pack/ext.rb,
lib/datadog/tracing/contrib/action_view/ext.rb,
lib/datadog/tracing/contrib/auto_instrument.rb,
lib/datadog/tracing/contrib/aws/integration.rb,
lib/datadog/tracing/contrib/aws/service/sns.rb,
lib/datadog/tracing/contrib/aws/service/sqs.rb,
lib/datadog/tracing/contrib/delayed_job/ext.rb,
lib/datadog/tracing/contrib/faraday/patcher.rb,
lib/datadog/tracing/contrib/graphql/patcher.rb,
lib/datadog/tracing/contrib/grpc/formatting.rb,
lib/datadog/tracing/contrib/lograge/patcher.rb,
lib/datadog/tracing/contrib/mongodb/parsers.rb,
lib/datadog/tracing/contrib/mongodb/patcher.rb,
lib/datadog/tracing/contrib/qless/qless_job.rb,
lib/datadog/tracing/contrib/que/integration.rb,
lib/datadog/tracing/contrib/racecar/patcher.rb,
lib/datadog/tracing/contrib/rails/framework.rb,
lib/datadog/tracing/contrib/rest_client/ext.rb,
lib/datadog/tracing/contrib/sequel/database.rb,
lib/datadog/tracing/contrib/sidekiq/patcher.rb,
lib/datadog/tracing/contrib/sinatra/patcher.rb,
lib/datadog/tracing/contrib/sneakers/tracer.rb,
lib/datadog/tracing/contrib/trilogy/patcher.rb,
lib/datadog/tracing/distributed/headers/ext.rb,
lib/datadog/tracing/distributed/propagation.rb,
lib/datadog/tracing/pipeline/span_processor.rb,
lib/datadog/tracing/transport/http/api/spec.rb,
lib/datadog/tracing/contrib/action_cable/ext.rb,
lib/datadog/tracing/contrib/active_job/event.rb,
lib/datadog/tracing/contrib/aws/service/base.rb,
lib/datadog/tracing/contrib/ethon/easy_patch.rb,
lib/datadog/tracing/contrib/excon/middleware.rb,
lib/datadog/tracing/contrib/grpc/integration.rb,
lib/datadog/tracing/contrib/http/integration.rb,
lib/datadog/tracing/contrib/rack/integration.rb,
lib/datadog/tracing/contrib/rack/middlewares.rb,
lib/datadog/tracing/contrib/rake/integration.rb,
lib/datadog/tracing/contrib/roda/integration.rb,
lib/datadog/tracing/contrib/shoryuken/tracer.rb,
lib/datadog/tracing/contrib/sneakers/patcher.rb,
lib/datadog/tracing/contrib/sucker_punch/ext.rb,
lib/datadog/tracing/contrib/action_mailer/ext.rb,
lib/datadog/tracing/contrib/action_pack/utils.rb,
lib/datadog/tracing/contrib/action_view/event.rb,
lib/datadog/tracing/contrib/action_view/utils.rb,
lib/datadog/tracing/contrib/active_job/events.rb,
lib/datadog/tracing/contrib/active_record/ext.rb,
lib/datadog/tracing/contrib/dalli/integration.rb,
lib/datadog/tracing/contrib/elasticsearch/ext.rb,
lib/datadog/tracing/contrib/ethon/integration.rb,
lib/datadog/tracing/contrib/ethon/multi_patch.rb,
lib/datadog/tracing/contrib/excon/integration.rb,
lib/datadog/tracing/contrib/grape/integration.rb,
lib/datadog/tracing/contrib/kafka/integration.rb,
lib/datadog/tracing/contrib/qless/integration.rb,
lib/datadog/tracing/contrib/rails/integration.rb,
lib/datadog/tracing/contrib/rails/middlewares.rb,
lib/datadog/tracing/contrib/redis/integration.rb,
lib/datadog/tracing/contrib/resque/resque_job.rb,
lib/datadog/tracing/contrib/shoryuken/patcher.rb,
lib/datadog/tracing/contrib/sinatra/framework.rb,
lib/datadog/tracing/distributed/trace_context.rb,
lib/datadog/tracing/sampling/priority_sampler.rb,
lib/datadog/tracing/sampling/span/rule_parser.rb,
lib/datadog/tracing/transport/http/statistics.rb,
lib/datadog/tracing/transport/trace_formatter.rb,
lib/datadog/tracing/contrib/action_cable/event.rb,
lib/datadog/tracing/contrib/action_view/events.rb,
lib/datadog/tracing/contrib/active_job/patcher.rb,
lib/datadog/tracing/contrib/active_support/ext.rb,
lib/datadog/tracing/contrib/aws/parsed_context.rb,
lib/datadog/tracing/contrib/aws/service/states.rb,
lib/datadog/tracing/contrib/delayed_job/plugin.rb,
lib/datadog/tracing/contrib/faraday/connection.rb,
lib/datadog/tracing/contrib/faraday/middleware.rb,
lib/datadog/tracing/contrib/hanami/integration.rb,
lib/datadog/tracing/contrib/httpclient/patcher.rb,
lib/datadog/tracing/contrib/httprb/integration.rb,
lib/datadog/tracing/contrib/mysql2/integration.rb,
lib/datadog/tracing/contrib/opensearch/patcher.rb,
lib/datadog/tracing/contrib/pg/instrumentation.rb,
lib/datadog/tracing/contrib/presto/integration.rb,
lib/datadog/tracing/contrib/rack/request_queue.rb,
lib/datadog/tracing/contrib/resque/integration.rb,
lib/datadog/tracing/contrib/sequel/integration.rb,
lib/datadog/tracing/contrib/stripe/integration.rb,
lib/datadog/tracing/contrib/action_cable/events.rb,
lib/datadog/tracing/contrib/action_mailer/event.rb,
lib/datadog/tracing/contrib/action_pack/patcher.rb,
lib/datadog/tracing/contrib/action_view/patcher.rb,
lib/datadog/tracing/contrib/active_record/event.rb,
lib/datadog/tracing/contrib/active_record/utils.rb,
lib/datadog/tracing/contrib/aws/instrumentation.rb,
lib/datadog/tracing/contrib/aws/service/kinesis.rb,
lib/datadog/tracing/contrib/concurrent_ruby/ext.rb,
lib/datadog/tracing/contrib/delayed_job/patcher.rb,
lib/datadog/tracing/contrib/faraday/integration.rb,
lib/datadog/tracing/contrib/graphql/integration.rb,
lib/datadog/tracing/contrib/lograge/integration.rb,
lib/datadog/tracing/contrib/mongodb/integration.rb,
lib/datadog/tracing/contrib/mongodb/subscribers.rb,
lib/datadog/tracing/contrib/opensearch/quantize.rb,
lib/datadog/tracing/contrib/racecar/integration.rb,
lib/datadog/tracing/contrib/rack/header_tagging.rb,
lib/datadog/tracing/contrib/rails/log_injection.rb,
lib/datadog/tracing/contrib/rest_client/patcher.rb,
lib/datadog/tracing/contrib/semantic_logger/ext.rb,
lib/datadog/tracing/contrib/sidekiq/integration.rb,
lib/datadog/tracing/contrib/sinatra/integration.rb,
lib/datadog/tracing/contrib/status_code_matcher.rb,
lib/datadog/tracing/contrib/trilogy/integration.rb,
lib/datadog/tracing/transport/http/api/instance.rb,
lib/datadog/tracing/configuration/dynamic/option.rb,
lib/datadog/tracing/contrib/action_cable/patcher.rb,
lib/datadog/tracing/contrib/action_mailer/events.rb,
lib/datadog/tracing/contrib/active_record/events.rb,
lib/datadog/tracing/contrib/aws/service/dynamodb.rb,
lib/datadog/tracing/contrib/faraday/rack_builder.rb,
lib/datadog/tracing/contrib/hanami/action_tracer.rb,
lib/datadog/tracing/contrib/http/circuit_breaker.rb,
lib/datadog/tracing/contrib/http/instrumentation.rb,
lib/datadog/tracing/contrib/kafka/consumer_event.rb,
lib/datadog/tracing/contrib/qless/tracer_cleaner.rb,
lib/datadog/tracing/contrib/racecar/events/batch.rb,
lib/datadog/tracing/contrib/rake/instrumentation.rb,
lib/datadog/tracing/contrib/roda/instrumentation.rb,
lib/datadog/tracing/contrib/sneakers/integration.rb,
lib/datadog/tracing/contrib/sucker_punch/patcher.rb,
lib/datadog/tracing/sampling/rate_by_key_sampler.rb,
lib/datadog/tracing/transport/serializable_trace.rb,
lib/datadog/tracing/contrib/action_mailer/patcher.rb,
lib/datadog/tracing/contrib/active_record/patcher.rb,
lib/datadog/tracing/contrib/dalli/instrumentation.rb,
lib/datadog/tracing/contrib/elasticsearch/patcher.rb,
lib/datadog/tracing/contrib/grape/instrumentation.rb,
lib/datadog/tracing/contrib/hanami/router_tracing.rb,
lib/datadog/tracing/contrib/redis/instrumentation.rb,
lib/datadog/tracing/contrib/redis/vendor/resolver.rb,
lib/datadog/tracing/contrib/shoryuken/integration.rb,
lib/datadog/tracing/contrib/sidekiq/client_tracer.rb,
lib/datadog/tracing/contrib/sidekiq/server_tracer.rb,
lib/datadog/tracing/contrib/span_attribute_schema.rb,
lib/datadog/tracing/contrib/active_job/integration.rb,
lib/datadog/tracing/contrib/active_support/patcher.rb,
lib/datadog/tracing/contrib/configuration/resolver.rb,
lib/datadog/tracing/contrib/configuration/settings.rb,
lib/datadog/tracing/contrib/elasticsearch/quantize.rb,
lib/datadog/tracing/contrib/http_annotation_helper.rb,
lib/datadog/tracing/contrib/httpclient/integration.rb,
lib/datadog/tracing/contrib/httprb/instrumentation.rb,
lib/datadog/tracing/contrib/mysql2/instrumentation.rb,
lib/datadog/tracing/contrib/opensearch/integration.rb,
lib/datadog/tracing/contrib/presto/instrumentation.rb,
lib/datadog/tracing/contrib/racecar/events/consume.rb,
lib/datadog/tracing/contrib/racecar/events/message.rb,
lib/datadog/tracing/contrib/rack/header_collection.rb,
lib/datadog/tracing/contrib/redis/trace_middleware.rb,
lib/datadog/tracing/diagnostics/environment_logger.rb,
lib/datadog/tracing/distributed/datadog_tags_codec.rb,
lib/datadog/tracing/contrib/action_pack/integration.rb,
lib/datadog/tracing/contrib/action_view/integration.rb,
lib/datadog/tracing/contrib/aws/service/eventbridge.rb,
lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb,
lib/datadog/tracing/contrib/delayed_job/integration.rb,
lib/datadog/tracing/contrib/lograge/instrumentation.rb,
lib/datadog/tracing/contrib/mongodb/instrumentation.rb,
lib/datadog/tracing/contrib/propagation/sql_comment.rb,
lib/datadog/tracing/contrib/rest_client/integration.rb,
lib/datadog/tracing/contrib/semantic_logger/patcher.rb,
lib/datadog/tracing/contrib/trilogy/instrumentation.rb,
lib/datadog/tracing/contrib/utils/quantization/hash.rb,
lib/datadog/tracing/contrib/utils/quantization/http.rb,
lib/datadog/tracing/contrib/action_cable/integration.rb,
lib/datadog/tracing/contrib/active_job/log_injection.rb,
lib/datadog/tracing/contrib/active_record/events/sql.rb,
lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb,
lib/datadog/tracing/contrib/grpc/distributed/fetcher.rb,
lib/datadog/tracing/contrib/http/distributed/fetcher.rb,
lib/datadog/tracing/contrib/sucker_punch/integration.rb,
lib/datadog/tracing/sampling/rate_by_service_sampler.rb,
lib/datadog/tracing/contrib/action_mailer/integration.rb,
lib/datadog/tracing/contrib/active_job/events/discard.rb,
lib/datadog/tracing/contrib/active_job/events/enqueue.rb,
lib/datadog/tracing/contrib/active_job/events/perform.rb,
lib/datadog/tracing/contrib/active_record/integration.rb,
lib/datadog/tracing/contrib/elasticsearch/integration.rb,
lib/datadog/tracing/contrib/pg/configuration/settings.rb,
lib/datadog/tracing/contrib/rest_client/request_patch.rb,
lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb,
lib/datadog/tracing/contrib/active_support/cache/redis.rb,
lib/datadog/tracing/contrib/active_support/integration.rb,
lib/datadog/tracing/contrib/aws/configuration/settings.rb,
lib/datadog/tracing/contrib/httpclient/instrumentation.rb,
lib/datadog/tracing/contrib/kafka/consumer_group_event.rb,
lib/datadog/tracing/contrib/que/configuration/settings.rb,
lib/datadog/tracing/contrib/concurrent_ruby/async_patch.rb,
lib/datadog/tracing/contrib/concurrent_ruby/integration.rb,
lib/datadog/tracing/contrib/grpc/configuration/settings.rb,
lib/datadog/tracing/contrib/grpc/intercept_with_datadog.rb,
lib/datadog/tracing/contrib/http/configuration/settings.rb,
lib/datadog/tracing/contrib/propagation/sql_comment/ext.rb,
lib/datadog/tracing/contrib/rack/configuration/settings.rb,
lib/datadog/tracing/contrib/rake/configuration/settings.rb,
lib/datadog/tracing/contrib/roda/configuration/settings.rb,
lib/datadog/tracing/contrib/semantic_logger/integration.rb,
lib/datadog/tracing/contrib/action_cable/events/transmit.rb,
lib/datadog/tracing/contrib/action_cable/instrumentation.rb,
lib/datadog/tracing/contrib/action_mailer/events/deliver.rb,
lib/datadog/tracing/contrib/action_mailer/events/process.rb,
lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb,
lib/datadog/tracing/contrib/active_model_serializers/ext.rb,
lib/datadog/tracing/contrib/active_support/cache/patcher.rb,
lib/datadog/tracing/contrib/concurrent_ruby/future_patch.rb,
lib/datadog/tracing/contrib/dalli/configuration/settings.rb,
lib/datadog/tracing/contrib/ethon/configuration/settings.rb,
lib/datadog/tracing/contrib/excon/configuration/settings.rb,
lib/datadog/tracing/contrib/grape/configuration/settings.rb,
lib/datadog/tracing/contrib/grpc/distributed/propagation.rb,
lib/datadog/tracing/contrib/http/distributed/propagation.rb,
lib/datadog/tracing/contrib/kafka/configuration/settings.rb,
lib/datadog/tracing/contrib/propagation/sql_comment/mode.rb,
lib/datadog/tracing/contrib/qless/configuration/settings.rb,
lib/datadog/tracing/contrib/rails/configuration/settings.rb,
lib/datadog/tracing/contrib/redis/configuration/resolver.rb,
lib/datadog/tracing/contrib/redis/configuration/settings.rb,
lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb,
lib/datadog/tracing/configuration/agent_settings_resolver.rb,
lib/datadog/tracing/contrib/action_cable/events/broadcast.rb,
lib/datadog/tracing/contrib/hanami/configuration/settings.rb,
lib/datadog/tracing/contrib/httprb/configuration/settings.rb,
lib/datadog/tracing/contrib/mysql2/configuration/settings.rb,
lib/datadog/tracing/contrib/presto/configuration/settings.rb,
lib/datadog/tracing/contrib/resque/configuration/settings.rb,
lib/datadog/tracing/contrib/sequel/configuration/settings.rb,
lib/datadog/tracing/contrib/stripe/configuration/settings.rb,
lib/datadog/tracing/contrib/active_model_serializers/event.rb,
lib/datadog/tracing/contrib/faraday/configuration/settings.rb,
lib/datadog/tracing/contrib/graphql/configuration/settings.rb,
lib/datadog/tracing/contrib/hanami/renderer_policy_tracing.rb,
lib/datadog/tracing/contrib/lograge/configuration/settings.rb,
lib/datadog/tracing/contrib/mongodb/configuration/settings.rb,
lib/datadog/tracing/contrib/racecar/configuration/settings.rb,
lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb,
lib/datadog/tracing/contrib/sinatra/configuration/settings.rb,
lib/datadog/tracing/contrib/sucker_punch/exception_handler.rb,
lib/datadog/tracing/contrib/trilogy/configuration/settings.rb,
lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb,
lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb,
lib/datadog/tracing/contrib/active_model_serializers/events.rb,
lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb,
lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb,
lib/datadog/tracing/contrib/kafka/events/connection/request.rb,
lib/datadog/tracing/contrib/propagation/sql_comment/comment.rb,
lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb,
lib/datadog/tracing/contrib/sidekiq/distributed/propagation.rb,
lib/datadog/tracing/contrib/sneakers/configuration/settings.rb,
lib/datadog/tracing/contrib/active_model_serializers/patcher.rb,
lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb,
lib/datadog/tracing/contrib/action_view/events/render_partial.rb,
lib/datadog/tracing/contrib/active_job/configuration/settings.rb,
lib/datadog/tracing/contrib/httpclient/configuration/settings.rb,
lib/datadog/tracing/contrib/opensearch/configuration/settings.rb,
lib/datadog/tracing/contrib/action_cable/events/perform_action.rb,
lib/datadog/tracing/contrib/action_pack/configuration/settings.rb,
lib/datadog/tracing/contrib/action_view/configuration/settings.rb,
lib/datadog/tracing/contrib/action_view/events/render_template.rb,
lib/datadog/tracing/contrib/active_record/events/instantiation.rb,
lib/datadog/tracing/contrib/active_support/notifications/event.rb,
lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb,
lib/datadog/tracing/contrib/rest_client/configuration/settings.rb,
lib/datadog/tracing/contrib/action_cable/configuration/settings.rb,
lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb,
lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/stop.rb,
lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb,
lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb,
lib/datadog/tracing/contrib/active_model_serializers/integration.rb,
lib/datadog/tracing/contrib/active_record/configuration/resolver.rb,
lib/datadog/tracing/contrib/active_record/configuration/settings.rb,
lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb,
lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb,
lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb,
lib/datadog/tracing/contrib/active_support/configuration/settings.rb,
lib/datadog/tracing/contrib/concurrent_ruby/promises_future_patch.rb,
lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb,
lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb,
lib/datadog/tracing/contrib/active_model_serializers/events/render.rb,
lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb,
lib/datadog/tracing/contrib/kafka/events/consumer_group/join_group.rb,
lib/datadog/tracing/contrib/kafka/events/consumer_group/sync_group.rb,
lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb,
lib/datadog/tracing/contrib/semantic_logger/configuration/settings.rb,
lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb,
lib/datadog/tracing/contrib/kafka/events/consumer_group/leave_group.rb,
lib/datadog/tracing/contrib/configuration/resolvers/pattern_resolver.rb,
lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb,
lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb,
lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb,
lib/datadog/tracing/contrib/active_support/notifications/subscription.rb,
lib/datadog/tracing/contrib/delayed_job/server_internal_tracer/worker.rb,
lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/redis_info.rb,
lib/datadog/tracing/contrib/active_record/configuration/makara_resolver.rb,
lib/datadog/tracing/contrib/action_view/instrumentation/partial_renderer.rb,
lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb,
lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb,
lib/datadog/tracing/contrib/action_view/instrumentation/template_renderer.rb,
lib/datadog/tracing/contrib/active_record/vendor/connection_specification.rb,
lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb,
lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_poller.rb,
lib/datadog/tracing/contrib/concurrent_ruby/context_composite_executor_service.rb

Overview

Datadog tracing

Defined Under Namespace

Modules: Analytics, ClientIp, Component, Configuration, Contrib, Correlation, Diagnostics, Distributed, Events, Flush, MeasuredBuffer, Metadata, Pipeline, Propagation, Remote, Runtime, Sampling, Transport, Utils, Workers Classes: CRubyTraceBuffer, Context, DefaultContextProvider, Event, FiberLocalContext, Span, SpanOperation, SyncWriter, ThreadSafeTraceBuffer, TraceDigest, TraceOperation, TraceSegment, Tracer, Writer

Constant Summary collapse

TraceBuffer =

Trace buffer that stores application traces. The buffer has a maximum size and when the buffer is full, a random trace is discarded. This class is thread-safe and is used automatically by the “Tracer“ instance when a “Span“ is finished.

We choose the default TraceBuffer implementation for current platform dynamically here.

TODO We should restructure this module, so that classes are not declared at top-level ::Datadog. TODO Making such a change is potentially breaking for users manually configuring the tracer.

if Core::Environment::Ext::RUBY_ENGINE == 'ruby'
  CRubyTraceBuffer
else
  ThreadSafeTraceBuffer
end

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject (readonly)

The tracer’s internal logger instance. All tracing log output is handled by this object.

The logger can be configured through configure, through Core::Configuration::Settings::DSL::Logger options.



35
36
37
# File 'lib/datadog/tracing.rb', line 35

def logger
  Datadog.logger
end

Class Method Details

.active_spanDatadog::Tracing::SpanOperation?

The active, unfinished span, representing the currently instrumented application section.

The active span belongs to an active_trace.

Parameters:

  • key (Thread)

    Thread to retrieve trace from. Defaults to current thread. For internal use only.

Returns:



50
51
52
53
54
55
# File 'lib/datadog/tracing.rb', line 50

def active_span
  current_tracer = tracer
  return unless current_tracer

  current_tracer.active_span
end

.active_traceDatadog::Tracing::TraceSegment?

The active, unfinished trace, representing the current instrumentation context.

The active trace is fiber-local.

Parameters:

  • key (Thread)

    Thread to retrieve trace from. Defaults to current thread. For internal use only.

Returns:



41
42
43
44
45
46
# File 'lib/datadog/tracing.rb', line 41

def active_trace
  current_tracer = tracer
  return unless current_tracer

  current_tracer.active_trace
end

.before_flush(*processors) ⇒ Object .before_flush {|trace| ... } ⇒ Object

Overloads:

See Also:



123
124
125
# File 'lib/datadog/tracing.rb', line 123

def before_flush(*processors, &processor_block)
  Pipeline.before_flush(*processors, &processor_block)
end

.continue_trace!(digest) { ... } ⇒ Object, Datadog::Tracing::TraceOperation

Setup a new trace to continue from where another trace left off.

Used to continue distributed or async traces.

Parameters:

Yields:

  • Optional block where this #continue_trace! ‘digest` scope is active. If no block, the `digest` remains active after #continue_trace! returns.

Returns:



23
24
25
# File 'lib/datadog/tracing.rb', line 23

def continue_trace!(digest, &block)
  tracer.continue_trace!(digest, &block)
end

.correlationDatadog::Tracing::Correlation::Identifier

Information about the currently active trace.

The most common use cases are tagging log messages and metrics.

Parameters:

  • key (Thread)

    Thread to retrieve trace from. Defaults to current thread. For internal use only.

Returns:



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/datadog/tracing.rb', line 75

def correlation
  # We access this in this way as:
  # * If the components have not been initialized, it doesn't make sense to initialize ddtrace just to say
  #   'nil' here
  # * It prevents recursive initialization attempts, see https://github.com/DataDog/dd-trace-rb/issues/3385
  components = Datadog.send(:components, allow_initialization: false)
  current_tracer = components.tracer if components

  return Datadog::Tracing::Correlation::Identifier.new unless current_tracer

  current_tracer.active_correlation
end

.enabled?Boolean

Is the tracer collecting telemetry data in this process?

Returns:

  • (Boolean)

    ‘true` if the tracer is collecting data in this process, otherwise `false`.



129
130
131
132
133
134
# File 'lib/datadog/tracing.rb', line 129

def enabled?
  current_tracer = tracer
  return false unless current_tracer

  current_tracer.enabled
end

.keep!void

This method returns an undefined value.

If an active trace is present, forces it to be retained by the Datadog backend.

Any sampling logic will not be able to change this decision.

If no trace is active, no action is taken.



60
61
62
63
# File 'lib/datadog/tracing.rb', line 60

def keep!
  trace = active_trace
  active_trace.keep! if trace
end

.log_correlationString

Textual representation of correlation, which can be added to individual log lines in order to correlate them with the active trace.

Example:

“‘ MyLogger.log(“#log_correlation] My message”) # dd.env=prod dd.service=auth dd.version=13.8 dd.trace_id=5458478252992251 dd.span_id=7117552347370098 My message “`

Returns:

  • (String)

    correlation information



101
102
103
# File 'lib/datadog/tracing.rb', line 101

def log_correlation
  correlation.to_log_format
end

.reject!void

This method returns an undefined value.

If an active trace is present, forces it to be dropped and not stored by the Datadog backend.

Any sampling logic will not be able to change this decision.

If no trace is active, no action is taken.



68
69
70
71
# File 'lib/datadog/tracing.rb', line 68

def reject!
  trace = active_trace
  active_trace.reject! if trace
end

.shutdown!Object

Gracefully shuts down the tracer.

The public tracing API will still respond to method calls as usual but might not internally perform the expected internal work after shutdown.

This avoids errors being raised across the host application during shutdown while allowing for the graceful decommission of resources.

shutdown! cannot be reversed.



115
116
117
118
119
120
# File 'lib/datadog/tracing.rb', line 115

def shutdown!
  current_tracer = tracer
  return unless current_tracer

  current_tracer.shutdown!
end

.trace(name, continue_from: nil, **span_options) {|span_op, trace_op| ... } ⇒ Object, Datadog::Tracing::SpanOperation

Return a span_op and trace_op that will trace an operation called ‘name`.

You could trace your code using a do-block like:

“‘ tracer.trace(’web.request’) do |span_op, trace_op|

span_op.service = 'my-web-site'
span_op.resource = '/'
span_op.set_tag('http.method', request.request_method)
do_something()

end “‘

The #trace method can also be used without a block in this way: “‘ span_op = tracer.trace(’web.request’, service: ‘my-web-site’) do_something() span_op.finish() “‘

Remember that in this case, calling Datadog::Tracing::SpanOperation#finish is mandatory.

When a Trace is started, #trace will store the created span; subsequent spans will become its children and will inherit some properties: “‘ parent = tracer.trace(’parent’) # has no parent span child = tracer.trace(‘child’) # is a child of ‘parent’ child.finish() parent.finish() parent2 = tracer.trace(‘parent2’) # has no parent span parent2.finish() “‘

rubocop:disable Lint/UnderscorePrefixedVariableName rubocop:disable Metrics/MethodLength

Parameters:

  • name (String)

    Span operation name. See / Primary Operations in Services.

  • continue_from (Datadog::Tracing::TraceDigest) (defaults to: nil)

    continue a trace from a TraceDigest. Used for linking traces that are executed asynchronously.

  • on_error (Proc)

    a block that overrides error handling behavior for this operation.

  • resource (String)

    the resource this span refers, or ‘name` if it’s missing

  • service (String)

    the service name for this span.

  • start_time (Time)

    time which the span should have started.

  • tags (Hash<String,String>)

    extra tags which should be added to the span.

  • type (String)

    the type of the span. See Datadog::Tracing::Metadata::Ext::AppTypes.

Yields:

  • Optional block where new newly created SpanOperation captures the execution.

Yield Parameters:

Returns:



17
18
19
# File 'lib/datadog/tracing.rb', line 17

def trace(name, continue_from: nil, **span_options, &block)
  tracer.trace(name, continue_from: continue_from, **span_options, &block)
end