DI: capture real positional parameter names in non-virtual method probes - #6114
DI: capture real positional parameter names in non-virtual method probes#6114p-datadog wants to merge 6 commits into
Conversation
Method-probe snapshots keyed captured positional arguments as arg1, arg2, ... because the prepend wrapper captures them as *args, losing the declared names. Recover the names at hook time via UnboundMethod#parameters (the same reflection the symbol database extractor uses), thread them through run_method_probe into the serializer, and key each positional argument by its real name. Arguments without an available name (generated methods, values absorbed by a splat, virtual/C methods) keep the arg-N label. Keyword arguments and self are unchanged. This also lets capture expressions reference positional parameters by their real names.
Typing analysisNote: Ignored files are excluded from the next sections.
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 2aaa948 | Docs | Datadog PR Page | Give us feedback! |
Omit the explicit StandardError class in the positional-parameter-name extraction rescue (rescue => e), fixing the standard/lint CI failure (bundle exec rubocop -D). Verified under gemfiles/ruby-4.0.gemfile: `bundle exec rubocop -D` reports no offenses and `bundle exec rake standard` passes. Co-Authored-By: Claude <noreply@anthropic.com>
…cs, RBS prefix - extract_positional_param_names: rescue Exception + reraise_if_fatal + telemetry (matches the DI catch-all convention used elsewhere in the file) - combine_args / serialize_args: full YARD param/return docs after signature change - instrumenter.rbs: ::UnboundMethod prefix
BenchmarksBenchmark execution time: 2026-07-28 18:10:44 Comparing candidate commit 2aaa948 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 1 unstable metrics.
|
What does this PR do?
Captures real positional parameter names in probes on explicitly defined methods (i.e. NOT method_missing / C code).
Motivation:
The
arg1etc. placeholders are not discoverable by customers.Change log entry
Yes. Dynamic Instrumentation: report positional method
argument names for methods explicitly defined in Ruby
Additional Notes:
Virtual methods (method_missing) and C code still doesn't reveal the argument names.
arg1etc. placeholders remain for those.How to test the change?
Unit and integration tests added