DataDog / dd-trace-go

Datadog Go Library including APM tracing, profiling, and security monitoring.
https://docs.datadoghq.com/tracing/
Other
653 stars 436 forks source link

datadog trace retention time? #2853

Open zdyj3170101136 opened 2 weeks ago

zdyj3170101136 commented 2 weeks ago

In Datadog's trace tail sampling strategy (https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/), whether to sample depends on whether the trace has p99 latency, etc.

I assume that this may be implemented by saving each trace in memory by traceid, and then judging after a period of time.

How long will the trace be retained in memory?

mtoffl01 commented 2 weeks ago

Hi @zdyj3170101136 , I'm not sure I'm following: the doc you linked to describes our Trace Retention policies (that is, how long a trace is retained in the Datadog platform, once it has already been ingested/"sampled").

Our standard retention period for traces in the Datadog platform is 15 days.

Please clarify your question if I have not already answered it above. Thanks!

zdyj3170101136 commented 2 weeks ago

你好@zdyj3170101136, 我不确定我是否理解:您链接到的文档描述了我们的跟踪保留策略(即,一旦跟踪被摄取/“采样”,它会在 Datadog 平台中保留多长时间)。

Datadog 平台上的痕迹的标准保留期为 15 天。

如果我上面没有回答,请澄清你的问题。谢谢!

i wonder how much time it would retain in memory.

if i have a long trace, the first span is 1 days ago and last span is current, would it be store by p99 policy?

mtoffl01 commented 1 week ago

Generally speaking, the client will retain a trace until all spans in the trace have completed. Once all spans in the trace have completed, the client pushes the trace onto the buffer to be written out to the agent. The client flushes traces to the agent at an interval of 2s.

I'm not sure what "p99 policy" you're referring to; the only p99 calculation relating to traces that I can think of is the DDSketch metrics for span duration, which is not computed in the tracer.