Skip to content

[WIP] feat: add http status error configuration #3223

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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

scott-shields-github
Copy link

Description

This PR adds a set of configuration items for custom error flagging based on http status codes. This will allow users of the library to prevent tagging errors for things like a 4xx status code on a server, for example.

This would bring the library closer to the java tracer and some functionalities of the python and c# tracers.

The priority when evaluating spans is:

  1. Manually configured error
  2. Http status
  3. Default - current exception based error tagging

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@scott-shields-github scott-shields-github requested a review from a team as a code owner April 28, 2025 15:18
@codecov-commenter
Copy link

codecov-commenter commented Apr 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.38%. Comparing base (aeeec62) to head (f72016d).
Report is 3 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (aeeec62) and HEAD (f72016d). Click for more details.

HEAD has 6 uploads less than BASE
Flag BASE (aeeec62) HEAD (f72016d)
tracer-php 12 6
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3223      +/-   ##
============================================
- Coverage     76.38%   67.38%   -9.00%     
+ Complexity     2948      715    -2233     
============================================
  Files           145       68      -77     
  Lines         16076     6148    -9928     
  Branches       1107     1107              
============================================
- Hits          12280     4143    -8137     
+ Misses         3221     1430    -1791     
  Partials        575      575              
Flag Coverage Δ
appsec-extension 68.80% <ø> (ø)
tracer-php 63.69% <ø> (-15.59%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 87 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@scott-shields-github scott-shields-github requested a review from a team as a code owner April 28, 2025 19:37
Copy link

cit-pr-commenter bot commented Apr 29, 2025

PR Security Update

All commits in this PR up to and including 69f19db have been reviewed and marked safe by SDLC security. For any questions, please reach out to #ci-for-external-contributors-collab on Slack.

@bwoebi
Copy link
Collaborator

bwoebi commented Apr 29, 2025

Thanks for the contribution! I've littered the code with suggestions, but it already looks quite good :-)
Tests are obviously broken, but we can regenerate the snapshots.

@scott-shields-github
Copy link
Author

Thanks for the contribution! I've littered the code with suggestions, but it already looks quite good :-) Tests are obviously broken, but we can regenerate the snapshots.

Thanks so much for the review and suggestions!

@bwoebi
Copy link
Collaborator

bwoebi commented Apr 30, 2025

Thanks, the code looks fine now - we can have a look at the tests.

@scott-shields-github
Copy link
Author

Thanks, the code looks fine now - we can have a look at the tests.

Anything I can do on my end? I've tried to build run the tests in the container, but I've been having trouble with getting it started with docker compose. I've only been able to run the 8.3-buster container and run the tests manually.

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.

3 participants