Skip to content

Conversation

@davidgamez
Copy link
Member

@davidgamez davidgamez commented May 5, 2025

Summary:

Closes #1507

The main changes in this PR are:

  • The use of a logback file compatible with Spring
  • Added LoggingBridgeConfig to allow fine-tuning in logging configuration at the web module of other project modules.
  • Minimum log level to be sent to Sentry is now error.

Minor changes:

  • Added job_id to log records in the web for easy follow-up to errors
  • Fine-tuned log levels
  • Remove the log related to not providing the country code, this is the default scenario from the current UI.

From our AI friend
This pull request includes changes to improve logging, enhance error handling, and configure the application for better observability and maintainability. The key updates involve refining logging levels, adding structured logging with MDC, introducing safe file deletion methods, and updating configuration files for logging and application profiles.

Logging Improvements:

  • Changed logging levels from INFO to FINEST in MemoryUsageRegister and VersionResolver to reduce verbosity for less critical messages. [1] [2]
  • Updated logging in StorageHelper and ValidationHandler to use DEBUG level instead of INFO for non-critical logs, and added structured logging for better traceability. [1] [2] [3] [4]
  • Suppressed unnecessary logging noise in logback-spring.xml by setting WARN levels for specific packages and renamed the file for Spring compatibility. [1] [2]

Structured Logging with MDC:

  • Added MDC (Mapped Diagnostic Context) to ValidationController to include job_id in logs for better traceability of validation jobs. [1] [2] [3] [4]

Error Handling and Resource Management:

  • Introduced a safeDeleteFile method in ValidationController to handle file deletion safely and log any errors encountered during the process.

Configuration Enhancements:

  • Added a new LoggingBridgeConfig class to bridge Java Util Logging (JUL) to SLF4J, ensuring consistent logging across the application.
  • Updated the Dockerfile to include new environment variables for Spring profiles, banner mode, and Sentry logging configuration.

Testing Updates:

  • Enhanced the RunValidatorEndpointTest to verify the existence and deletion of temporary files, ensuring robust cleanup after tests. [1] [2]

Expected behavior:

Logs are JSON formatted for the cloud profile. Local profile is not affected.

Screenshot 2025-05-05 at 8 44 06 PM

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@davidgamez davidgamez changed the title activate cloud profile and set sentry logs level fix: web validator logging May 6, 2025
@davidgamez davidgamez marked this pull request as ready for review May 6, 2025 15:25
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2025

📝 Acceptance Test Report

📋 Summary

❌ The rule acceptance test has failed for commit 001ef6f
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 1866 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (0 out of 1866 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1866 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1866 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

55 out of 1921 sources (~3 %) are corrupted.
Dataset Ref Report Exists Ref Report Readable Latest Report Exists Latest Report Readable
ca-british-columbia-bc-transit-columbia-valley-gtfs-2520
ca-british-columbia-bc-transit-comox-valley-transit-system-gtfs-2524
ca-british-columbia-bc-transit-cowichan-valley-regional-transit-system-gtfs-2528
ca-british-columbia-bc-transit-creston-valley-gtfs-2536
ca-british-columbia-bc-transit-fort-st-john-transit-system-gtfs-2547
ca-british-columbia-bc-transit-kamloops-transit-system-gtfs-2551
ca-british-columbia-bc-transit-kelowna-regional-transit-system-gtfs-2555
ca-british-columbia-bc-transit-port-edward-gtfs-2543
ca-british-columbia-bc-transit-powell-river-regional-transit-system-gtfs-2529
ca-british-columbia-bc-transit-shuswap-gtfs-2508
ca-british-columbia-bc-transit-south-okanagan-similkameen-gtfs-2532
ca-british-columbia-bc-transit-sunshine-coast-transit-system-gtfs-2567
ca-british-columbia-bc-transit-victoria-regional-transit-system-gtfs-2571
ca-british-columbia-bc-transit-west-coast-gtfs-2575
ca-saskatchewan-moose-jaw-transit-gtfs-2602
de-baden-wuttemberg-nvbw-gtfs-2393.json
de-bayern-munchner-verkehrs--und-tarifverbund-gmbh-mvv-gtfs-2252
de-sachsen-mitteldeutscher-verkehrsverbund-gmbh-mdv-gtfs-2360
fr-eurostar-gtfs-2431.json
fr-occitanie-reseau-interurbain-li0-gtfs-2604
il-ministry-of-transport-and-road-safety-gtfs-2519
it-liguria-amt-genova-gtfs-2610
jp-aichi-kuwana-city-gtfs-2605
jp-aomori-aomori-city-bus-gtfs-2607
pl-malopolskie-mpk-sa-w-krakowie-mobilis-gtfs-2598
pl-warmian-masurian-zkm-elblag-gtfs-2597
ro-buzau-transbus-buzau-gtfs-2106
ro-dambovita-servicii-publice-municipale-targoviste-gtfs-2107
ro-prahova-transport-calatori-express-ploiesti-gtfs-2108
us-california-alameda-contra-costa-transit-district-ac-transit-gtfs-2455
us-california-county-connection-gtfs-2421
us-california-regional-transportation-commission-of-southern-nevada-rtc-gtfs-110
us-california-santa-maria-area-transit-gtfs-26
us-california-south-county-transit-link-gtfs-2203
us-california-taft-maricopa-area-transit-gtfs-821
us-california-tri-delta-transit-gtfs-1974
us-florida-gainesville-regional-transit-system-gtfs-2412
us-hawaii-hawaii-mass-transit-agency-hele-on-bus-gtfs-2608
us-illinois-danville-mass-transit-gtfs-2363
us-kansas-salina-gtfs-1867
us-massachusetts-pioneer-valley-transit-authority-pvta-gtfs-2416
us-new-york-st-lawrence-county-public-transit-gtfs-2611
us-utah-cache-valley-gtfs-1906
us-virginia-arlington-transit-gtfs-485
us-virginia-fairfax-cue-bus-cue-gtfs-2609
us-virginia-fredericksburg-regional-transit-gtfs-2430
us-washington-coast-transportation-gtfs-2162
us-washington-columbia-county-public-transportation-gtfs-2168
us-washington-community-in-motion-gtfs-2163
us-washington-eastside-friends-of-seniors-gtfs-2166
us-washington-hopelink-transportation-gtfs-2167
us-washington-intercity-transit-gtfs-2289
us-washington-paratransit-services-gtfs-2176
us-washington-puget-sound-educational-service-district-gtfs-2177
us-washington-sound-generations-hyde-shuttle-gtfs-2183

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.84 3.95 ⬆️+0.11
Median -- 1.33 1.44 ⬆️+0.11
Standard Deviation -- 11.34 11.35 ⬆️+0.01
Minimum in References Reports us-california-santa-clarita-transit-gtfs-812 0.49 0.65 ⬆️+0.16
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 280.94 284.49 ⬆️+3.55
Minimum in Latest Reports ar-buenos-aires-subterraneos-de-buenos-aires-subte-gtfs-6 0.51 0.50 ⬇️-0.01
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 280.94 284.49 ⬆️+3.55
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 458.95 MiB 464.77 MiB ⬆️+5.82 MiB
Median -- 333.20 MiB 331.93 MiB ⬇️-1.27 MiB
Standard Deviation -- 712.42 MiB 764.74 MiB ⬆️+52.32 MiB
Minimum in References Reports nz-south-island-ebus-gtfs-2329 39.86 MiB 415.93 MiB ⬆️+376.07 MiB
Maximum in Reference Reports ch-unknown-swiss-federal-railways-sbb-gtfs-2144 6.94 GiB 7.70 GiB ⬆️+768.68 MiB
Minimum in Latest Reports us-california-commuteorg-san-mateo-county-shuttles-gtfs-61 403.93 MiB 39.01 MiB ⬇️-364.91 MiB
Maximum in Latest Reports ch-unknown-swiss-federal-railways-sbb-gtfs-2144 6.94 GiB 7.70 GiB ⬆️+768.68 MiB

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit 001ef6f
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 1886 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (0 out of 1886 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1886 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1886 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

35 out of 1921 sources (~2 %) are corrupted.
Dataset Ref Report Exists Ref Report Readable Latest Report Exists Latest Report Readable
ca-saskatchewan-moose-jaw-transit-gtfs-2602
de-baden-wuttemberg-nvbw-gtfs-2393.json
de-bayern-munchner-verkehrs--und-tarifverbund-gmbh-mvv-gtfs-2252
de-sachsen-mitteldeutscher-verkehrsverbund-gmbh-mdv-gtfs-2360
fr-eurostar-gtfs-2431.json
il-ministry-of-transport-and-road-safety-gtfs-2519
jp-aomori-aomori-city-bus-gtfs-2607
ro-buzau-transbus-buzau-gtfs-2106
ro-dambovita-servicii-publice-municipale-targoviste-gtfs-2107
ro-prahova-transport-calatori-express-ploiesti-gtfs-2108
us-california-alameda-contra-costa-transit-district-ac-transit-gtfs-2455
us-california-county-connection-gtfs-2421
us-california-regional-transportation-commission-of-southern-nevada-rtc-gtfs-110
us-california-santa-maria-area-transit-gtfs-26
us-california-south-county-transit-link-gtfs-2203
us-california-taft-maricopa-area-transit-gtfs-821
us-california-tri-delta-transit-gtfs-1974
us-florida-gainesville-regional-transit-system-gtfs-2412
us-hawaii-hawaii-mass-transit-agency-hele-on-bus-gtfs-2608
us-illinois-danville-mass-transit-gtfs-2363
us-kansas-salina-gtfs-1867
us-massachusetts-pioneer-valley-transit-authority-pvta-gtfs-2416
us-utah-cache-valley-gtfs-1906
us-virginia-arlington-transit-gtfs-485
us-virginia-fairfax-cue-bus-cue-gtfs-2609
us-virginia-fredericksburg-regional-transit-gtfs-2430
us-washington-coast-transportation-gtfs-2162
us-washington-columbia-county-public-transportation-gtfs-2168
us-washington-community-in-motion-gtfs-2163
us-washington-eastside-friends-of-seniors-gtfs-2166
us-washington-hopelink-transportation-gtfs-2167
us-washington-intercity-transit-gtfs-2289
us-washington-paratransit-services-gtfs-2176
us-washington-puget-sound-educational-service-district-gtfs-2177
us-washington-sound-generations-hyde-shuttle-gtfs-2183

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.83 4.03 ⬆️+0.20
Median -- 1.34 1.46 ⬆️+0.12
Standard Deviation -- 11.43 11.33 ⬇️-0.10
Minimum in References Reports us-indiana-south-shore-line-gtfs-585 0.45 5.52 ⬆️+5.08
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 304.28 295.84 ⬇️-8.44
Minimum in Latest Reports us-oregon-high-desert-point-gtfs-636 0.50 0.44 ⬇️-0.07
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 304.28 295.84 ⬇️-8.44
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 468.64 MiB 458.95 MiB ⬇️-9.69 MiB
Median -- 333.72 MiB 331.93 MiB ⬇️-1.80 MiB
Standard Deviation -- 766.74 MiB 739.52 MiB ⬇️-27.22 MiB
Minimum in References Reports ro-vrancea-consiliul-judetean-vrancea-gtfs-1984 37.99 MiB 68.81 MiB ⬆️+30.81 MiB
Maximum in Reference Reports de-unknown-wurzburger-verkehrsverbund-gtfs-1090 7.41 GiB 6.84 GiB ⬇️-583.56 MiB
Minimum in Latest Reports us-mississipi-jtran-gtfs-155 411.93 MiB 38.86 MiB ⬇️-373.07 MiB
Maximum in Latest Reports ch-unknown-swiss-federal-railways-sbb-gtfs-2144 7.02 GiB 7.66 GiB ⬆️+652.00 MiB

@davidgamez davidgamez requested a review from jcpitre May 7, 2025 13:34
Copy link
Contributor

@qcdyx qcdyx left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit 07bae2a
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (0 out of 1886 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Errors (0 out of 1886 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1886 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1886 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

35 out of 1921 sources (~2 %) are corrupted.
Dataset Ref Report Exists Ref Report Readable Latest Report Exists Latest Report Readable
ca-saskatchewan-moose-jaw-transit-gtfs-2602
de-baden-wuttemberg-nvbw-gtfs-2393.json
de-bayern-munchner-verkehrs--und-tarifverbund-gmbh-mvv-gtfs-2252
de-sachsen-mitteldeutscher-verkehrsverbund-gmbh-mdv-gtfs-2360
fr-eurostar-gtfs-2431.json
il-ministry-of-transport-and-road-safety-gtfs-2519
jp-aomori-aomori-city-bus-gtfs-2607
ro-buzau-transbus-buzau-gtfs-2106
ro-dambovita-servicii-publice-municipale-targoviste-gtfs-2107
ro-prahova-transport-calatori-express-ploiesti-gtfs-2108
us-california-alameda-contra-costa-transit-district-ac-transit-gtfs-2455
us-california-county-connection-gtfs-2421
us-california-regional-transportation-commission-of-southern-nevada-rtc-gtfs-110
us-california-santa-maria-area-transit-gtfs-26
us-california-south-county-transit-link-gtfs-2203
us-california-taft-maricopa-area-transit-gtfs-821
us-california-tri-delta-transit-gtfs-1974
us-florida-gainesville-regional-transit-system-gtfs-2412
us-hawaii-hawaii-mass-transit-agency-hele-on-bus-gtfs-2608
us-illinois-danville-mass-transit-gtfs-2363
us-kansas-salina-gtfs-1867
us-massachusetts-pioneer-valley-transit-authority-pvta-gtfs-2416
us-utah-cache-valley-gtfs-1906
us-virginia-arlington-transit-gtfs-485
us-virginia-fairfax-cue-bus-cue-gtfs-2609
us-virginia-fredericksburg-regional-transit-gtfs-2430
us-washington-coast-transportation-gtfs-2162
us-washington-columbia-county-public-transportation-gtfs-2168
us-washington-community-in-motion-gtfs-2163
us-washington-eastside-friends-of-seniors-gtfs-2166
us-washington-hopelink-transportation-gtfs-2167
us-washington-intercity-transit-gtfs-2289
us-washington-paratransit-services-gtfs-2176
us-washington-puget-sound-educational-service-district-gtfs-2177
us-washington-sound-generations-hyde-shuttle-gtfs-2183

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 3.69 3.85 ⬆️+0.16
Median -- 1.36 1.46 ⬆️+0.11
Standard Deviation -- 9.77 10.60 ⬆️+0.83
Minimum in References Reports us-florida-citrus-county-transit-gtfs-630 0.44 0.53 ⬆️+0.09
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 202.73 265.74 ⬆️+63.01
Minimum in Latest Reports us-oregon-high-desert-point-gtfs-636 0.46 0.50 ⬆️+0.05
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 202.73 265.74 ⬆️+63.01
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 463.66 MiB 462.73 MiB ⬇️-947.67 KiB
Median -- 335.82 MiB 335.93 MiB ⬆️+103.93 KiB
Standard Deviation -- 761.95 MiB 734.65 MiB ⬇️-27.31 MiB
Minimum in References Reports mexico-jalisco-direccion-general-de-transporte-publico-de-puerto-vallarta-gtfs-2034 36.08 MiB 43.11 MiB ⬆️+7.03 MiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 11.81 GiB 5.68 GiB ⬇️-6.13 GiB
Minimum in Latest Reports us-iowa-university-of-iowa-cambus-cambus-gtfs-197 45.46 MiB 40.89 MiB ⬇️-4.57 MiB
Maximum in Latest Reports ch-unknown-swiss-federal-railways-sbb-gtfs-2144 7.85 GiB 7.76 GiB ⬇️-92.39 MiB

@davidgamez davidgamez merged commit 7088563 into master May 8, 2025
135 checks passed
@davidgamez davidgamez deleted the fix/sentry_logging_levels branch May 8, 2025 12:46
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.

Review Web Validator's logging in Sentry

4 participants