Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,21 @@ public static Writer createWriter(
final RemoteApi remoteApi =
createDDIntakeRemoteApi(config, commObjects, featuresDiscovery, trackType);

// In Lambda the execution environment can freeze as soon as the handler returns, before
// this writer's periodic flush timer next fires -- flush synchronously so buffered events
// (e.g. LLM Observability spans) aren't lost when that happens.
boolean alwaysFlush =
config.isAgentConfiguredUsingDefault()
&& ServerlessInfo.get().isRunningInServerlessEnvironment();

DDIntakeWriter.DDIntakeWriterBuilder builder =
DDIntakeWriter.builder()
.addTrack(trackType, remoteApi)
.prioritization(prioritization)
.healthMetrics(healthMetrics)
.monitoring(commObjects.monitoring)
.singleSpanSampler(singleSpanSampler)
.alwaysFlush(alwaysFlush)
.flushIntervalMilliseconds(flushIntervalMilliseconds);

if (config.isCiVisibilityEnabled()) {
Expand Down
Loading