DataDog/dd-trace-js

MANUAL_KEEP broken with 5.25.0

Opened this issue · 1 comments

Hey, dd-trace version 5.25.0 removed MANUAL_KEEP, and now we are missing a lot of traces.

This seems to be a bug, because the feature still exists in the docs: https://docs.datadoghq.com/tracing/trace_pipeline/ingestion_mechanisms/?tab=java&code-lang=nodejs#force-keep-and-drop

Is this supposed to be deprecated?

Maybe it's not clear enough what I mean? We use it like this:

import tracer from "./../utils/tracer";
import { Span } from "dd-trace";
import { MANUAL_KEEP } from "dd-trace/ext/tags";

private keepApmSpan(): void {
        const scope = tracer.scope();

        if (scope) {
            const span = scope.active();

            if (span) {
                const rootSpan = (span.context() as any)._trace.started[0] as Span;

                if (rootSpan) {
                    const tags: Record<string, unknown> = {};

                    tags[MANUAL_KEEP] = true;
                    rootSpan.addTags(tags);
                }
            }
        }
    }

But the spans are not actually kept, Datadog shows no more ingress of these spans.