- Error Logs: Check PHP's
error_logfor errors or warnings. Control the log destination withOTEL_PHP_LOG_DESTINATION. - OpenTelemetry C Extension: Verify the
opentelemetryC extension is loaded and active:php --ri opentelemetry
- Minimal Reproducible Example: Create a minimal PHP script to isolate the problem by sending a simple trace or metric.
- Support: If issues persist, reach out to SolarWinds support.
- Composer: Ensure all required OpenTelemetry PHP dependencies are listed in your
composer.json. Check installed packages:composer show --installed
- Version Compatibility: Confirm package versions are compatible with your PHP version and each other.
- Timing: Set OpenTelemetry environment variables before including the Composer autoloader (e.g., before
vendor/autoload.php). Setting them too late can prevent proper initialization. - Verification: Use
printenvto confirm all OpenTelemetry-related environment variables are set and accessible to your PHP application. - Common Environment Variables:
OTEL_PHP_AUTOLOAD_ENABLEDOTEL_SERVICE_NAMEOTEL_TRACES_SAMPLEROTEL_PROPAGATORSOTEL_EXPERIMENTAL_RESPONSE_PROPAGATORSOTEL_EXPORTER_OTLP_ENDPOINTOTEL_EXPORTER_OTLP_HEADERSSW_APM_SERVICE_KEY
- open_basedir: If using PHP's
open_basedir, ensure it allows access to required OpenTelemetry files and directories. - Fibers: If using
Fibers, setOTEL_PHP_FIBERS_ENABLED=trueand consider preloading bindings, especially for non-CLI SAPIs. - Stack Extension: If you encounter issues with argument handling in pre-hooks, enable
opentelemetry.allow_stack_extensioninphp.ini.
- solarwinds/apm_ext: To troubleshoot sampling issues, it is often easier to temporarily disable the
solarwinds/apm_extC extension. You can do this by commenting out the extension in yourphp.inifile:;extension=apm_ext
- Console Exporter: Change your exporter to
consoleto confirm traces, metrics, or logs are being generated and output to the console. This helps isolate issues between instrumentation and SWO.export OTEL_TRACES_EXPORTER=console export OTEL_METRICS_EXPORTER=console export OTEL_LOGS_EXPORTER=console
- Detailed Logging: Enable debug logs for more insight into instrumentation and errors:
export OTEL_LOG_LEVEL=debug
- Error Logs: If data appears in the console but not in SWO, check error logs to verify data is exported correctly.
- Configuration Verification: Ensure your
OTEL_EXPORTER_OTLP_HEADERSandOTEL_EXPORTER_OTLP_ENDPOINTare set correctly.
If you continue to experience issues, consult the OpenTelemetry PHP documentation for further guidance.