Skip to content

perf(telemetry): batch telemetry events into one request #13354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
11 changes: 6 additions & 5 deletions benchmarks/ddtrace_run/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ def run(self):
env["DD_RUNTIME_METRICS_ENABLED"] = str(self.runtimemetrics)
env["DD_APPSEC_ENABLED"] = str(self.appsec)

if self.telemetry:
# Force app started event, this is needed for telemetry to be enabled
# immediately after the process starts to avoid the 10 second delay.
env["_DD_INSTRUMENTATION_TELEMETRY_TESTS_FORCE_APP_STARTED"] = "true"

# initialize subprocess args
subp_cmd = []
code = "import ddtrace; ddtrace._monkey._patch_all()\n"
Expand All @@ -29,7 +34,7 @@ def run(self):

if self.http:
# mock requests to the trace agent before starting services
env["DD_TRACE_API_VERSION"] = "v0.4"
env["DD_TRACE_API_VERSION"] = "v0.5"
code += """
import httpretty
from ddtrace.trace import tracer
Expand All @@ -41,10 +46,6 @@ def run(self):
# profiler will collect snapshot during shutdown
httpretty.register_uri(httpretty.POST, '%s/%s' % (tracer.agent_trace_url, 'profiling/v1/input'))
"""

if self.telemetry:
code += "telemetry_writer.enable()\n"

if self.tracing:
code += "span = tracer.trace('test-x', service='bench-test'); span.finish()\n"

Expand Down
6 changes: 6 additions & 0 deletions benchmarks/startup/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ import_ddtrace_auto_django:
<<: *defaults
import_ddtrace_auto: true
import_django: true
import_ddtrace_auto_start_telemetry:
<<: *defaults
# By default telemetry collection is enabled after 10 seconds we need to force it to start immediately
# to detect the overhead.
env: {"_DD_INSTRUMENTATION_TELEMETRY_TESTS_FORCE_APP_STARTED": "true"}
import_ddtrace_auto: true
Loading
Loading