Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions datadog_lambda/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,3 @@ def _reset(self):
# unset css aliases to ensure it is disabled
if "DD_TRACE_COMPUTE_STATS" in os.environ:
del os.environ["DD_TRACE_COMPUTE_STATS"]

if (
"DD_INSTRUMENTATION_TELEMETRY_ENABLED" not in os.environ
and not config.sca_enabled
and not config.appsec_enabled
):
os.environ["DD_INSTRUMENTATION_TELEMETRY_ENABLED"] = "false"
5 changes: 5 additions & 0 deletions datadog_lambda/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

from ddtrace import patch
from ddtrace import __version__ as ddtrace_version
from ddtrace.internal.telemetry import telemetry_writer
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.

I recall that importing the telemetry writer added a bunch of cold start time. Did you happen to check to see what impact it's had this time around?

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.

I haven't, though the impact is expected to be reduced by the changes from the RFC. Is there a benchmark somewhere in CI that you'd look at to validate this?

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.

It doesn't look like we have any on this repo, at least none that I can easily find. Is this the only change required to enable instrumentation telemetry? I can get a manual test going.

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.

Yes I believe it is

from ddtrace.propagation.http import HTTPPropagator
from ddtrace.trace import Context, Span, tracer

Expand Down Expand Up @@ -1509,6 +1510,10 @@ def create_function_execution_span(
pointer_hash=span_pointer_description.pointer_hash,
extra_attributes=span_pointer_description.extra_attributes,
)

if is_cold_start:
telemetry_writer.periodic(force_flush=True)

return span


Expand Down
Loading