elastic-otel-php/ (EDOT repo)
├── upstream/ (git submodule → opentelemetry-php-distro, pinned to tag)
├── elastic/
│ ├── native/libelastic/ (C++ static lib: ElasticVendor, ElasticConfigProvider)
│ └── php/ (bootstrap_elastic.php wrapper)
├── packaging/ (EDOT packaging: nfpm.yaml, post-install.sh, smoke tests)
├── tools/ (EDOT build scripts, thin wrappers to upstream)
└── elastic-otel-php.properties (EDOT version only; build params from upstream)
Goal
Replace EDOT's forked native + PHP code with upstream
opentelemetry-php-distroas a git submodule.Zero merge conflicts on upstream updates. Elastic customizations live in
elastic/directory only.Architecture
Key Patterns
VendorCustomizationsInterfaceweak symbol —libelastic.alinked withWHOLE_ARCHIVECMAKE_PROJECT_INCLUDEinjection — upstream builds normally, elastic lib injectedbootstrap_elastic.phpmapsELASTIC_OTEL_*env vars →OTEL_PHP_*, then delegates to upstreambootstrap_php_part.phpElasticConfigProvidermaps 30+ELASTIC_OTEL_*env vars → upstream option names (C++ side)OTelDistroScoped\prefix) — EDOT just calls upstream'sbuild_php_deps.shPhases
Phase 1: Submodule + Directory Structure ✅
Phase 2: Native Vendor Library ✅
Phase 3: PHP Bootstrap Wrapper ✅
Phase 4: Build & Packaging Tooling ✅
#363
Phase 5: Testing & Verification ✅
#364
Phase 6: Cleanup ✅
#365
Phase 7: CI Workflows ✅
#366
Phase 8: Long-term (upstream PRs) ✅
Phase 9: Update documentation
#373
#375