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

🎨 introduce logger filtering with ENV var ⚠️ #6596

Conversation

matusdrobuliak66
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 commented Oct 24, 2024

What do these changes do?

  • We will change the log level to INFO in production. I thought this might be a good approach to interactively filter out some repetitive logs that are not useful and might be polluting the logs.
  • 🎨 introduce logger filtering with ENV var LOG_FILTER_MAPPING
    Example:
LOG_FILTER_MAPPING = {
    "uvicorn.access": [
        '"GET / HTTP/1.1" 200',
        '"GET /metrics HTTP/1.1" 200',
    ],
    "gunicorn.access": [
        '"GET /v0/ HTTP/1.1" 200',
        '"GET /v0/health HTTP/1.1" 200',
    ],
}

Related issue/s

How to test

Dev-ops checklist

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 8 lines in your changes missing coverage. Please review.

Project coverage is 87.89%. Comparing base (87a9b7e) to head (1a7e3ed).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #6596    +/-   ##
========================================
  Coverage   87.88%   87.89%            
========================================
  Files        1562     1556     -6     
  Lines       62829    62680   -149     
  Branches     2085     2088     +3     
========================================
- Hits        55218    55091   -127     
+ Misses       7293     7271    -22     
  Partials      318      318            
Flag Coverage Δ
integrationtests 64.83% <85.71%> (+0.02%) ⬆️
unittests 85.83% <85.71%> (-1.19%) ⬇️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library 93.38% <ø> (ø)
pkg_dask_task_models_library 96.87% <ø> (ø)
pkg_models_library 92.14% <ø> (ø)
pkg_notifications_library 83.79% <ø> (ø)
pkg_postgres_database 87.77% <ø> (ø)
pkg_service_integration 71.44% <ø> (ø)
pkg_service_library 76.63% <65.21%> (-0.05%) ⬇️
pkg_settings_library 91.42% <ø> (ø)
pkg_simcore_sdk 85.27% <ø> (ø)
agent 97.17% <100.00%> (+0.01%) ⬆️
api_server 89.82% <100.00%> (+<0.01%) ⬆️
autoscaling 95.26% <100.00%> (+<0.01%) ⬆️
catalog 89.52% <100.00%> (+0.01%) ⬆️
clusters_keeper 98.85% <100.00%> (+<0.01%) ⬆️
dask_sidecar 91.32% <100.00%> (+0.02%) ⬆️
datcore_adapter 94.05% <100.00%> (+0.02%) ⬆️
director 58.38% <ø> (ø)
director_v2 90.75% <100.00%> (-0.13%) ⬇️
dynamic_scheduler 96.72% <100.00%> (+<0.01%) ⬆️
dynamic_sidecar 89.72% <100.00%> (-0.03%) ⬇️
efs_guardian 90.00% <100.00%> (+0.03%) ⬆️
invitations 93.51% <100.00%> (+0.04%) ⬆️
osparc_gateway_server 85.15% <ø> (ø)
payments 93.09% <100.00%> (+<0.01%) ⬆️
resource_usage_tracker 87.38% <100.00%> (+0.01%) ⬆️
storage 89.75% <100.00%> (+0.01%) ⬆️
webclient ∅ <ø> (∅)
webserver 89.30% <100.00%> (-0.01%) ⬇️

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 87a9b7e...1a7e3ed. Read the comment docs.

@matusdrobuliak66 matusdrobuliak66 changed the title 🎨 introduce logger filtering with ENV var WIP: 🎨 introduce logger filtering with ENV var Oct 24, 2024
@matusdrobuliak66 matusdrobuliak66 self-assigned this Oct 24, 2024
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a comment

@matusdrobuliak66 matusdrobuliak66 changed the title WIP: 🎨 introduce logger filtering with ENV var 🎨 introduce logger filtering with ENV var Oct 24, 2024
@matusdrobuliak66 matusdrobuliak66 marked this pull request as ready for review October 24, 2024 13:06
…atusdrobuliak66/osparc-simcore into maintenance/reduce-uvicorn-access-logs
Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a subtle change request that I personally find reasonable, but I have formulated as a comment. If you dont want to do it, please bring me a coffee or tell me a compliment, then I might overlook my precautions and approve 😽

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, just a few comments

@matusdrobuliak66 matusdrobuliak66 added this to the MartinKippenberger milestone Oct 25, 2024
@YuryHrytsuk
Copy link
Contributor

@matusdrobuliak66 this is amazing. I like it!

I wonder if it further slows down general performance because of logging. It would be nice to see a benchmark but we don't have anything set up yet to compare.

Copy link
Contributor

@YuryHrytsuk YuryHrytsuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think before it is merged, we need a PR in osparc-config with all the new required ENV.

@mrnicegyu11
Copy link
Member

For the record re regex speed: you are right @matusdrobuliak66 https://stackoverflow.com/questions/19911508/python-speed-for-in-vs-regular-expression

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea. I have some comments regarding the implementation. Lots of thoughts :-)
I am happy to discuss it offline and even help implementing some parts (now or in further iterations)

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider the comments before merging. Either by taking action in this PR or by creating an issue.

@matusdrobuliak66 matusdrobuliak66 enabled auto-merge (squash) October 29, 2024 15:11
@matusdrobuliak66 matusdrobuliak66 changed the title 🎨 introduce logger filtering with ENV var 🎨 introduce logger filtering with ENV var ⚠️ Oct 30, 2024
Copy link

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. You missed one.

@matusdrobuliak66 matusdrobuliak66 merged commit 357a841 into ITISFoundation:master Nov 1, 2024
82 of 88 checks passed
@matusdrobuliak66 matusdrobuliak66 deleted the maintenance/reduce-uvicorn-access-logs branch November 1, 2024 09:06
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Nov 6, 2024
57 tasks
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.

6 participants