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

[IAST] Added IAST instrumentation category to ado net Reader integrations #6523

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

daniel-romano-DD
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD commented Jan 9, 2025

Summary of changes

Added Instrumentation category to AdoNetSignature attribute and set it to IAST for all ado net Reader integrations

Reason for change

IAST integrations were being active in non IAST scenarios

Implementation details

Default category was Tracer. Added the InstrumentationCategory field to the attribute and generate the call targets properly

Test coverage

None, to avoid build clutter (as discussed in the comments)

Other details

@daniel-romano-DD daniel-romano-DD added area:builds project files, build scripts, pipelines, versioning, releases, packages area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) area:asm-iast labels Jan 9, 2025
@daniel-romano-DD daniel-romano-DD requested review from a team as code owners January 9, 2025 10:48
@@ -288,7 +294,8 @@ internal class CommandExecuteScalarWithBehaviorAttribute : Attribute
[AdoNetTargetSignature(
MethodName = AdoNetConstants.MethodNames.Read,
ReturnTypeName = ClrNames.Bool,
CallTargetType = typeof(ReaderReadIntegration))]
CallTargetType = typeof(ReaderReadIntegration),
InstrumentationCategory = InstrumentationCategory.Iast)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know these are only used for Iast currently, but I think defaulting to Iast here is confusing when everything else is for Tracing by default.

I think we should rename these attributes to make it clear, e.g.

ReaderReadAttribute -> ReaderReadIastAttribute or IastReaderReadAttribute

As we'll need to create new attributes if we want to target tracing etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see your point.

@andrewlock
Copy link
Member

andrewlock commented Jan 9, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6523) - mean (69ms)  : 65, 73
     .   : milestone, 69,
    master - mean (69ms)  : 65, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6523) - mean (979ms)  : 961, 998
     .   : milestone, 979,
    master - mean (978ms)  : 956, 999
     .   : milestone, 978,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6523) - mean (108ms)  : 105, 111
     .   : milestone, 108,
    master - mean (108ms)  : 105, 110
     .   : milestone, 108,

    section CallTarget+Inlining+NGEN
    This PR (6523) - mean (680ms)  : 660, 700
     .   : milestone, 680,
    master - mean (675ms)  : 660, 691
     .   : milestone, 675,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6523) - mean (91ms)  : 89, 93
     .   : milestone, 91,
    master - mean (91ms)  : 89, 93
     .   : milestone, 91,

    section CallTarget+Inlining+NGEN
    This PR (6523) - mean (630ms)  : 614, 646
     .   : milestone, 630,
    master - mean (636ms)  : 619, 653
     .   : milestone, 636,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6523) - mean (195ms)  : 191, 200
     .   : milestone, 195,
    master - mean (194ms)  : 189, 199
     .   : milestone, 194,

    section CallTarget+Inlining+NGEN
    This PR (6523) - mean (1,106ms)  : 1082, 1130
     .   : milestone, 1106,
    master - mean (1,101ms)  : 1073, 1130
     .   : milestone, 1101,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6523) - mean (281ms)  : 277, 285
     .   : milestone, 281,
    master - mean (279ms)  : 274, 283
     .   : milestone, 279,

    section CallTarget+Inlining+NGEN
    This PR (6523) - mean (873ms)  : 848, 898
     .   : milestone, 873,
    master - mean (875ms)  : 846, 904
     .   : milestone, 875,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6523) - mean (269ms)  : 265, 273
     .   : milestone, 269,
    master - mean (267ms)  : 262, 272
     .   : milestone, 267,

    section CallTarget+Inlining+NGEN
    This PR (6523) - mean (850ms)  : 823, 876
     .   : milestone, 850,
    master - mean (854ms)  : 820, 889
     .   : milestone, 854,

Loading

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 9, 2025

Datadog Report

Branch report: dani/iast/adonet_calltarget_categories
Commit report: 31d893a
Test service: dd-trace-dotnet

✅ 0 Failed, 602005 Passed, 4983 Skipped, 48h 1m 38.15s Total Time

@daniel-romano-DD daniel-romano-DD merged commit cb4647c into master Jan 9, 2025
63 of 68 checks passed
@daniel-romano-DD daniel-romano-DD deleted the dani/iast/adonet_calltarget_categories branch January 9, 2025 18:29
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm-iast area:builds project files, build scripts, pipelines, versioning, releases, packages area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants