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

Add support for tagging profiles with opentelemetry trace identifiers #1568

Closed
wants to merge 10 commits into from

Commits on Jun 28, 2021

  1. Extract reading of trace identifiers to helper

    This refactor will enable us to support getting the trace identifiers
    from more than just datadog traces without adding yet more logic to the
    stack collector.
    ivoanjo committed Jun 28, 2021
    Configuration menu
    Copy the full SHA
    fb2a8af View commit details
    Browse the repository at this point in the history
  2. Add support for tagging profiles with opentelemetry trace identifiers

    We are now able to gather the trace identifiers from ongoing traces
    being done with the opentelemetry gems.
    
    Priority is still given to ddtrace traces, and we also take care to
    impact users that do not use opentelemetry.
    
    NOTE: I'm somewhat unsure about adding `opentelemetry-api` to the
          `Gemfile` vs adding it as an appraisal.
          All our current appraisals seem to be for tracing integrations,
          which is not the case, and we do already have an "opentelemetry"
          rake task that existed so it may be confusing to have it changed
          into an appraisal (or to have two) so I took the simplest route.
          Suggestions welcome!
    ivoanjo committed Jun 28, 2021
    Configuration menu
    Copy the full SHA
    6492eb9 View commit details
    Browse the repository at this point in the history
  3. Add minimum required version for opentelemetry support

    This avoids surprises if customers try to use an older version.
    ivoanjo committed Jun 28, 2021
    Configuration menu
    Copy the full SHA
    b3f8d28 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b690153 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    45db28f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b92dce5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    cbd3fbf View commit details
    Browse the repository at this point in the history
  8. Add support for OpenTelemetry 1.0.0.rc2

    In particular open-telemetry/opentelemetry-ruby#807
    changed some of the APIs we were using to get the current span for a
    thread.
    
    To test both 0.17.0 and this new version I moved
    opentelemetry to appraisals.
    ivoanjo committed Jun 28, 2021
    Configuration menu
    Copy the full SHA
    4622b38 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7f25f15 View commit details
    Browse the repository at this point in the history
  10. Dependency inject tracer instance into profiler

    As discussed during PR review of #1568, it's problematic to just cache
    whatever's in `Datadog.tracer` because we can observe the old value
    during component initialization.
    
    To break the loop, let's instead directly initialize the
    `TraceIdentifiers::Ddtrace` class with the correct tracer during
    component initialization.
    
    IMHO this has a further advantage: it makes it really explict where
    there is a tracer-to-profiler dependency whereas previously there was
    just a call to `Datadog.tracer` deep in the bowels of the profiler that
    could be called at any point.
    ivoanjo committed Jun 28, 2021
    Configuration menu
    Copy the full SHA
    f6711e2 View commit details
    Browse the repository at this point in the history