Skip to content

NH-146966 PHP: explore and adopt declarative config - #219

Open
jerrytfleung wants to merge 66 commits into
mainfrom
declarative
Open

jerrytfleung wants to merge 66 commits into
mainfrom
declarative

Conversation

@jerrytfleung

@jerrytfleung jerrytfleung commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

This pull request introduces significant updates to naming conventions and configuration, aligning the project with new "swo_"-prefixed identifiers for propagators, samplers, and detectors. It also adds new component providers, updates example files and documentation, and improves compatibility with newer development tools. Below are the most important changes:

Adoption of "swo_" Naming Conventions:

  • Replaces all instances of solarwinds_http, swotracestate, xtraceoptions, and related identifiers with their new swo_-prefixed counterparts (e.g., swo_http, swo_tracestate, swo_xtraceoptions, etc.) across code, documentation, and examples for consistency and clarity. [1] [2] [3] [4] [5] [6] [7] [8]

Component Provider and Configuration Enhancements:

  • Adds new component provider classes for Kubernetes, APM, and UAMS detectors, as well as for propagators, samplers, and span processors, and registers them in the composer.json under the spi section. [1] [2] [3]
  • Updates composer.json to reference the new registration files and updates development dependencies to newer versions for improved compatibility. [1] [2]

Documentation and Example Updates:

  • Updates documentation (README.md, docs/azure-app-service-quickstart.md) to reflect the new configuration environment variables and table formatting, ensuring users follow the new conventions. [1] [2] [3] [4]
  • Adds a new example (examples/basic_file.php and examples/basic_file.yaml) demonstrating configuration via file, including resource detection, propagators, response propagators, and tracer/meter/logger providers. [1] [2]

Internal Refactoring and Compatibility:

  • Refactors the TransactionName API to use the new ResponseTimeSpanProcessor instead of the old TransactionNameSpanProcessor, updating attribute references accordingly. [1] [2]
  • Updates PHPStan configuration (phpstan.neon.dist) to suppress specific errors and improve static analysis compatibility.

Constants and Known Values:

  • Updates and adds constants in KnownValues.php to match the new naming scheme and default values.

NH-146966

Comment thread examples/basic_file.yaml Outdated
Comment thread examples/basic_file.yaml Outdated
@jerrytfleung
jerrytfleung marked this pull request as draft October 16, 2026 18:04
@jerrytfleung
jerrytfleung marked this pull request as ready for review October 20, 2026 22:05
@jerrytfleung
jerrytfleung requested review from tammy-baylis-swi and a lite review from Copilot October 20, 2026 22:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical missing SPI provider blocks declarative configuration, and the file-based example has a path-resolution defect.

1 open issue
3 resolved since last review

Review effort: Lite

Comment thread composer.json Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Five unresolved moderate issues affect example startup, settings initialization, and sampler configuration isolation.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Resolve OTEL_CONFIG_FILE relative to the script directory

examples/​basic_file.php:9

OTEL_CONFIG_FILE is resolved relative to the process working directory, not this script. Running php examples/basic_file.php from the repository root therefore looks for ./basic_file.yaml at the root, while the added file is in examples/, so the example cannot start; construct the path from __DIR__.

1 resolved since last review

Review effort: Lite

Comment thread examples/basic_file.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could we rename this to maybe basic_config.yaml to differentiate from the instrumented file? Or should they match?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants