dd-trace-php
dd-trace-php copied to clipboard
feat: OpenAI Integration
Description
TBC
GL reviewing
Reviewer checklist
- [ ] Test coverage seems ok.
- [ ] Appropriate labels assigned.
Benchmarks
Benchmark execution time: 2024-07-19 22:47:29
Comparing candidate commit 841220b85e687f167512be07f2103b613994e5b7 in PR branch alex/feat/openai with baseline commit 5fe1c5ae9ff97ecc011135fdd0ddddb0452c1cbc in branch master.
Found 3 performance improvements and 48 performance regressions! Performance is the same for 127 metrics, 0 unstable metrics.
scenario:ComposerTelemetryBench/benchTelemetryParsing
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:ContextPropagationBench/benchExtractHeaders128Bit
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.418%; +3.418%]
scenario:ContextPropagationBench/benchExtractHeaders64Bit
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.418%; +3.418%]
scenario:ContextPropagationBench/benchExtractTraceContext128Bit
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.418%; +3.418%]
scenario:ContextPropagationBench/benchExtractTraceContext64Bit
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.418%; +3.418%]
scenario:ContextPropagationBench/benchInject128Bit
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.418%; +3.418%]
scenario:ContextPropagationBench/benchInject64Bit
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.418%; +3.418%]
scenario:ContextPropagationBench/benchInject64Bit-opcache
- π₯
execution_time[+186.587ns; +415.413ns] or [+2.535%; +5.645%]
scenario:EmptyFileBench/benchEmptyFileBaseline
- π₯
mem_peak[+246.024KB; +246.024KB] or [+5.721%; +5.721%]
scenario:EmptyFileBench/benchEmptyFileOverhead
- π₯
mem_peak[+246.024KB; +246.024KB] or [+5.721%; +5.721%]
scenario:HookBench/benchHookOverheadInstallHookOnFunction
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.418%; +3.418%]
scenario:HookBench/benchHookOverheadInstallHookOnMethod
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.418%; +3.418%]
scenario:HookBench/benchHookOverheadTraceFunction
- π₯
mem_peak[+107.480KB; +107.480KB] or [+3.282%; +3.282%]
scenario:HookBench/benchHookOverheadTraceMethod
- π₯
mem_peak[+107.479KB; +107.482KB] or [+3.219%; +3.219%]
scenario:HookBench/benchWithoutHook
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:LaravelBench/benchLaravelBaseline
- π₯
mem_peak[+246.056KB; +246.056KB] or [+5.720%; +5.720%]
scenario:LaravelBench/benchLaravelOverhead
- π₯
mem_peak[+246.056KB; +246.056KB] or [+5.720%; +5.720%]
scenario:LogsInjectionBench/benchLogsInfoBaseline
- π₯
mem_peak[+135.288KB; +135.288KB] or [+3.859%; +3.859%]
scenario:LogsInjectionBench/benchLogsInfoInjection
- π₯
mem_peak[+139.264KB; +139.264KB] or [+3.949%; +3.949%]
scenario:LogsInjectionBench/benchLogsNullBaseline
- π₯
mem_peak[+135.288KB; +135.288KB] or [+3.859%; +3.859%]
scenario:LogsInjectionBench/benchLogsNullInjection
- π₯
mem_peak[+139.320KB; +139.320KB] or [+3.947%; +3.947%]
scenario:MessagePackSerializationBench/benchMessagePackSerialization
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.321%; +3.321%]
scenario:PDOBench/benchPDOBaseline
- π₯
mem_peak[+71.632KB; +71.632KB] or [+2.047%; +2.047%]
scenario:PDOBench/benchPDOOverhead
- π₯
execution_time[+7.473Β΅s; +16.463Β΅s] or [+2.739%; +6.034%] - π₯
mem_peak[+135.318KB; +135.321KB] or [+3.217%; +3.217%]
scenario:PDOBench/benchPDOOverhead-opcache
- π₯
mem_peak[+125.248KB; +125.248KB] or [+5.964%; +5.964%] - π©
execution_time[-10.465Β΅s; -8.390Β΅s] or [-3.512%; -2.815%]
scenario:PDOBench/benchPDOOverheadWithDBM
- π₯
mem_peak[+135.318KB; +135.321KB] or [+3.172%; +3.172%]
scenario:PDOBench/benchPDOOverheadWithDBM-opcache
- π₯
mem_peak[+125.247KB; +125.250KB] or [+5.800%; +5.800%]
scenario:PHPRedisBench/benchRedisOverhead
- π₯
mem_peak[+135.335KB; +135.337KB] or [+2.675%; +2.675%]
scenario:PHPRedisBench/benchRedisOverhead-opcache
- π₯
mem_peak[+125.263KB; +125.266KB] or [+4.185%; +4.185%]
scenario:SamplingRuleMatchingBench/benchGlobMatching1
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:SamplingRuleMatchingBench/benchGlobMatching1-opcache
- π©
execution_time[-149.145ns; -71.655ns] or [-5.730%; -2.753%]
scenario:SamplingRuleMatchingBench/benchGlobMatching2
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:SamplingRuleMatchingBench/benchGlobMatching3
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:SamplingRuleMatchingBench/benchGlobMatching4
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:SamplingRuleMatchingBench/benchRegexMatching1
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:SamplingRuleMatchingBench/benchRegexMatching2
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:SamplingRuleMatchingBench/benchRegexMatching3
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:SamplingRuleMatchingBench/benchRegexMatching3-opcache
- π₯
execution_time[+202.523ns; +405.877ns] or [+3.177%; +6.366%]
scenario:SamplingRuleMatchingBench/benchRegexMatching4
- π₯
execution_time[+175.310ns; +401.690ns] or [+2.704%; +6.196%] - π₯
mem_peak[+107.144KB; +107.144KB] or [+3.419%; +3.419%]
scenario:SamplingRuleMatchingBench/benchRegexMatching4-opcache
- π₯
execution_time[+130.057ns; +358.743ns] or [+2.028%; +5.593%]
scenario:SymfonyBench/benchSymfonyBaseline
- π₯
mem_peak[+246.056KB; +246.056KB] or [+5.720%; +5.720%]
scenario:SymfonyBench/benchSymfonyOverhead
- π₯
mem_peak[+246.056KB; +246.056KB] or [+5.720%; +5.720%]
scenario:TraceAnnotationsBench/benchTraceAnnotationOverhead
- π₯
mem_peak[+107.480KB; +107.484KB] or [+3.211%; +3.211%]
scenario:TraceFlushBench/benchFlushTrace
- π₯
mem_peak[+135.256KB; +135.256KB] or [+3.699%; +3.699%]
scenario:TraceSerializationBench/benchSerializeTrace
- π₯
mem_peak[+107.144KB; +107.144KB] or [+3.418%; +3.418%] - π©
execution_time[-11.128Β΅s; -8.372Β΅s] or [-5.677%; -4.272%]
scenario:WordPressBench/benchWordPressBaseline
- π₯
mem_peak[+250.216KB; +250.216KB] or [+3.717%; +3.717%]
scenario:WordPressBench/benchWordPressOverhead
- π₯
mem_peak[+246.024KB; +246.024KB] or [+5.712%; +5.712%]
I'd like to discuss the DatadogLogger, and would like to know if this needs to be done this way.
At a glance, I'm not particularly fond of it. I don't mind having logging. But I think the extension should expose an API to log messages, rather than having a custom logger written in PHP. Which then get sent to the right location, can be forwarded to the sidecar, possibly for logging telemetry and such in future.
Codecov Report
Attention: Patch coverage is 94.68713% with 45 lines in your changes missing coverage. Please review.
Project coverage is 78.62%. Comparing base (
5fe1c5a) to head (841220b).
Additional details and impacted files
@@ Coverage Diff @@
## master #2685 +/- ##
============================================
+ Coverage 77.97% 78.62% +0.65%
- Complexity 2216 2459 +243
============================================
Files 228 230 +2
Lines 26951 27794 +843
Branches 989 989
============================================
+ Hits 21015 21853 +838
- Misses 5410 5415 +5
Partials 526 526
| Flag | Coverage Ξ | |
|---|---|---|
| appsec-extension | 69.19% <ΓΈ> (ΓΈ) |
|
| tracer-extension | 78.82% <100.00%> (+<0.01%) |
:arrow_up: |
| tracer-php | 82.13% <94.64%> (+1.57%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files | Coverage Ξ | |
|---|---|---|
| ext/configuration.h | 100.00% <ΓΈ> (ΓΈ) |
|
| ext/git.c | 74.29% <100.00%> (+0.12%) |
:arrow_up: |
| ext/integrations/integrations.c | 91.25% <100.00%> (+0.14%) |
:arrow_up: |
| ext/startup_logging.c | 86.06% <ΓΈ> (ΓΈ) |
|
| src/api/Log/InterpolateTrait.php | 77.77% <100.00%> (+77.77%) |
:arrow_up: |
| src/bridge/_files_tracer.php | 100.00% <100.00%> (ΓΈ) |
|
| src/api/Log/DatadogLogger.php | 80.00% <80.00%> (ΓΈ) |
|
| .../DDTrace/Integrations/OpenAI/OpenAIIntegration.php | 96.50% <96.50%> (ΓΈ) |
... and 1 file with indirect coverage changes
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Ξ = absolute <relative> (impact),ΓΈ = not affected,? = missing dataPowered by Codecov. Last update 5fe1c5a...841220b. Read the comment docs.