dd-trace-php
dd-trace-php copied to clipboard
feat: Source Code Integration
TODO
- [ ] Check system-tests
Description
Add three environment variables:
DD_GIT_REPOSITORY_URLstring, default: emptyDD_GIT_COMMIT_SHAstring, default: emptyDD_TRACE_GIT_METADATA_ENABLEDbool, default: true
Add following steps:
- Check if
DD_TRACE_GIT_METADATA_ENABLEDis True. - Check if git metadata is already provided by environment variables:
- Check
DD_GIT_REPOSITORY_URLandDD_GIT_COMMIT_SHA, if they exist, use metadata from them. - Check
DD_TAGS, if it contains git.repository_url and git.commit.sha, use metadata from them.
- Check
- Exract git metadata from the
git~binary~ HEAD/refs/config files
Add metadata tags to the first span of each chunk:
_dd.git.repository_urlfor repository URL_dd.git.commit.shafor commit hash
Reviewer checklist
- [ ] Test coverage seems ok.
- [ ] Appropriate labels assigned.
Benchmarks
Benchmark execution time: 2024-07-19 14:26:13
Comparing candidate commit f69e3a9ef0ae656679b5dc21022872de7cc6caf7 in PR branch alex/feat/source_code_integration with baseline commit ce7d3a5fca2cfa6a4b32fcaf09896d22287122b8 in branch master.
Found 2 performance improvements and 4 performance regressions! Performance is the same for 172 metrics, 0 unstable metrics.
scenario:EmptyFileBench/benchEmptyFileOverhead
- 🟩
execution_time[-197.237µs; -75.483µs] or [-7.205%; -2.758%]
scenario:LogsInjectionBench/benchLogsInfoInjection
- 🟩
execution_time[-370.989ns; -192.411ns] or [-4.221%; -2.189%]
scenario:PDOBench/benchPDOOverheadWithDBM
- 🟥
execution_time[+7.377µs; +15.061µs] or [+2.485%; +5.073%]
scenario:PHPRedisBench/benchRedisOverhead-opcache
- 🟥
mem_peak[+66.368KB; +66.368KB] or [+2.267%; +2.267%]
scenario:SpanBench/benchOpenTelemetryAPI
- 🟥
mem_peak[+898.812KB; +898.820KB] or [+2.737%; +2.737%]
scenario:SpanBench/benchOpenTelemetryAPI-opcache
- 🟥
mem_peak[+897.431KB; +897.440KB] or [+2.962%; +2.962%]
Codecov Report
Attention: Patch coverage is 78.43137% with 55 lines in your changes missing coverage. Please review.
Project coverage is 76.33%. Comparing base (
ce7d3a5) to head (f69e3a9). Report is 4 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #2731 +/- ##
============================================
- Coverage 79.52% 76.33% -3.19%
Complexity 2216 2216
============================================
Files 201 228 +27
Lines 22619 26899 +4280
Branches 0 989 +989
============================================
+ Hits 17987 20533 +2546
- Misses 4632 5840 +1208
- Partials 0 526 +526
| Flag | Coverage Δ | |
|---|---|---|
| appsec-extension | 69.19% <ø> (?) |
|
| tracer-extension | 78.80% <78.43%> (-0.01%) |
:arrow_down: |
| tracer-php | 75.78% <ø> (-4.77%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files | Coverage Δ | |
|---|---|---|
| ext/configuration.h | 100.00% <ø> (ø) |
|
| ext/ddtrace.c | 74.65% <100.00%> (+0.25%) |
:arrow_up: |
| ext/ddtrace.h | 62.50% <ø> (ø) |
|
| ext/ddtrace_arginfo.h | 100.00% <100.00%> (ø) |
|
| ext/serializer.c | 81.44% <100.00%> (+0.16%) |
:arrow_up: |
| ext/span.h | 100.00% <ø> (ø) |
|
| ext/git.c | 74.17% <74.17%> (ø) |
... and 30 files 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 ce7d3a5...f69e3a9. Read the comment docs.
Converting to draft until I add the new tests.