Skip to content

docs: add troubleshooting guide - #2040

Draft
PuvaanRaaj wants to merge 2 commits into
open-telemetry:mainfrom
PuvaanRaaj:docs/1321-troubleshooting-faq
Draft

docs: add troubleshooting guide#2040
PuvaanRaaj wants to merge 2 commits into
open-telemetry:mainfrom
PuvaanRaaj:docs/1321-troubleshooting-faq

Conversation

@PuvaanRaaj

Copy link
Copy Markdown
Contributor

Summary

Add a troubleshooting and FAQ guide for common OpenTelemetry PHP setup and export problems, and link it from the main README.

The guide covers Composer and autoload timing, no-op providers, extension and instrumentation checks, CLI versus PHP-FPM configuration, OTLP transports, file configuration, short-lived process shutdown, SDK logging, and safe diagnostics.

Fixes #1321

Validation

  • Verified all external links return HTTP 200.
  • Verified the diff with git diff --check.
  • make help could not run in the fresh checkout because the required local .env file is absent.

- Document evidence-backed setup and export diagnostics
- Link the FAQ from the repository README
- Rollback: revert this commit

Risk-Level: low
AI-Agent: codex
Assisted-by: Codex
@PuvaanRaaj
PuvaanRaaj requested a review from a team as a code owner August 22, 2026 21:41
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.06%. Comparing base (b9c9963) to head (f64609b).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2040      +/-   ##
============================================
- Coverage     68.14%   68.06%   -0.08%     
  Complexity     3083     3083              
============================================
  Files           459      459              
  Lines          9031     9031              
============================================
- Hits           6154     6147       -7     
- Misses         2877     2884       +7     
Flag Coverage Δ
8.1 67.75% <ø> (-0.02%) ⬇️
8.2 67.98% <ø> (-0.07%) ⬇️
8.3 67.95% <ø> (+0.01%) ⬆️
8.4 67.98% <ø> (ø)
8.5 68.01% <ø> (+0.05%) ⬆️
8.6 67.98% <ø> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 8 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9c9963...f64609b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PuvaanRaaj
PuvaanRaaj marked this pull request as draft August 22, 2026 21:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce94470819

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/troubleshooting.md
Comment on lines +32 to +35
OTEL_PHP_AUTOLOAD_ENABLED=true \
OTEL_TRACES_EXPORTER=console \
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORTER=none \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Unset file configuration before forcing console export

When the process already has OTEL_CONFIG_FILE set, SdkAutoloader::autoload() selects fileBasedInitializer() and does not use OTEL_TRACES_EXPORTER, so this diagnostic command may continue exporting according to the file instead of to the console. This is especially likely for users troubleshooting the file-based setup described later in this guide and defeats the intended isolation test; explicitly unset OTEL_CONFIG_FILE for this command or explain that the exporter must be changed in the configuration file.

Useful? React with 👍 / 👎.

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.

That's a good point, and is worth pointing out in a troubleshooting guide

Comment thread docs/troubleshooting.md

## Where do SDK errors appear?

SDK warnings and exporter errors are written to PHP's `error_log` by default.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Qualify the default SDK log destination

When an application has registered a logger through LoggerHolder::set(), LogWriterFactory::create() selects Psr3LogWriter for the default destination, so warnings and exporter errors are sent to that PSR-3 logger rather than PHP's error_log. The unconditional statement can therefore send affected users to the wrong logs; state that error_log is only the fallback when no PSR-3 logger is registered.

Useful? React with 👍 / 👎.

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.

I think "by default" covers this, and the next section clarifies further.

Comment thread docs/troubleshooting.md
Comment on lines +32 to +35
OTEL_PHP_AUTOLOAD_ENABLED=true \
OTEL_TRACES_EXPORTER=console \
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORTER=none \

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.

That's a good point, and is worth pointing out in a troubleshooting guide

Comment thread docs/troubleshooting.md
require __DIR__ . '/vendor/autoload.php';
```

If a framework loads its `.env` file after Composer autoloading, those values may

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.

Something that comes up with Laravel when it starts its own webserver is that only certain env vars are passed through (@ChrisLightfootWild I think could explain it better), but that would be worth generalizing...ie, check what the env values are closer to when they are used

Comment thread docs/troubleshooting.md

## Where do SDK errors appear?

SDK warnings and exporter errors are written to PHP's `error_log` by default.

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.

I think "by default" covers this, and the next section clarifies further.

- Unset OTEL_CONFIG_FILE in the console-exporter diagnostic command.\n- Ensure the check is not overridden by file-based configuration.\n- Rollback: revert this commit to restore the prior diagnostic command.

Risk-Level: low
AI-Agent: gpt-5.6-sol
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.

Troubleshooting Guide / FAQ

2 participants