dd-trace-py icon indicating copy to clipboard operation
dd-trace-py copied to clipboard

chore(profiling): standardize class name propagation

Open sanchda opened this issue 2 years ago • 3 comments
trafficstars

Right now, class names are only propagated on the leaf frame of a stack, and only then as a label. This is unlike our other profilers and is also impeding progress on related products.

This PR changes the names so they are sent as class_name.function_name, which is slightly more consistent.

Checklist

  • [X] Change(s) are motivated and described in the PR description.
  • [X] Testing strategy is described if automated tests are not included in the PR.
  • [X] Risk is outlined (performance impact, potential for breakage, maintainability, etc).
  • [X] Change is maintainable (easy to change, telemetry, documentation).
  • [X] Library release note guidelines are followed. If no release note is required, add label changelog/no-changelog.
  • [X] Documentation is included (in-code, generated user docs, public corp docs).
  • [X] Backport labels are set (if applicable)

Reviewer Checklist

  • [x] Title is accurate.
  • [x] No unnecessary changes are introduced.
  • [x] Description motivates each change.
  • [x] Avoids breaking API changes unless absolutely necessary.
  • [x] Testing strategy adequately addresses listed risk(s).
  • [x] Change is maintainable (easy to change, telemetry, documentation).
  • [x] Release note makes sense to a user of the library.
  • [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment.
  • [x] Backport labels are set in a manner that is consistent with the release branch maintenance policy
  • [x] If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • [x] This PR doesn't touch any of that.

sanchda avatar Nov 15 '23 20:11 sanchda

Benchmarks

Benchmark execution time: 2023-11-29 22:07:57

Comparing candidate commit fa010352529fa57c1bcf25ec0c58e64a0737ecff in PR branch sanchda/fix_profiler_classnames with baseline commit 67c5ec7a4c397199014823f649a810c708a6113d in branch 2.x.

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

scenario:flasksimple-appsec-get

  • 🟩 max_rss_usage [-1.158MB; -0.975MB] or [-3.225%; -2.718%]

scenario:flasksimple-appsec-post

  • 🟩 max_rss_usage [-1.218MB; -1.011MB] or [-3.388%; -2.813%]

scenario:flasksimple-appsec-telemetry

  • 🟩 max_rss_usage [-1.822MB; -1.672MB] or [-5.061%; -4.646%]

scenario:flasksimple-baseline

  • 🟩 max_rss_usage [-1.172MB; -1.032MB] or [-3.260%; -2.869%]

scenario:flasksimple-debugger

  • 🟩 execution_time [-229.504µs; -134.514µs] or [-3.554%; -2.083%]
  • 🟩 max_rss_usage [-1.227MB; -1.031MB] or [-3.412%; -2.868%]

scenario:flasksimple-iast-get

  • 🟩 max_rss_usage [-1.167MB; -1.004MB] or [-3.248%; -2.793%]

scenario:flasksimple-profiler

  • 🟩 max_rss_usage [-1.282MB; -1.081MB] or [-3.563%; -3.004%]

scenario:flasksimple-tracer

  • 🟩 max_rss_usage [-1.198MB; -1.023MB] or [-3.332%; -2.847%]

scenario:span-add-metrics

  • 🟩 max_rss_usage [-20.803MB; -20.685MB] or [-33.199%; -33.010%]

pr-commenter[bot] avatar Nov 15 '23 22:11 pr-commenter[bot]

Nice! I always found it strange not to see the class name in there.

r1viollet avatar Nov 16 '23 13:11 r1viollet

Is this good to merge then?

albertvaka avatar Nov 28 '23 22:11 albertvaka