Skip to content

Conversation

@Carmish
Copy link
Collaborator

@Carmish Carmish commented Mar 26, 2025

Refactoring of the database. Specifically, how we store information about stack lines of exceptions.
(Obs also a minor change in ExceptionInfo: now it has a boolean telling if it was user captured)

The new database:
Skærmbillede 2025-03-25 kl  11 06 17

Close up of the ExceptionStackLine (and FunctionDefinition, CodeLine & StackTraceSnapshot) in the old database:
exception_stack_line

The old database:
DB-10-03-2025

@Carmish
Copy link
Collaborator Author

Carmish commented Mar 26, 2025

We might also want to remove the CodeLine data pruning since it is no longer related to the exceptions. But at the other hand, if it is not referred to by any StackLines, there is no need to store it, so it could still be relevant just to clean up. Maybe it should just be done separately from the exception module, on another PR.

@Carmish
Copy link
Collaborator Author

Carmish commented Mar 26, 2025

The position of the ExceptionStackLines is still named position and not index.
The existing StackLines has a corresponding field named position, so we might want to match this.

@AlbertRossJoh
Copy link
Collaborator

We might also want to remove the CodeLine data pruning since it is no longer related to the exceptions. But at the other hand, if it is not referred to by any StackLines, there is no need to store it, so it could still be relevant just to clean up. Maybe it should just be done separately from the exception module, on another PR.

I think it makes sense to move the CodeLine pruning in this PR, as it should not be removed in a function which is meant to clear all unreferenced entries in relation to exception info.

Copy link
Collaborator

@AlbertRossJoh AlbertRossJoh left a comment

Choose a reason for hiding this comment

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

There are some important comments that you should take a look at.
Specifically regarding the None check and the absence of truncation.

Otherwise really nice job! 🎖️

@codecov
Copy link

codecov bot commented Mar 31, 2025

Codecov Report

Attention: Patch coverage is 61.76471% with 52 lines in your changes missing coverage. Please review.

Project coverage is 86.14%. Comparing base (9fc6f83) to head (c30d1b8).
Report is 21 commits behind head on feature/exn-monitoring.

Files with missing lines Patch % Lines
...sk_monitoringdashboard/database/exception_frame.py 21.73% 18 Missing ⚠️
flask_monitoringdashboard/database/file_path.py 30.00% 7 Missing ⚠️
..._monitoringdashboard/database/function_location.py 30.00% 7 Missing ⚠️
flask_monitoringdashboard/core/database_pruning.py 0.00% 5 Missing ⚠️
...oringdashboard/core/exceptions/exception_logger.py 37.50% 5 Missing ⚠️
...ngdashboard/core/exceptions/stack_frame_parsing.py 0.00% 3 Missing ⚠️
...onitoringdashboard/database/function_definition.py 25.00% 3 Missing ⚠️
...lask_monitoringdashboard/controllers/exceptions.py 50.00% 2 Missing ⚠️
...ngdashboard/core/exceptions/stack_trace_hashing.py 0.00% 1 Missing ⚠️
flask_monitoringdashboard/views/exception.py 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                     @@
##           feature/exn-monitoring     #505      +/-   ##
==========================================================
- Coverage                   86.89%   86.14%   -0.75%     
==========================================================
  Files                         113      116       +3     
  Lines                        3532     3608      +76     
==========================================================
+ Hits                         3069     3108      +39     
- Misses                        463      500      +37     
Files with missing lines Coverage Δ
flask_monitoringdashboard/database/__init__.py 97.32% <100.00%> (+0.27%) ⬆️
...ask_monitoringdashboard/database/exception_info.py 57.69% <ø> (ø)
...nitoringdashboard/database/exception_stack_line.py 100.00% <100.00%> (ø)
...nitoringdashboard/database/stack_trace_snapshot.py 100.00% <100.00%> (ø)
tests/fixtures/models.py 100.00% <100.00%> (ø)
tests/unit/database/test_exception_info.py 100.00% <100.00%> (ø)
tests/unit/database/test_exception_stack_line.py 100.00% <ø> (ø)
tests/unit/database/test_function_definition.py 100.00% <100.00%> (ø)
tests/unit/database/test_stack_trace_snapshot.py 100.00% <100.00%> (ø)
...ngdashboard/core/exceptions/stack_trace_hashing.py 46.66% <0.00%> (ø)
... and 9 more

... and 1 file with indirect coverage changes

🚀 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.

incl None check,
truncation,
EOF errors,
default non-captured bool,
and function description
@Carmish Carmish requested a review from AlbertRossJoh March 31, 2025 10:25
Copy link
Collaborator

@AlbertRossJoh AlbertRossJoh left a comment

Choose a reason for hiding this comment

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

LGTM 🥇 🌪️ 🪨 🦆

@Carmish Carmish merged commit 58b6c52 into feature/exn-monitoring Apr 1, 2025
3 of 4 checks passed
@Carmish Carmish deleted the feature/exn-monitoring-database-refactoring branch April 1, 2025 14:58
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