Skip to content

[APMSVLS-433] Disable DD_TRACE_STATS_COMPUTATION_ENABLED by default#1186

Merged
purple4reina merged 2 commits into
DataDog:mainfrom
eunskin:disable-client-compute-stats
Apr 24, 2026
Merged

[APMSVLS-433] Disable DD_TRACE_STATS_COMPUTATION_ENABLED by default#1186
purple4reina merged 2 commits into
DataDog:mainfrom
eunskin:disable-client-compute-stats

Conversation

@eunskin

@eunskin eunskin commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Overview

We have confirmed that Java now has enabled client-side stats by default. This should be disabled.

The datadog_wrapper file is where we should add this configuration env var. datadog-lambda-extension/scripts/datadog_wrapper at 1454b861409ff49478c25cc5ece68efb46374add · DataDog/datadog-lambda-extension It is the script that is run prior to the execution of a lambda function. We will want to set DD_TRACE_STATS_COMPUTATION_ENABLED=false.

We should do this globally in that file, as opposed to just for Java, since eventually we will need it from dotnet as well.

Testing

1. Java lambda function e2e testing app

  • CASE 1: DD_TRACE_STATS_COMPUTATION_ENABLED not configured in AWS UI
    • tracerMetricsEnabled=false in tracer debug logs
  • CASE 2: DD_TRACE_STATS_COMPUTATION_ENABLED=true configured in AWS UI
    • tracerMetricsEnabled=true in tracer debug logs

2. .NET lambda function e2e testing app

  • CASE 1: DD_TRACE_STATS_COMPUTATION_ENABLED not configured in AWS UI
    • "stats_computation_enabled": false in tracer debug logs
  • CASE 2: DD_TRACE_STATS_COMPUTATION_ENABLED=true configured in AWS UI
    • "stats_computation_enabled": true in tracer debug logs

Copilot AI review requested due to automatic review settings April 15, 2026 07:14
@eunskin
eunskin requested a review from a team as a code owner April 15, 2026 07:14
@eunskin
eunskin requested a review from jchrostek-dd April 15, 2026 07:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Lambda scripts/datadog_wrapper to disable client-side trace stats computation by default (while still allowing users to explicitly enable it), addressing the recent change where Java enables client-side stats by default.

Changes:

  • Sets DD_TRACE_STATS_COMPUTATION_ENABLED to false by default via shell parameter expansion.
  • Adds a debug log line to print the resolved DD_TRACE_STATS_COMPUTATION_ENABLED value.

Comment thread scripts/datadog_wrapper Outdated
Comment on lines +47 to +48
# Disable DD_TRACE_STATS_COMPUTATION_ENABLED by default for Java and .NET runtimes
export DD_TRACE_STATS_COMPUTATION_ENABLED="${DD_TRACE_STATS_COMPUTATION_ENABLED:-false}"

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says this default is for Java and .NET runtimes, but the export is applied unconditionally (i.e., for any runtime that uses this wrapper). Either update the comment to reflect that it’s set globally, or move the export into the Java/.NET runtime branches so the behavior matches the comment.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want this globally, so it's just the comment above that needs to be fixed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @lucaspimentel, I updated the comments. Thank you for reviewing!

@duncanista

duncanista commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Description is confusing, we mention needing it globally, but we are specifically testing only in Java and .NET.

Also mentions that we might need it in the future in .NET, what about other runtimes?

Essentially, whoever uses this wrapper, it will disable it, so anyone using it for ASM in any other runtime would get affected by this

@eunskin eunskin closed this Apr 22, 2026
@eunskin eunskin reopened this Apr 22, 2026
@eunskin

eunskin commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

Hello @duncanista,
Thank you for reviewing.
I updated the comments since this affects all runtime platforms and the ASM.

@eunskin
eunskin force-pushed the disable-client-compute-stats branch from 356d460 to f603b99 Compare April 23, 2026 01:03
@eunskin
eunskin force-pushed the disable-client-compute-stats branch 3 times, most recently from 2078b16 to a931278 Compare April 24, 2026 07:03
@eunskin
eunskin force-pushed the disable-client-compute-stats branch from a931278 to 3f52ebb Compare April 24, 2026 07:07
@purple4reina
purple4reina merged commit e8bf40c into DataDog:main Apr 24, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants