Skip to content

Conversation

@bisgaard-itis
Copy link
Contributor

@bisgaard-itis bisgaard-itis commented May 26, 2025

What do these changes do?

  • ✨ Add exemplars to prometheus metrics #7644 introduced a bug which caused exemplars not to be introduced in the prometheus metrics for fastapi services.
  • Fixing this bug I now understand several challenges in the way we setup the tracing: Many of the libraries we do for instrumenting our tools patch the libraries (mock). They don't support "adding" instrumentation to already constructed objects. Because of this the instrumentation has to be setup before objects (e.g. clients) are constructed. On the other hand, the tool we use for instrumenting our FastAPI apps adds a middleware to the app. That middleware should ideally be the first middleware handling a request when it arrives in the app. Because of the way FastAPI adds middlware, that means the instrumentation of the app must be done last. Because of this I have introduced several different methods for setting up tracing of different components/tools.

Related issue/s

How to test

Dev-ops

@codecov
Copy link

codecov bot commented May 26, 2025

Codecov Report

Attention: Patch coverage is 65.38462% with 18 lines in your changes missing coverage. Please review.

Project coverage is 86.48%. Comparing base (a0d9481) to head (e21624b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7750      +/-   ##
==========================================
- Coverage   86.81%   86.48%   -0.33%     
==========================================
  Files        1841     1433     -408     
  Lines       71465    59872   -11593     
  Branches     1214      616     -598     
==========================================
- Hits        62044    51783   -10261     
+ Misses       9078     7889    -1189     
+ Partials      343      200     -143     
Flag Coverage Δ
integrationtests 64.36% <66.66%> (+<0.01%) ⬆️
unittests 86.19% <65.38%> (-0.38%) ⬇️
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 71.86% <50.00%> (-0.02%) ⬇️
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.07% <ø> (+0.17%) ⬆️
agent 96.29% <66.66%> (-0.18%) ⬇️
api_server 91.77% <66.66%> (-0.03%) ⬇️
autoscaling 96.03% <66.66%> (-0.05%) ⬇️
catalog 92.25% <66.66%> (-0.05%) ⬇️
clusters_keeper 99.13% <66.66%> (-0.13%) ⬇️
dask_sidecar 91.67% <ø> (ø)
datcore_adapter 97.94% <66.66%> (-0.19%) ⬇️
director 76.73% <66.66%> (-0.05%) ⬇️
director_v2 90.99% <66.66%> (-0.07%) ⬇️
dynamic_scheduler 96.69% <66.66%> (-0.07%) ⬇️
dynamic_sidecar 90.14% <66.66%> (-0.03%) ⬇️
efs_guardian 89.65% <66.66%> (-0.15%) ⬇️
invitations 93.00% <60.00%> (-0.29%) ⬇️
payments 92.57% <66.66%> (-0.06%) ⬇️
resource_usage_tracker 88.98% <66.66%> (-0.05%) ⬇️
storage 87.71% <66.66%> (-0.10%) ⬇️
webclient ∅ <ø> (∅)
webserver 83.95% <ø> (ø)

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 a0d9481...e21624b. 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.

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.

thanks

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.

oohf, good find! :--)!

@bisgaard-itis bisgaard-itis requested a review from GitHK May 26, 2025 12:57
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

@bisgaard-itis bisgaard-itis requested a review from GitHK May 26, 2025 14:37
@bisgaard-itis bisgaard-itis enabled auto-merge (squash) May 26, 2025 14:41
@sonarqubecloud
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

@bisgaard-itis bisgaard-itis merged commit 6647cd8 into ITISFoundation:master May 27, 2025
94 of 95 checks passed
@bisgaard-itis bisgaard-itis deleted the bugfix-tracing-exemplars branch May 27, 2025 06:57
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Jun 6, 2025
92 tasks
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 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.

7 participants