Git Product home page Git Product logo

Comments (5)

sj26 avatar sj26 commented on August 22, 2024 1

More specifically, this seems to be the problem:

Datadog::Monkey.patch_module(:redis)

Because redis is patched and starts writing spans well before anything in config/initializers/* is loaded there are already recorded spans attempting to be sent to the datadog agent before the tracer is disabled in development.

from dd-trace-rb.

sj26 avatar sj26 commented on August 22, 2024

The only way to prevent this seems to be preventing ddtrace from being required at all outside production by using gem "ddtrace", group: "production" in the Gemfile. We'd prefer to keep it loaded in all environments for parity with production and so we can add application instrumentation.

from dd-trace-rb.

palazzem avatar palazzem commented on August 22, 2024

Thank you for reporting that @sj26 ! we'll be sure that the next release doesn't have such kind of issues.

from dd-trace-rb.

palazzem avatar palazzem commented on August 22, 2024

#86 should remove the root cause about Redis sending traces despite defined settings. A configuration like:

Rails.configuration.datadog_trace =
  {
    # may depend by your conditional env
    enabled: false,
    # these may be 'true' to keep parity with your production
    auto_instrument: true,
    auto_instrument_redis: true
  }

ensures that:

  • Rails is auto-instrumented after bundler requires ddtrace
  • Redis is auto-instrumented after bundler requires ddtrace
  • if redis-rails is used and Redis is auto-instrumented, redis-rails will use the traced Redis client
  • disabling the tracer means that traces will not be reported but the code will still be instrumented like in your production environment.

from dd-trace-rb.

palazzem avatar palazzem commented on August 22, 2024

Fixed with #86 . Redis auto-instrumentation (available after any kind of require 'ddtrace') honors the Rails initializer. So if the tracer is disabled, Redis is instrumented after so that no traces are sent from the transport layer (but traces are still generated and Redis is still instrumented). This plays well with Rake scripts and Sidekiq (in environments where the tracer is not enabled).

If you spot another problem, feel free to re-open the issue or to create a new one! The next release will be available by the end of the week and it includes a better Sidekiq support!

from dd-trace-rb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.