Skip to content

Use OpenTelemetry PHP distro as Elastic Distribution of OpenTelemetry for PHP #352

Description

@intuibase

Goal

Replace EDOT's forked native + PHP code with upstream opentelemetry-php-distro as a git submodule.
Zero merge conflicts on upstream updates. Elastic customizations live in elastic/ directory only.

Architecture

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)

Key Patterns

  • Native: VendorCustomizationsInterface weak symbol — libelastic.a linked with WHOLE_ARCHIVE
  • CMake: CMAKE_PROJECT_INCLUDE injection — upstream builds normally, elastic lib injected
  • PHP: bootstrap_elastic.php maps ELASTIC_OTEL_* env vars → OTEL_PHP_*, then delegates to upstream bootstrap_php_part.php
  • Config: ElasticConfigProvider maps 30+ ELASTIC_OTEL_* env vars → upstream option names (C++ side)
  • Scoping: Upstream handles php-scoper (OTelDistroScoped\ prefix) — EDOT just calls upstream's build_php_deps.sh

Phases

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions