Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove opentracing support #3443

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
/lib/datadog/tracing.rb @DataDog/tracing-ruby
/lib/datadog/opentelemetry/ @DataDog/tracing-ruby
/lib/datadog/opentelemetry.rb @DataDog/tracing-ruby
/lib/datadog/opentracer/ @DataDog/tracing-ruby
/lib/datadog/opentracer.rb @DataDog/tracing-ruby
/lib-injection/ @DataDog/tracing-ruby
/lib/datadog/profiling/ @DataDog/profiling-rb
/lib/datadog/profiling.rb @DataDog/profiling-rb
Expand All @@ -25,8 +23,6 @@
/sig/datadog/tracing.rbs @DataDog/tracing-ruby
/sig/datadog/opentelemetry/ @DataDog/tracing-ruby
/sig/datadog/opentelemetry.rbs @DataDog/tracing-ruby
/sig/datadog/opentracer/ @DataDog/tracing-ruby
/sig/datadog/opentracer.rbs @DataDog/tracing-ruby
/sig/datadog/profiling/ @DataDog/profiling-rb
/sig/datadog/profiling.rbs @DataDog/profiling-rb

Expand All @@ -36,7 +32,5 @@
/spec/datadog/tracing_spec.rb @DataDog/tracing-ruby
/spec/datadog/opentelemetry/ @DataDog/tracing-ruby
/spec/datadog/opentelemetry_spec.rb @DataDog/tracing-ruby
/spec/datadog/opentracer/ @DataDog/tracing-ruby
/spec/datadog/opentracer.rb @DataDog/tracing-ruby
/spec/datadog/profiling/ @DataDog/profiling-rb
/spec/datadog/profiling_spec.rb @DataDog/profiling-rb
2 changes: 0 additions & 2 deletions .github/workflows/test-head.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
continue-on-error: true
- run: bundle exec rake spec:contrib
continue-on-error: true
- run: bundle exec rake spec:opentracer
continue-on-error: true
# A few contrib jobs that `ddtrace` already includes their gem in the global Gemfile.
# We technically don't need appraisal to run them, thus are easy candidates for early testing.
- run: bundle exec rake spec:rake
Expand Down
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ Naming/FileName:
- CRuby
- GC
- OpenTelemetry
- OpenTracer
- VM
- SDK
- GraphQL
Expand Down
12 changes: 0 additions & 12 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ Lint/MissingCopEnableDirective:
Lint/MissingSuper:
Exclude:
- 'lib/datadog/core/workers/runtime_metrics.rb'
- 'lib/datadog/opentracer/scope.rb'
- 'lib/datadog/opentracer/span.rb'
- 'lib/datadog/opentracer/span_context.rb'
- 'lib/datadog/profiling/scheduler.rb'
- 'spec/support/faux_transport.rb'
- 'spec/support/spy_transport.rb'
Expand Down Expand Up @@ -68,12 +65,6 @@ Naming/FileName:
- 'lib/ddtrace/transport/ext.rb'
- 'lib/ddtrace/version.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/EmptyExampleGroup:
Exclude:
- 'spec/datadog/opentracer/distributed_headers_spec.rb'

# Offense count: 1
RSpec/IteratedExpectation:
Exclude:
Expand Down Expand Up @@ -108,15 +99,12 @@ RSpec/RepeatedDescription:
# Offense count: 10
RSpec/RepeatedExampleGroupDescription:
Exclude:
- 'spec/datadog/opentracer/scope_manager_spec.rb'
- 'spec/datadog/opentracer/thread_local_scope_manager_spec.rb'
- 'spec/datadog/tracing/contrib/grape/tracer_spec.rb'
- 'spec/datadog/tracing/contrib/redis/quantize_spec.rb'

# Offense count: 40
RSpec/ScatteredSetup:
Exclude:
- 'spec/datadog/opentracer/span_spec.rb'
- 'spec/datadog/tracing/benchmark/support/benchmark_helper.rb'
- 'spec/datadog/tracing/contrib/action_cable/instrumentation_spec.rb'
- 'spec/datadog/tracing/contrib/action_cable/patcher_spec.rb'
Expand Down
11 changes: 1 addition & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ TEST_METADATA = {
'contrib' => {
'' => '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
},
'opentracer' => {
'opentracing' => '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
},
'opentelemetry' => {
'opentelemetry' => '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ❌ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ❌ jruby'
},
Expand Down Expand Up @@ -333,7 +330,7 @@ namespace :spec do
desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:main) do |t, args|
t.pattern = 'spec/**/*_spec.rb'
t.exclude_pattern = 'spec/**/{contrib,benchmark,redis,opentracer,auto_instrument,opentelemetry,profiling}/**/*_spec.rb,'\
t.exclude_pattern = 'spec/**/{contrib,benchmark,redis,auto_instrument,opentelemetry,profiling}/**/*_spec.rb,'\
' spec/**/{auto_instrument,opentelemetry}_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end
Expand All @@ -343,12 +340,6 @@ namespace :spec do
t.rspec_opts = args.to_a.join(' ')
end

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:opentracer) do |t, args|
t.pattern = 'spec/datadog/opentracer/**/*_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:opentelemetry) do |t, args|
t.pattern = 'spec/datadog/opentelemetry/**/*_spec.rb,spec/datadog/opentelemetry_spec.rb'
Expand Down
17 changes: 0 additions & 17 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,6 @@ target :ddtrace do
ignore 'lib/datadog/opentelemetry/sdk/propagator.rb'
ignore 'lib/datadog/opentelemetry/sdk/span_processor.rb'
ignore 'lib/datadog/opentelemetry/sdk/trace/span.rb'
ignore 'lib/datadog/opentracer.rb'
ignore 'lib/datadog/opentracer/binary_propagator.rb'
ignore 'lib/datadog/opentracer/carrier.rb'
ignore 'lib/datadog/opentracer/distributed_headers.rb'
ignore 'lib/datadog/opentracer/global_tracer.rb'
ignore 'lib/datadog/opentracer/propagator.rb'
ignore 'lib/datadog/opentracer/rack_propagator.rb'
ignore 'lib/datadog/opentracer/scope.rb'
ignore 'lib/datadog/opentracer/scope_manager.rb'
ignore 'lib/datadog/opentracer/span.rb'
ignore 'lib/datadog/opentracer/span_context.rb'
ignore 'lib/datadog/opentracer/span_context_factory.rb'
ignore 'lib/datadog/opentracer/text_map_propagator.rb'
ignore 'lib/datadog/opentracer/thread_local_scope.rb'
ignore 'lib/datadog/opentracer/thread_local_scope_manager.rb'
ignore 'lib/datadog/opentracer/tracer.rb'
ignore 'lib/datadog/profiling/collectors/code_provenance.rb'
ignore 'lib/datadog/profiling/ext/forking.rb'
ignore 'lib/datadog/profiling/scheduler.rb'
Expand Down Expand Up @@ -623,7 +607,6 @@ target :ddtrace do
library 'minitest'
library 'mysql2'
library 'mysql2-aurora'
library 'opentracing'
library 'concurrent-ruby'
library 'faraday'
library 'seahorse'
Expand Down
2 changes: 1 addition & 1 deletion docs/Compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The Ruby Datadog Trace library is open source. See the [dd-trace-rb][1] GitHub r

| Type | Documentation | Version | Gem version support |
| ----------- | ----------------------------------------------- | --------------------- | ------------------- |
| OpenTracing | https://github.com/opentracing/opentracing-ruby | 0.4.1+ | >= 0.16.0 |
| OpenTracing | https://github.com/opentracing/opentracing-ruby | 0.4.1+ | < 2.0.0 |

*Full* support indicates all tracer features are available.

Expand Down
67 changes: 0 additions & 67 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,44 +143,6 @@ If your application does not use the supported gems (Rails or Hanami) above, you
- [Add additional configuration settings](#additional-configuration)
- [Activate or reconfigure instrumentation](#integration-instrumentation)

#### Configuring OpenTracing

1. Add the `ddtrace` gem to your Gemfile:

```ruby
source 'https://rubygems.org'
gem 'ddtrace'
```

2. Install the gem with `bundle install`
3. To your OpenTracing configuration file, add the following:

```ruby
require 'opentracing'
require 'datadog/tracing'
require 'datadog/opentracer'

# Activate the Datadog tracer for OpenTracing
OpenTracing.global_tracer = Datadog::OpenTracer::Tracer.new
```

4. Add a configuration block to your application:

```ruby
Datadog.configure do |c|
# Configure the Datadog tracer here.
# Activate integrations, change tracer settings, etc...
# By default without additional configuration,
# no additional integrations will be traced, only
# what you have instrumented with OpenTracing.
end
```

Using this block you can:

- [Add additional Datadog configuration settings](#additional-configuration)
- [Activate or reconfigure Datadog instrumentation](#integration-instrumentation)

#### Configuring OpenTelemetry

You can send OpenTelemetry traces directly to the Datadog Agent (without `ddtrace`) by using OTLP. Check out our documentation on [OTLP ingest in the Datadog Agent](https://docs.datadoghq.com/tracing/setup_overview/open_standards/#otlp-ingest-in-datadog-agent) for details.
Expand Down Expand Up @@ -2608,35 +2570,6 @@ In addition, all metrics include the following tags:
| `language` | Programming language traced. (e.g. `ruby`) |
| `service` | List of services this associated with this metric. |

### OpenTracing

For setting up Datadog with OpenTracing, see our [Configuring OpenTracing](#configuring-opentracing) section for details.

**Configuring Datadog tracer settings**

The underlying Datadog tracer can be configured by passing options (which match `Datadog::Tracer`) when configuring the global tracer:

```ruby
# Where `options` is a Hash of options provided to Datadog::Tracer
OpenTracing.global_tracer = Datadog::OpenTracer::Tracer.new(**options)
```

It can also be configured by using `Datadog.configure` described in the [Additional Configuration](#additional-configuration) section.

**Activating and configuring integrations**

By default, configuring OpenTracing with Datadog will not automatically activate any additional instrumentation provided by Datadog. You will only receive spans and traces from OpenTracing instrumentation you have in your application.

However, additional instrumentation provided by Datadog can be activated alongside OpenTracing using `Datadog.configure`, which can be used to enhance your tracing further. To activate this, see [Integration instrumentation](#integration-instrumentation) for more details.

**Supported serialization formats**

| Type | Supported? | Additional information |
| ------------------------------ | ---------- | ---------------------- |
| `OpenTracing::FORMAT_TEXT_MAP` | Yes | |
| `OpenTracing::FORMAT_RACK` | Yes | Because of the loss of resolution in the Rack format, please note that baggage items with names containing either upper case characters or `-` will be converted to lower case and `_` in a round-trip respectively. We recommend avoiding these characters or accommodating accordingly on the receiving end. |
| `OpenTracing::FORMAT_BINARY` | No | |

### Profiling

`ddtrace` can produce profiles that measure method-level application resource usage within production environments. These profiles can give insight into resources spent in Ruby code outside of existing trace instrumentation.
Expand Down
1 change: 0 additions & 1 deletion lib/datadog/appsec/contrib/rails/patcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def before_initialize(app)
BEFORE_INITIALIZE_ONLY_ONCE_PER_APP[app].run do
# Middleware must be added before the application is initialized.
# Otherwise the middleware stack will be frozen.
# Sometimes we don't want to activate middleware e.g. OpenTracing, etc.
add_middleware(app) if Datadog.configuration.tracing[:rails][:middleware]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Datadog.configuration.tracing[:rails][:middleware] == false ever make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking where you want the other Rails instrumentation but not the Rack middleware. Very niche, but possible. I'd look at the history of the option before making too many assumptions, though.

patch_process_action
end
Expand Down
1 change: 0 additions & 1 deletion lib/datadog/core/telemetry/collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def additional_payload_variables
options['appsec.enabled'] = configuration.dig('appsec', 'enabled') if configuration.respond_to?('appsec')
options['ci.enabled'] = configuration.dig('ci', 'enabled') if configuration.respond_to?('ci')
options['tracing.opentelemetry.enabled'] = !defined?(Datadog::OpenTelemetry::LOADED).nil?
options['tracing.opentracing.enabled'] = !defined?(Datadog::OpenTracer::LOADED).nil?
options.compact!
options
end
Expand Down
33 changes: 0 additions & 33 deletions lib/datadog/opentracer.rb

This file was deleted.

26 changes: 0 additions & 26 deletions lib/datadog/opentracer/binary_propagator.rb

This file was deleted.

9 changes: 0 additions & 9 deletions lib/datadog/opentracer/carrier.rb

This file was deleted.

56 changes: 0 additions & 56 deletions lib/datadog/opentracer/distributed_headers.rb

This file was deleted.

17 changes: 0 additions & 17 deletions lib/datadog/opentracer/global_tracer.rb

This file was deleted.

Loading
Loading