Skip to content

Use OpenTelemetry PHP distro as Elastic Distribution of OpenTelemetry for PHP (#352)#367

Merged
intuibase merged 31 commits into
elastic:mainfrom
intuibase:upstream2edot
Apr 28, 2026
Merged

Use OpenTelemetry PHP distro as Elastic Distribution of OpenTelemetry for PHP (#352)#367
intuibase merged 31 commits into
elastic:mainfrom
intuibase:upstream2edot

Conversation

@intuibase

@intuibase intuibase commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Rebase EDOT PHP on upstream opentelemetry-php-distro as git submodule

Restructures EDOT PHP to use opentelemetry-php-distro as a git submodule (upstream/), keeping all Elastic-specific customizations isolated in elastic_prod/ and elastic_tests/ directories. This eliminates duplicated upstream files and establishes a clean separation between upstream code and EDOT extensions.

Architecture

  • upstream/ — git submodule pointing to opentelemetry-php-distro (v0.3.0)
  • elastic_prod/ — Elastic-only production code (native C++ vendor layer, PHP bootstrap, OpAMP config, vendor customizations)
  • elastic_tests/ — test patch system for modifying upstream tests at runtime
  • Thin wrappers — EDOT build/test scripts delegate to upstream equivalents via cd upstream

Key changes

New Elastic-specific code (elastic_prod/):

  • bootstrap_elastic.php — env var mapping (ELASTIC_OTEL_*OTEL_PHP_*), class_alias bridging for OTelDistroScoped\ namespace, vendor/consumer registration
  • ElasticVendorCustomizations.php.template — distro name/version identity
  • ElasticRemoteConfigParser.php — self-contained OpAMP config parser with bug fixes (stale putenv in PHP-FPM, $_SERVER vs getenv() resolution order)
  • ElasticRemoteConfigConsumer.php — remote config consumer implementation
  • Native C++ layer: ElasticVendor, ElasticConfigProvider, CMake injection via elastic_vendor_inject.cmake

Test patch system (elastic_tests/patch/):

  • apply.sh / revert.sh — applies/reverts *.patch files to upstream before/after component tests
  • Distinguishes "already applied" from real errors (malformed patch fails the build)
  • SdkDistroAttributesTest.patch — adjusts upstream test to validate EDOT distro attributes

Removed duplicate files:

  • All upstream PHP source copies (prod/php/, tests/)
  • Duplicate build tools (tools/build/*.php, tools/build/*.sh)
  • Duplicate test infrastructure (tools/test/component/*, docker/otel-tests/)
  • Generated composer lock files
  • Redundant packaging configs

Updated CI workflows:

  • All actions/checkout steps include submodules: recursive
  • Build/test workflows reference upstream paths or use cd upstream delegation
  • Snyk/license scans adjusted for new directory structure

Comment thread elastic_prod/php/Elastic/OTel/OpAmp/ElasticRemoteConfigParser.php
Comment thread elastic_prod/php/Elastic/OTel/OpAmp/ElasticRemoteConfigParser.php
Comment thread elastic_prod/php/Elastic/OTel/OpAmp/ElasticRemoteConfigParser.php
Comment thread elastic_prod/php/Elastic/OTel/OpAmp/ElasticRemoteConfigParser.php
Comment thread elastic/php/Elastic/OTel/OpAmp/ElasticRemoteConfigParser.php Outdated
Comment thread elastic_tests/patch/apply.sh Outdated
@intuibase
intuibase requested a review from SergeyKleyman April 27, 2026 12:05
@intuibase
intuibase marked this pull request as ready for review April 27, 2026 12:05
@intuibase
intuibase requested review from a team as code owners April 27, 2026 12:05
@intuibase intuibase self-assigned this Apr 27, 2026
SergeyKleyman
SergeyKleyman previously approved these changes Apr 27, 2026
v1v
v1v previously approved these changes Apr 27, 2026
@intuibase intuibase linked an issue Apr 27, 2026 that may be closed by this pull request
2 tasks
@intuibase
intuibase dismissed stale reviews from v1v and SergeyKleyman April 27, 2026 14:13

The merge-base changed after approval.

@intuibase
intuibase requested review from SergeyKleyman and v1v April 27, 2026 14:47
@intuibase
intuibase merged commit 56da105 into elastic:main Apr 28, 2026
63 checks passed
@intuibase
intuibase deleted the upstream2edot branch April 28, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use OpenTelemetry PHP distro as Elastic Distribution of OpenTelemetry for PHP

4 participants