You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DB plugins] trigger sampling of span before injecting the trace parent comment (#6653)
* feat(database): trigger sampling of span before injecting the trace parent commment
The database plugins supported by the Database Monitoring require to
inject the trace parent as a comment into the query statement. The trace
parent to be fully valid need to contains the correct value for the
"sampled" flag. However, we used to be injecting the trace parent before
the decision to sample a span or not has been taken. Because of that,
all the trace parents injected had the sampled flag to 00.
This commits fix this issue by running the sampling decision before
injecting the comment when needed.
* test(database): use the correct value for trace parents in DBM comments
* test(span): test that the sample method is correctly calling the sampler
* refactor: update the dd-trace-api definition
* test(database): add test cases for when the span was not sampled
* refactor(span): remove public API to force span sampling
Instead, the span processor is called directly to trigger the sampling
decision
* test(database): configure tracer instead of mocking priority sampler
* test(database): reset tracer configuration in a afterEach clause
0 commit comments