Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More control over curl with instrumentation - e.g don't log some timeouts to APM Error log #1208

Open
igor748 opened this issue Aug 12, 2024 · 2 comments
Labels
agent-php enhancement New feature or request

Comments

@igor748
Copy link

igor748 commented Aug 12, 2024

Don't want to log some expected errors from curl
We have some expected errors that we don't want to log to APM e.g timeouts to some urls.
These errors are automatically logged by apm agent during curl_exec and we can't prevent it in later checking of
curl response codes.

To have control of which stuff is logged
Some kind of try/catch logic where we can choose what will be logged and what will be handled with our code without logging to APM Error log.

@igor748 igor748 added the enhancement New feature or request label Aug 12, 2024
@groensch24
Copy link

To give a good use-case why that is important to us.

We allow our customers to integrate external systems into ours. They see a log on the messages that go out and in and if there is an error they will see that and can react on it. So those errors are expected and part of our business. They are not something we have to be alerted on.

Now, the module for curls sends all timeouts or other errors there. That means everytime we do deployments or want to see how well our application it is, it will be flooded with errors that are not really a problem.

@intuibase
Copy link
Contributor

Hey @igor748 @groensch24

Have you tried to use Elastic agent drop events feature to solve this problem?
https://www.elastic.co/guide/en/fleet/current/drop_event-processor.html

This allows exceptions to be filtered out according to a number of rules and conditions (like equals, contains, etc). It can be by exception, name, message, etc
Here is a sample part of apm-server.yml file:

processors:
  - drop_event:
      when:
        - equals:
            error.exception.type: "IgnoredException"
  - drop_event:
      when:
        contains:
          error.exception.message: "curl error..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-php enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants