Skip to content
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

profiler: enable endpoint call counts by default #2590

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

felixge
Copy link
Member

@felixge felixge commented Mar 1, 2024

DO NOT MERGE YET

What does this PR do?

Enables #1552 by default for profiling+tracing users. This adds a small critical section updating counters in a map in the span creation hot path. But the impact of this is not measurable in our span creation benchmarks (both concurrent and single goroutine flavors) as demonstrated by this PR.

The absolute worst-case estimate I have is an additional latency of ~150ns/span under a maximum contention that is probably 10-100x worse than anything that can be achieved in the real world. Without contention this feature should add ~20ns latency per span (~1%). See this gist for more details.

Motivation

Provides a way to measure the CPU Time per Request which is very useful for evaluating the impact of profile guided optimization.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

For Datadog employees:

  • If this PR touches code that handles credentials of any kind, such as Datadog API keys, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@pr-commenter
Copy link

pr-commenter bot commented Mar 1, 2024

Benchmarks

Benchmark execution time: 2024-03-01 07:39:45

Comparing candidate commit 4233c7c in PR branch felix.geisendoerfer/PROF-8816-enable-unit-of-work-by-default with baseline commit 5762cf1 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 42 metrics, 2 unstable metrics.

@felixge
Copy link
Member Author

felixge commented Mar 1, 2024

Note: PR #1845 disabled BenchmarkConcurrentTracing due to reliability issues. I think that has created a gap in our ability to detect regressions related to contention problems. Going forward, PRs disabling benchmarks due to reliability issues should provide some breadcrumbs to understand what the problems were.

@felixge
Copy link
Member Author

felixge commented Mar 1, 2024

Note: I checked the output of the benchmark pipeline and verified that BenchmarkConcurrentTracing was tested and also downloaded the results to sanity check the conclusion: There is no measurable difference here.

image

Copy link

This PR is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Stuck for more than 1 month label Mar 22, 2024
Copy link

This PR was closed because it has been open for 30 days with no activity.

@github-actions github-actions bot closed this Apr 21, 2024
@felixge felixge reopened this Apr 21, 2024
@felixge felixge removed the stale Stuck for more than 1 month label Apr 21, 2024
Copy link

This PR is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Stuck for more than 1 month label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stuck for more than 1 month
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant