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

feat: Add suppress exceptions decorator #9

Merged

Conversation

ArtARTs36
Copy link
Contributor

@ArtARTs36 ArtARTs36 commented Sep 27, 2023

Q A
Bugfix?
Breaks BC?
New feature? ✔️
Issues #...
Docs PR spiral/docs#...

This request adds a decorator to suppress errors when making requests to the metrics service and logging them.

Use case

For example, metrics can be involved in payment transactions. The loss of a metric is less critical than the loss of a transaction, so the drop in the metric can be suppressed.

Client code example

$metrics = new \Spiral\RoadRunner\Metrics\SuppressExceptionsMetrics(
    new \Spiral\RoadRunner\Metrics\Metrics(\Spiral\Goridge\RPC\RPC::create('dsn'),
));

@codecov-commenter
Copy link

Codecov Report

All modified lines are covered by tests ✅

❗ No coverage uploaded for pull request base (3.x@2733196). Click here to learn what that means.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@          Coverage Diff           @@
##             3.x       #9   +/-   ##
======================================
  Coverage       ?   72.04%           
  Complexity     ?       37           
======================================
  Files          ?        3           
  Lines          ?       93           
  Branches       ?        0           
======================================
  Hits           ?       67           
  Misses         ?       26           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@butschster
Copy link
Contributor

Hi @ArtARTs36,

Thank you for the contribution.

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

Successfully merging this pull request may close these issues.

3 participants