-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ OpenTelemetry Enhancements: Filter out healthchecks, add catalog internals instrumentation #6752
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
Merged
mrnicegyu11
merged 160 commits into
ITISFoundation:master
from
mrnicegyu11:2024/fix/tracing
Nov 20, 2024
Merged
Changes from 156 commits
Commits
Show all changes
160 commits
Select commit
Hold shift + click to select a range
5160d11
Fix aiohttp server autoinstrumentation with a hack
mrnicegyu11 c777852
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 aa730ed
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 61366a3
minor: fix typo
mrnicegyu11 d1a70da
🎨 backend pulls inputs before iframe is displayed (#6392)
GitHK 77e54ce
🚨🐛 Mitigate dy-service file upload bug: Increase traefik timeouts (#6…
mrnicegyu11 b44eb75
✨ [Frontend] Force reload ``no-cache`` (#6397)
odeimaiz ed2db58
🐛⚗️Prometheus instrumentation incorrectly setup (#6398)
sanderegg 51edfa8
✨E2E: increase timeout for video streaming and improve a bit logs abo…
sanderegg 26aa165
🎨Clusters keeper/use ssm (🚨change in private clusters) (#6361)
sanderegg 9ebe05b
♻️CI: autoscaling mypy takes longer and longer. (#6417)
sanderegg 060c9cb
🐛 Improved Error Handling for Missing Billing Details (#6418)
pcrespov ffba5ae
🎨 Enhances Product parsing to strip whitespaces in host_regex (#6419)
pcrespov 2e287ab
🐛 [Frontend] Fix: Share and Leave Study (#6401)
odeimaiz a876819
✨ [Frontend] Workspaces & Folders: Merge Workspace header and Folder …
odeimaiz fcc7b78
🎨 [Frontend] Access Full TIP (#6423)
odeimaiz 0a11c8e
🐛 [Frontend] Do not list/request ``/frontend/`` service's pricing pla…
odeimaiz e5b9664
Bump actions/setup-node from 4.0.3 to 4.0.4 (#6425)
dependabot[bot] 2129de4
🎨 Persistent logs when GC removes services (#6403)
GitHK 84119ba
🎨 The user can remove themselves from the project/workspace. (#6415)
matusdrobuliak66 aa0b57c
♻️ Maintenance: removing old folders (#6383)
matusdrobuliak66 83b3152
🎨 improve DB foreign key dependencies (🗃️) (#6428)
matusdrobuliak66 529122e
✨ `dynamic-scheduler` pushes service state to the frontend (⚠️ devops…
GitHK 5457f0d
🐛 [Frontend] Fix: Do not listen to output related backend updates if …
odeimaiz 0b7f87e
✅ e2e: new workflow to test `tiplite` (#6388)
pcrespov 83c79c6
🎨 [Frontend] App mode: Scrollable Instructions (#6430)
odeimaiz a712acc
🎨 publish port events to frontend (#6396)
GitHK 8a8319f
🔒️ Strip credentials form image VCS (#6433)
GitHK 699e05b
⬆️ Sep tests and tooling upgrade (#6431)
mrnicegyu11 aaee3b2
✅ fixes check on full version (#6445)
pcrespov aa87f17
🐛 Fixes flaky tests in service-library test_deferred_tasks.py (#6439)
GitHK 97ccf19
🐛 [Frontend] Announcements: allow in ribbon only (#6440)
odeimaiz 76e96c7
🎨 improve error handling on pricing plans (#6436)
matusdrobuliak66 02a7908
🐛[FrontEnd] Better error handling of invalid pre-registration data (#…
pcrespov 6b7f9f8
e2e: fixes wrong sequence in classic tip (#6450)
pcrespov e2a6bdc
🎨 improve tip e2e test (#6448)
matusdrobuliak66 32bedc7
🐛 Fixes issue with parsing logs polluting sidecar logs (#6442)
GitHK bd45d6b
🎨 [Frontend] TIP: Rebranding (#6446)
odeimaiz b6ca20a
Adding favicon for all devices (#6447)
jsaq007 f01b218
🎨 [Frontend] Unify ``border-radius`` (#6451)
odeimaiz 3200fe2
🐛 fix tip e2e test (#6458)
matusdrobuliak66 925b817
🎨 adding `folder_id` to project resource (#6460)
matusdrobuliak66 7dab0e1
✅ e2e: Final touches to tip testing (#6459)
pcrespov afce906
✅ e2e: Fixes typo in tests (#6468)
pcrespov c0ba01a
✨ [Frontend] Keep View Mode in localStorage (#6463)
odeimaiz 54e8174
🎨 [Frontend] Move multiple studies at once (#6457)
odeimaiz d74fa86
✨ New repository helpers on asyncpg (#6465)
pcrespov eca803b
♻️ Preparations in webserver to integrate asyncpg engine (#6466)
pcrespov cd9b335
✨ introduce `/projects:search` full search (#6464)
matusdrobuliak66 d34ac48
🎨 Frees up space on runner for `[build] docker images` part of the CI…
GitHK 4cf5278
🐛🎨 Fixes unhandled config error and new log helpers for better troubl…
pcrespov a90d033
🎨 [Frontend] S4L: Include deprecated versions in plus button, they sh…
odeimaiz 38ea07a
🐛 [Frontend] Guided Tours: point to visible selector or skip (#6481)
odeimaiz 5560acd
🔨📝 Misc improvements in tooling and doc (#6478)
pcrespov 6c46d46
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 8f06a87
Add verbose comment for special call to add midleware
mrnicegyu11 89d9a1d
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 68c6aef
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 6588f3b
🐛 [Frontend] Move grouped nodes (#6486)
odeimaiz 0f1ef1d
🎨 [Frontend] Handle LongRunningTask errors better (#6485)
odeimaiz e3cfd8b
🐛 [Frontend] Fix for Folders disabled scenario (#6488)
odeimaiz b7065d9
🐛 archiving_utils creates deterministic zip archives (#6472)
GitHK b936411
🐛 Fixes duplicates in tags listings and new `priority` to enforce ord…
pcrespov 2dfed79
✨Releases public-api 0.7 (#6489)
pcrespov 1b728af
♻️ Polished and modernised agent service ⚠️ (#6452)
GitHK 783bb1d
🎨 improve project full search (#6483)
matusdrobuliak66 f4dc38b
🎨 efs improvements (group extra properties) 🗃️ (#6493)
matusdrobuliak66 f074e42
🐛 Front-end: fixes PO center widget (#6496)
pcrespov 3ca168d
🎨 Adds authentication for new style dynamic services and platform ven…
GitHK 8b34d98
🎨 Expose env var to raise timeout of downloading/uploading data to an…
GitHK 26e7fd6
🔨 New sql script template to remove readonly user (#6500)
pcrespov 475fd13
🐛 Fixes bad formatting while handling missing configuration errors (#…
pcrespov 9c8d0ec
♻️ increase e2e tip test timeout (#6504)
matusdrobuliak66 4d27c32
🎨 EFS Guardian: adding size monitoring (#6502)
matusdrobuliak66 42682d5
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 3ad20a7
Add middleware test
mrnicegyu11 d98371d
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 cf3eaa0
refactors test
pcrespov c3371b5
moves environs
pcrespov a29b33a
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 2134327
Adress pylint
mrnicegyu11 645cd72
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 c6775d7
Add autoinstrumentation
mrnicegyu11 b1bd7e1
WIP
mrnicegyu11 40580b8
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 c8b8798
Fix director-v0 devel mode
mrnicegyu11 8699445
wip
mrnicegyu11 a3e4da8
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 72f6530
Update packages/service-library/src/servicelib/aiohttp/tracing.py
mrnicegyu11 e80cec7
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 ad200c5
@sanderegg suggestions fixes
mrnicegyu11 1e27f5c
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 ca7480a
@pcrespov change requests
mrnicegyu11 7944713
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 d65f32d
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 ac37bbb
Mypy fixes
mrnicegyu11 d98cb95
mypy fixes
mrnicegyu11 fd0e91e
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 bcf9519
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 63469da
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 6fccbee
🎨 [Frontend] Make the Workspace UI element more distinguishable (#6576)
odeimaiz 8097004
🎨 [Frontend] Small screens: Let them go (#6390)
odeimaiz 8160031
🐛 [Frontend] Fix: Download logs with newlines (Firefox) (#6583)
odeimaiz e08c6d7
🐛Maintenance: upgrade faststream dependency (#6586)
sanderegg f553d49
🐛Deferred tasks: set default log level of messages in Faststream brok…
sanderegg 045e167
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 a57b960
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 a23b97c
Fix director-v0
mrnicegyu11 9e8e794
Remove debugging info from opentelemetry collector
mrnicegyu11 6f36530
Drop heathcheck and PING traces
mrnicegyu11 bf04849
Add a bit of random catalog instrumentation
mrnicegyu11 39edb41
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 fd3dc3a
Disable telemetry in autosclaing unittests
mrnicegyu11 43f2426
Fix EFS service tests
mrnicegyu11 58247fa
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 eb3150d
Try to fix rabbitmq test failure - x-death
mrnicegyu11 7ea7a33
Disable tracing in autoscaling test
mrnicegyu11 9f918bb
Remove aiopika autoinstrumentation
mrnicegyu11 e5a486e
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 415a098
Revert "Drop heathcheck and PING traces"
mrnicegyu11 a8eb8a7
Revert "Add a bit of random catalog instrumentation"
mrnicegyu11 57f430a
Fix: use processors in opentelemetry
mrnicegyu11 48b03fa
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 e572471
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 126c1dd
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 d5c37c7
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 8750016
fix typo
mrnicegyu11 7ba1da4
Remove aio-pika instrumentation, test package auto detection
mrnicegyu11 a6303b3
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 a7d5651
mypy fixes
mrnicegyu11 708c4f9
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 ee3e33e
typecheck fixes
mrnicegyu11 5ee83a9
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 36bc383
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 70635aa
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 a27ba56
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 3d61124
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 6fcdb46
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 489aaf3
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 7a36882
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 edf3ea7
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 fc36beb
Try to fix tests
mrnicegyu11 ef9338c
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 d7a9e09
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 3761dd0
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 3a29496
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 9618539
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 c7f3f05
Merge remote-tracking branch 'upstream/master' into 2024/fix/tracing
mrnicegyu11 1a188eb
Telemetry: Filter out healthchecks and redis PING statements
mrnicegyu11 029bd33
Add some telemetry to catalog internals
mrnicegyu11 42a3bd9
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 c6863a0
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 7721cfc
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 205d5ca
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 c0d70b6
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 0ae4170
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 27f46cc
Revert catalog manual instrumentation as suggested by @bisgaard-itis
mrnicegyu11 2ebd006
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 9d1e5be
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 c849501
Merge branch 'master' into 2024/fix/tracing
mrnicegyu11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| from models_library.api_schemas_catalog.services import ServiceGet, ServiceUpdate | ||
| from models_library.services import ServiceKey, ServiceType, ServiceVersion | ||
| from models_library.services_metadata_published import ServiceMetaDataPublished | ||
| from opentelemetry import trace | ||
| from pydantic import ValidationError | ||
| from pydantic.types import PositiveInt | ||
| from servicelib.fastapi.requests_decorators import cancel_on_disconnect | ||
|
|
@@ -32,6 +33,8 @@ | |
| _logger = logging.getLogger(__name__) | ||
|
|
||
| ServicesSelection: TypeAlias = set[tuple[str, str]] | ||
| # Obtain the tracer from the global tracer provider | ||
| _tracer = trace.get_tracer(__name__) | ||
|
|
||
|
|
||
| def _compose_service_details( | ||
|
|
@@ -105,56 +108,67 @@ async def list_services( | |
| ) | ||
|
|
||
| # now get the executable or writable services | ||
| services_in_db = { | ||
| (s.key, s.version): s | ||
| for s in await services_repo.list_services( | ||
| gids=[group.gid for group in user_groups], | ||
| execute_access=True, | ||
| write_access=True, | ||
| combine_access_with_and=False, | ||
| product_name=x_simcore_products_name, | ||
| ) | ||
| } | ||
| with _tracer.start_as_current_span("services_repo.list_services") as span: | ||
mrnicegyu11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| span.set_attribute("osparc-gids", f"{[group.gid for group in user_groups]}") | ||
| span.set_attribute("osparc-productname", f"{x_simcore_products_name}") | ||
mrnicegyu11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| services_in_db = { | ||
| (s.key, s.version): s | ||
| for s in await services_repo.list_services( | ||
| gids=[group.gid for group in user_groups], | ||
| execute_access=True, | ||
| write_access=True, | ||
| combine_access_with_and=False, | ||
| product_name=x_simcore_products_name, | ||
| ) | ||
| } | ||
| # Non-detailed views from the services_repo database | ||
| if not details: | ||
| # only return a stripped down version | ||
| # NOTE: here validation is not necessary since key,version were already validated | ||
| # in terms of time, this takes the most | ||
| return [ | ||
| ServiceGet.construct( | ||
| key=key, | ||
| version=version, | ||
| name="nodetails", | ||
| description="nodetails", | ||
| type=ServiceType.COMPUTATIONAL, | ||
| authors=[{"name": "nodetails", "email": "[email protected]"}], | ||
| contact="[email protected]", | ||
| inputs={}, | ||
| outputs={}, | ||
| deprecated=services_in_db[(key, version)].deprecated, | ||
| ) | ||
| for key, version in services_in_db | ||
| ] | ||
| with _tracer.start_as_current_span("return-non-detailed-view") as span: | ||
| span.set_attribute("osparc-gids", f"{[group.gid for group in user_groups]}") | ||
| span.set_attribute("osparc-productname", f"{x_simcore_products_name}") | ||
mrnicegyu11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return [ | ||
| ServiceGet.construct( | ||
| key=key, | ||
| version=version, | ||
| name="nodetails", | ||
| description="nodetails", | ||
| type=ServiceType.COMPUTATIONAL, | ||
| authors=[{"name": "nodetails", "email": "[email protected]"}], | ||
| contact="[email protected]", | ||
| inputs={}, | ||
| outputs={}, | ||
| deprecated=services_in_db[(key, version)].deprecated, | ||
| ) | ||
| for key, version in services_in_db | ||
| ] | ||
|
|
||
| # caching this steps brings down the time to generate it at the expense of being sometimes a bit out of date | ||
| @cached(ttl=DIRECTOR_CACHING_TTL) | ||
| async def cached_registry_services() -> dict[str, Any]: | ||
| return cast(dict[str, Any], await director_client.get("/services")) | ||
|
|
||
| ( | ||
| services_in_registry, | ||
| services_access_rights, | ||
| services_owner_emails, | ||
| ) = await asyncio.gather( | ||
| cached_registry_services(), | ||
| services_repo.list_services_access_rights( | ||
| key_versions=services_in_db, | ||
| product_name=x_simcore_products_name, | ||
| ), | ||
| groups_repository.list_user_emails_from_gids( | ||
| {s.owner for s in services_in_db.values() if s.owner} | ||
| ), | ||
| ) | ||
| with _tracer.start_as_current_span( | ||
| "services_repo.list_services_access_rights" | ||
| ) as span: | ||
| span.set_attribute("osparc-gids", f"{[group.gid for group in user_groups]}") | ||
| span.set_attribute("osparc-productname", f"{x_simcore_products_name}") | ||
| ( | ||
| services_in_registry, | ||
| services_access_rights, | ||
| services_owner_emails, | ||
| ) = await asyncio.gather( | ||
| cached_registry_services(), | ||
| services_repo.list_services_access_rights( | ||
| key_versions=services_in_db, | ||
| product_name=x_simcore_products_name, | ||
| ), | ||
| groups_repository.list_user_emails_from_gids( | ||
| {s.owner for s in services_in_db.values() if s.owner} | ||
| ), | ||
| ) | ||
mrnicegyu11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # NOTE: for the details of the services: | ||
| # 1. we get all the services from the director-v0 (TODO: move the registry to the catalog) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.