elastic / elastic/apm-agent-php

elastic_apm.error_level Configuration

Open
#1,066 0 comments 0 reactions 0 assignees View on GitHub
agent-php enhancement priority: low triaged
Dominant language
PHP
Stars
268
Forks
86
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
I propose adding an additional layer of customization to Elastic APM's error-capturing behavior, specific to the PHP agent. Currently, the agent relies on PHP's native error_reporting setting to determine what constitutes an error. While this is functional, it doesn't provide the granularity that may be required in some use-cases.

Documentation Reference:

[Elastic APM PHP Agent Configuration](https://www.elastic.co/guide/en/apm/agent/php/current/configuration.html#configure-php-error-reporting)
[PHP error_reporting Function](https://www.php.net/manual/en/function.error-reporting.php)

The existing setup tightly couples APM's error recognition with PHP's error settings. This leaves no room for differentiating between errors that are critical for APM monitoring and errors that, while perhaps noteworthy, are not critical from an APM perspective.

**Describe the solution you'd like**

Introduce a new configuration option, say, elastic_apm.error_level, that allows users to specify the types of errors that should be captured by APM, independent of PHP's error_reporting setting.

For example, setting elastic_apm.error_level to a particular verbosity level would cause the APM agent to ignore errors below that level, irrespective of what is set in PHP's error_reporting.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.