sentry-php
AGENTS.md1.9k starsChanged 5 months agoMITView on GitHub
- sentry/sentry is the core PHP SDK, not an application or framework bundle. - Public entry points include the autoloaded global helpers in src/functions.php and the public classes and interfaces under src/. - Use this file for repo-specific constraints that are easy to miss, and explore the codebase for current implementation details. - The minimum supported PHP version for shipped code is 7.2. composer.json requires ^7.2|^8.0, so shipped code must remain valid on PHP 7.2 unless support policy is intentionally…
Trending
Quiet since February.thin dataabout the whole repository
Who's talking about getsentry/sentry-php
- getsentry/sentry-symfony“Support sentry-php 3.0”GitHub · Sep 28, 2020 · 11 reactions
- getsentry/sentry-ruby“Add support for SENTRY_RELEASE”GitHub · Jul 7, 2019 · 11 reactions
- symfony/monolog-bundle“Add Sentry Hub instance in DI container to resolve event context issue”GitHub · Mar 9, 2021 · 9 reactions
- B-Galati/monolog-sentry-handler“Support for sentry/sdk:^3.0”GitHub · Oct 19, 2020 · 8 reactions
- getsentry/sentry-laravel“feat: Add Tracing”GitHub · Jun 23, 2020 · 8 reactions
The biggest 5 of 14 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 14
Talked about on GitHub (14 times).
On GitHub · 14
- Sep 28, 2020Support sentry-php 3.0 — getsentry/sentry-symfony11 reactions · 3 comments
- Jul 7, 2019Add support for SENTRY_RELEASE — getsentry/sentry-ruby11 reactions · 3 comments
- Mar 9, 2021Add Sentry Hub instance in DI container to resolve event context issue — symfony/monolog-bundle9 reactions · 5 comments
- Oct 19, 2020Support for sentry/sdk:^3.0 — B-Galati/monolog-sentry-handler8 reactions · 8 comments
- Jun 23, 2020feat: Add Tracing — getsentry/sentry-laravel8 reactions · 18 comments
9 more on GitHub
- Nov 20, 2018feat: Use user_agent parsing for all events — getsentry/sentry7 reactions
- Dec 10, 2018Including commits in a release? — getsentry/sentry-cli5 reactions · 19 comments
- Jul 31, 2019Provide proper release notes / upgrade guide — getsentry/sentry-laravel4 reactions · 3 comments
- Mar 13, 2019Dedicated SentryHandler — Seldaek/monolog4 reactions · 2 comments
- Feb 19, 2026feat: use context to isolate data between requests and messages — getsentry/sentry-symfony3 reactions · 1 comment
- May 1, 2024Remove `enableTracing` (and update docs accordingly) — getsentry/team-sdks3 reactions · 7 comments
- Nov 22, 2023Add Metrics API — getsentry/sentry-dotnet3 reactions · 6 comments
- Nov 20, 2023Tracing: W3C Trace Context Support — getsentry/team-sdks3 reactions · 9 comments
- Oct 29, 2018Debug handler bails early and no error page is shown — symfony/symfony3 reactions · 9 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 9 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this file for repo-specific constraints that are easy to miss, and explore the codebase for current implementation details.
- Distinctive: line 23
Do not assume optional packages or binaries are available.
- Distinctive: line 27
Do not gate runtime setup or transport behavior on DSN alone.
- Very specific: line 31
Keep declare(strict_types=1).
- Very specific: line 32
Follow the existing formatting rules from .php-cs-fixer.dist.php.
- Very specific: line 33
If you add or change an SDK option, update the resolver/defaults in Options, the relevant getters and setters, the init() option …
- Distinctive: line 62
Add tests with every behavior change.
- Very specific: line 64
Every SDK option/default must have a valid case in OptionsTest::optionsDataProvider().
- Distinctive: line 70
Prefer targeted PHPUnit runs while iterating.
- Distinctive: line 71
After editing files, run the relevant formatting, lint, and test commands for the code you changed.
- Very specific: line 73
Before handing back substantive code changes, run composer check when feasible and call out anything you could not run.
- Distinctive: line 75
If you change error handling, fatal error capture, or PHP-version-specific behavior, add or update PHPT coverage.
- Distinctive: line 77
If you change runtime-context or worker-mode behavior, add or update focused coverage for the FrankenPHP or RoadRunner paths as appropriate.
- Very specific: line 92
If a change may require updates in the separate documentation repo, ask the user whether to review ../sentry-docs if that sibling checkout …
- Distinctive: line 98
If a change affects installation, configuration, error handling, tracing, profiling, metrics, logs, or worker-mode behavior, call out the …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Overview
sentry/sentryis the core PHP SDK, not an application or framework bundle.- Public entry points include the autoloaded global helpers in
src/functions.phpand the public classes and interfaces undersrc/. - Use this file for repo-specific constraints that are easy to miss, and explore the codebase for current implementation details.
Compatibility Rules
- The minimum supported PHP version for shipped code is
7.2.composer.jsonrequires^7.2|^8.0, so shipped code must remain valid on PHP7.2unless support policy is intentionally being changed. - This SDK has a broad public API surface. Treat changes to global helpers,
Options,ClientBuilder,ClientInterface,HubInterface,TransportInterface,IntegrationInterface, tracing/logs/metrics types, and Monolog handlers as BC-sensitive. - Preserve the existing cross-version compatibility style. This repo supports
multiple
psr/log,symfony/options-resolver,guzzlehttp/psr7, andmonolog/monologmajor versions. - Do not assume optional packages or binaries are available. Monolog is only a suggested dependency, and FrankenPHP/RoadRunner worker coverage depends on optional binaries and dev dependencies.
Spotlightis treated as an active send path alongside DSN-based delivery. Do not gate runtime setup or transport behavior on DSN alone.
Editing Guidance
- Keep
declare(strict_types=1);in PHP files. - Follow the existing formatting rules from
.php-cs-fixer.dist.php. - If you add or change an SDK option, update the resolver/defaults in
Options, the relevant getters and setters, theinit()option array-shape docs insrc/functions.php, and the affected tests. src/functions.phpis autoloaded and part of the public API. Keep helper signatures, phpdoc, and runtime behavior synchronized with the underlying client, hub, and runtime-context implementation. Functions insrc/functions.phpshould use camelCase naming.IntegrationRegistryintentionally callssetupOnce()only once per integration class during the process lifetime. Preserve de-duplication and default-integration gating when changing integration setup behavior.ErrorHandlerhas fragile register-once, previous-handler chaining, reserved memory, and out-of-memory behavior. Preserve that lifecycle carefully and add PHPT coverage when changing fatal or silenced error handling.SentrySdk::startContext(),endContext(), andwithContext()must keep runtime-context isolation and best-effort flushing intact for logs, metrics, and transport in long-running worker scenarios.HttpTransportandPayloadSerializerare tightly coupled. Preserve the envelope item selection, Spotlight delivery path, dynamic sampling context, and the transaction/profile relationship when changing transport or serialization behavior.- Monolog support spans multiple Monolog major versions through the
compatibility traits and handlers under
src/Monolog/. Preserve that compatibility style when changing logging integrations. Client::SDK_VERSIONis updated by the release action viascripts/bump-version.sh. Do not modify it manually as part of normal development changes.
Test Expectations
- Add tests with every behavior change. This is a library repo with broad compatibility and regression coverage.
- Every SDK option/default must have a valid case in
OptionsTest::optionsDataProvider(). Keep the exhaustive option-coverage and default-validation tests passing when adding or changing options. - New tests belong under
tests/. phpunit.xml.distdefines aunitsuite that includes both PHPUnit tests andtests/phpt, plus a separateoomsuite fortests/phpt-oom.- Prefer targeted PHPUnit runs while iterating.
- After editing files, run the relevant formatting, lint, and test commands for the code you changed.
- Before handing back substantive code changes, run
composer checkwhen feasible and call out anything you could not run. - If you change error handling, fatal error capture, or PHP-version-specific behavior, add or update PHPT coverage.
- If you change runtime-context or worker-mode behavior, add or update focused coverage for the FrankenPHP or RoadRunner paths as appropriate.
Tools And Commands
phpstan.neononly analyzessrc, usesphpstan-baseline.neon, and will not catch behavior regressions intests/or PHPT coverage.phpunit.xml.distis strict about unexpected output, so noisy debug output will fail tests.- This repo is a library, so do not expect a runnable application entrypoint.
Docs And Release Notes
README.mdandCHANGELOG.mdare updated manually during releases, so do not modify them as part of normal development changes.- If a change may require updates in the separate documentation repo, ask the
user whether to review
../sentry-docsif that sibling checkout exists. If it does not exist, ask the user for the local docs path first. If they opt in, update that repo'smasterbranch when safe, use git worktrees to inspect the relevant docs, and suggest any needed changes to avoid stale documentation. - If a change affects installation, configuration, error handling, tracing, profiling, metrics, logs, or worker-mode behavior, call out the likely README or release-note follow-up in your summary instead of editing those files automatically.
CI Notes
.github/workflows/ci.ymlruns the PHPUnit compatibility matrix across Ubuntu and Windows, lowest and highest dependencies, and separate runtime jobs for FrankenPHP and RoadRunner..github/workflows/static-analysis.yamlruns PHP-CS-Fixer, PHPStan, and Psalm on single recent PHP versions rather than across the full test matrix.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

