Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented Mar 13, 2025

What do these changes do?

What this PR changes

This PR introduces a new fingerprinting mechanism on the traceback for generating the osparc error code (OEC) as

OEC:{traceback}-{timestamp}

Instead of computing the OEC from the exception instance, which produced a different OEC for every occurrence, we now generate the OEC from a fingerprint of the exception’s type and relevant context. This change ensures that identical errors will consistently yield the same OEC across multiple occurrences.

What the OEC is used for

The OEC is included in the logs and passed to the front-end as a supportId (SEE OAS below), enabling users and support teams to trace and identify unexpected errors. It is also extracted by the logging system as log_oec and log_userid to associate errors with users and provide better observability across the platform.

image

Why we introduced this change

Previously, identical errors thrown in different instances (even with the same stack trace) would result in different OECs. This made it difficult to group and analyze recurring issues. With the new fingerprint-based approach, repeated occurrences of the same underlying error—possibly affecting multiple users—can now be identified and grouped under a single OEC. This improves our ability to detect and prioritize common issues, simplifies debugging, and enhances the efficiency of support workflows.

Related issue/s

How to test

cd packages/common-library
make install-dev
pytest -vv tests/test_error_codes.py

Dev-ops

None

@pcrespov pcrespov self-assigned this Mar 13, 2025
@codecov
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

Attention: Patch coverage is 89.65517% with 3 lines in your changes missing coverage. Please review.

Project coverage is 86.97%. Comparing base (772ef54) to head (2da9d9a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7364      +/-   ##
==========================================
+ Coverage   85.66%   86.97%   +1.31%     
==========================================
  Files        1709     1356     -353     
  Lines       66355    56314   -10041     
  Branches     1124      613     -511     
==========================================
- Hits        56840    48977    -7863     
+ Misses       9195     7140    -2055     
+ Partials      320      197     -123     
Flag Coverage Δ
integrationtests 65.24% <ø> (-0.02%) ⬇️
unittests 85.98% <89.65%> (+1.36%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library 72.32% <ø> (ø)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.46% <ø> (ø)
agent 96.46% <ø> (ø)
api_server 90.68% <ø> (ø)
autoscaling 96.08% <ø> (ø)
catalog 92.14% <ø> (ø)
clusters_keeper 99.24% <ø> (ø)
dask_sidecar 91.25% <ø> (ø)
datcore_adapter 98.11% <ø> (ø)
director 76.59% <ø> (-0.10%) ⬇️
director_v2 91.27% <ø> (-0.03%) ⬇️
dynamic_scheduler 97.33% <ø> (ø)
dynamic_sidecar 90.11% <ø> (ø)
efs_guardian 89.79% <ø> (ø)
invitations 93.28% <ø> (ø)
payments 92.66% <ø> (ø)
resource_usage_tracker 89.12% <ø> (-0.11%) ⬇️
storage 84.42% <ø> (+0.15%) ⬆️
webclient ∅ <ø> (∅)
webserver 85.80% <ø> (+5.48%) ⬆️

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 772ef54...2da9d9a. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pcrespov pcrespov added this to the The Awakening milestone Mar 13, 2025
@pcrespov pcrespov added the t:maintenance Some planned maintenance work label Mar 13, 2025
@pcrespov pcrespov marked this pull request as ready for review March 13, 2025 23:01
@pcrespov pcrespov added the 🤖-automerge marks PR as ready to be merged for Mergify label Mar 13, 2025
@pcrespov pcrespov enabled auto-merge (squash) March 13, 2025 23:07
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.

Very nice thanks!

Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

Nice 💅

@pcrespov pcrespov requested a review from GitHK March 14, 2025 09:19
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.

I would prefer to support both features as pointed out in my comment.

Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

Cool, thanks a lot. This is a topic I care a lot about, so I wrote some thoughts/suggestions. I think we can still improve a lot in the direction of being able to quickly locate and solve issues.

@pcrespov pcrespov force-pushed the is7362/error-code-hash branch from 66caeb5 to df87f8a Compare March 18, 2025 16:05
@pcrespov pcrespov requested a review from GitHK March 18, 2025 16:06
@pcrespov pcrespov force-pushed the is7362/error-code-hash branch from df87f8a to 2da9d9a Compare March 18, 2025 17:13
@sonarqubecloud
Copy link

@pcrespov pcrespov changed the title 🎨 Unique EOC for deduplication purposes 🎨 New OEC:{traceback}-{timestamp} format for de-duplication purposes Mar 18, 2025
@pcrespov pcrespov merged commit 45ffe4e into ITISFoundation:master Mar 18, 2025
144 of 146 checks passed
@pcrespov pcrespov deleted the is7362/error-code-hash branch March 18, 2025 20:04
mrnicegyu11 pushed a commit to mrnicegyu11/osparc-simcore that referenced this pull request Mar 26, 2025
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Apr 15, 2025
56 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify t:maintenance Some planned maintenance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unique error fingerprint of OECs for deduplication purposes

6 participants