Skip to content
Merged
Changes from 3 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
3 changes: 3 additions & 0 deletions datadog_lambda/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ def _reset(self):
"enabled" if config.fips_mode_enabled else "not enabled",
)

# disable css by default to prevent double counting in lambda
if "DD_TRACE_COMPUTE_STATS" not in os.environ:
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.

Should we ignore this ENV even it's set ? we can generate a warning if we found it's set to true and tell the customer this should always be off?

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.

The warning is a good idea though I dont think we should block the option completely. If the user sees the warning they can choose whether or not to ignore it. I think @happynancee had the same idea

os.environ["DD_TRACE_COMPUTE_STATS"] = "false"
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.

Do both DD_TRACE_COMPUTE_STATS and DD_TRACE_STATS_COMPUTATION_ENABLED work in Python? If so, I would consider setting DD_TRACE_STATS_COMPUTATION_ENABLED=false since that's the more standard one across all the tracers.

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.

Sounds good. Theyre essentially used as aliases in the python tracer.

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.

Is there any reason we'd want to allow users to enable client-side stats? If not, we should just set this env var always.

Copy link
Copy Markdown
Contributor

@joeyzhao2018 joeyzhao2018 Mar 23, 2026

Choose a reason for hiding this comment

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

following up on whether we should or should not allow customers to set it.
This actually makes a difference. ENVs or configurations are not created for all environments and platforms. It is a common practice to always turn specific ENVs off in specific environments. This is one of those cases. We literally don't want to grant customers the freedom to choose here... because it doesn't work...

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.

very good points. I'll just invariably set the env then


if (
"DD_INSTRUMENTATION_TELEMETRY_ENABLED" not in os.environ
Expand Down
Loading