Always track long running traces when feature is enabled, regardless of agent support #10311
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Does This Do
Currently, the tracer will silently drop long running traces--even if the feature is enabled--when it can't connect to an agent or when the agent doesn't support the long running traces feature.
Motivation
Previously the long running traces buffer would always be empty, even though the feature was enabled with
dd.trace.experimental.long-running.enabled=true. This led to a good amount of confusion when I was initially developing a feature to dump long running traces without a local Datadog Agent running.Additional Notes
This was originally part of #9874, which is being broken out into a few individual PRs.
Commit notes:
features.supportsLongRunning()is false, the traces are kept in theTRACKEDstate, compared to theNOT_TRACKEDstate and then immediately removed withcleanSlot, previously.Assuming #10309 is merged, the only remaining case where a metric isn't tracked is when an entry is removed from the tracker is when the trace list is empty:
If this case is desired to have a metric, let me know, and I'll add it (
long-running.completed??). That would cover every single case where a trace is removed from the tracker.Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]