Skip to content

Conversation

anmarchenko
Copy link
Member

@anmarchenko anmarchenko commented Nov 29, 2023

What does this PR do?
Couple of small but important fixes regarding CI mode configuration:

  • currently when using manual API and setting settings.ci.enabled to false (when running tests locally) leads to a complete failure because @ci_recorder is nil. Now we are creating the recorder in disabled state in this case to stop tracing but preserving the behaviour.
    • In order to make it more bearable without adding null checks everywhere a new span type is provided - NullSpan which is an implementation of NullObject pattern.
  • we will disable test suite level visibility always when we detect old agent version that does not support event protocol

How to test the change?
Unit tests are provided

@anmarchenko anmarchenko changed the title Anmarchenko/do_not_trace_when_ci_disabled Skip tracing when CI mode disabled and manual API is used Nov 29, 2023
@anmarchenko anmarchenko marked this pull request as ready for review November 29, 2023 14:11
@anmarchenko anmarchenko requested review from a team and tonyredondo November 29, 2023 14:11
@romainkomorn-exdatadog
Copy link

Are null spans dropped by the tracer's "writer" (whatever the component that actually sends span data to our intakes is called in the Ruby tracer)?

@anmarchenko
Copy link
Member Author

Are null spans dropped by the tracer's "writer" (whatever the component that actually sends span data to our intakes is called in the Ruby tracer)?

Datadog's internal Tracer does not know anything about them, they are just created in place to avoid NullPointerException, so they are not kept in any context and are not submitted anywhere

@anmarchenko anmarchenko merged commit 0a0deb8 into main Nov 29, 2023
@anmarchenko anmarchenko deleted the anmarchenko/do_not_trace_when_ci_disabled branch November 29, 2023 14:44
@github-actions github-actions bot added this to the 0.5.0 milestone Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants