From 1f9c110d66f6b79b1080236e616ee28869f42910 Mon Sep 17 00:00:00 2001 From: Mads Bisgaard <126242332+bisgaard-itis@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:12:49 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Tracing:=20instrument=20logs=20a?= =?UTF-8?q?nd=20ensure=20traces=20are=20propagated=20through=20`asyncio.Qu?= =?UTF-8?q?eue`s=20(#6857)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/aws-library/requirements/_base.txt | 4 +++ .../service-library/requirements/_base.in | 1 + .../service-library/requirements/_base.txt | 4 +++ .../src/servicelib/async_utils.py | 24 +++++++------ .../src/servicelib/fastapi/tracing.py | 1 - .../src/servicelib/logging_utils.py | 26 +++++++++++++- .../service-library/src/servicelib/tracing.py | 35 +++++++++++++++++++ packages/simcore-sdk/requirements/_base.txt | 4 +++ services/agent/requirements/_base.txt | 6 +++- .../simcore_service_agent/core/application.py | 1 + services/api-server/requirements/_base.txt | 6 ++++ .../core/application.py | 1 + services/autoscaling/requirements/_base.txt | 6 ++++ .../src/simcore_service_autoscaling/main.py | 1 + services/catalog/requirements/_base.txt | 4 +++ .../src/simcore_service_catalog/main.py | 1 + .../clusters-keeper/requirements/_base.txt | 6 ++++ .../simcore_service_clusters_keeper/main.py | 1 + services/dask-sidecar/requirements/_base.txt | 4 +++ .../src/simcore_service_dask_sidecar/tasks.py | 1 + .../datcore-adapter/requirements/_base.txt | 4 +++ .../core/application.py | 1 + services/director-v2/requirements/_base.txt | 6 ++++ .../core/application.py | 1 + services/director/requirements/_base.txt | 4 +++ .../src/simcore_service_director/main.py | 1 + .../dynamic-scheduler/requirements/_base.txt | 6 +++- .../simcore_service_dynamic_scheduler/main.py | 1 + .../dynamic-sidecar/requirements/_base.txt | 8 ++++- .../core/application.py | 1 + services/efs-guardian/requirements/_base.txt | 6 ++++ .../src/simcore_service_efs_guardian/main.py | 1 + services/invitations/requirements/_base.txt | 6 +++- .../src/simcore_service_invitations/main.py | 1 + services/payments/requirements/_base.txt | 6 +++- .../src/simcore_service_payments/main.py | 1 + .../requirements/_base.txt | 6 ++++ .../main.py | 1 + services/storage/requirements/_base.txt | 6 ++++ .../src/simcore_service_storage/cli.py | 1 + services/web/server/requirements/_base.txt | 6 ++++ .../src/simcore_service_webserver/cli.py | 1 + .../src/simcore_service_webserver/log.py | 3 ++ .../with_dbs/03/meta_modeling/conftest.py | 5 ++- .../with_dbs/03/version_control/conftest.py | 5 ++- .../04/studies_dispatcher/conftest.py | 5 ++- tests/swarm-deploy/requirements/_test.txt | 6 ++++ 47 files changed, 216 insertions(+), 20 deletions(-) create mode 100644 packages/service-library/src/servicelib/tracing.py diff --git a/packages/aws-library/requirements/_base.txt b/packages/aws-library/requirements/_base.txt index f4ed9a597c8..ab1ba69c3e5 100644 --- a/packages/aws-library/requirements/_base.txt +++ b/packages/aws-library/requirements/_base.txt @@ -142,6 +142,7 @@ opentelemetry-api==1.27.0 # opentelemetry-exporter-otlp-proto-http # opentelemetry-instrumentation # opentelemetry-instrumentation-botocore + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-propagator-aws-xray @@ -160,10 +161,13 @@ opentelemetry-exporter-otlp-proto-http==1.27.0 opentelemetry-instrumentation==0.48b0 # via # opentelemetry-instrumentation-botocore + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-botocore==0.48b0 # via -r requirements/_base.in +opentelemetry-instrumentation-logging==0.48b0 + # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.48b0 diff --git a/packages/service-library/requirements/_base.in b/packages/service-library/requirements/_base.in index 5a51d883b74..7ac1ce0da04 100644 --- a/packages/service-library/requirements/_base.in +++ b/packages/service-library/requirements/_base.in @@ -20,6 +20,7 @@ opentelemetry-api opentelemetry-exporter-otlp opentelemetry-instrumentation-requests opentelemetry-instrumentation-redis +opentelemetry-instrumentation-logging opentelemetry-sdk psutil pydantic diff --git a/packages/service-library/requirements/_base.txt b/packages/service-library/requirements/_base.txt index e65bfe29d46..9c66cf51cab 100644 --- a/packages/service-library/requirements/_base.txt +++ b/packages/service-library/requirements/_base.txt @@ -101,6 +101,7 @@ opentelemetry-api==1.27.0 # opentelemetry-exporter-otlp-proto-grpc # opentelemetry-exporter-otlp-proto-http # opentelemetry-instrumentation + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -117,8 +118,11 @@ opentelemetry-exporter-otlp-proto-http==1.27.0 # via opentelemetry-exporter-otlp opentelemetry-instrumentation==0.48b0 # via + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests +opentelemetry-instrumentation-logging==0.48b0 + # via -r requirements/_base.in opentelemetry-instrumentation-redis==0.48b0 # via -r requirements/_base.in opentelemetry-instrumentation-requests==0.48b0 diff --git a/packages/service-library/src/servicelib/async_utils.py b/packages/service-library/src/servicelib/async_utils.py index 42ba951aafb..0b1a6b27ca5 100644 --- a/packages/service-library/src/servicelib/async_utils.py +++ b/packages/service-library/src/servicelib/async_utils.py @@ -6,6 +6,7 @@ from functools import wraps from typing import TYPE_CHECKING, Any, Awaitable, Callable, Deque +from . import tracing from .utils_profiling_middleware import dont_profile, is_profiling, profile_context logger = logging.getLogger(__name__) @@ -34,6 +35,7 @@ class Context: @dataclass class QueueElement: + tracing_context: tracing.TracingContext do_profile: bool = False input: Awaitable | None = None output: Any | None = None @@ -162,16 +164,17 @@ async def worker(in_q: Queue[QueueElement], out_q: Queue) -> None: while True: element = await in_q.get() in_q.task_done() - # check if requested to shutdown - try: - do_profile = element.do_profile - awaitable = element.input - if awaitable is None: - break - with profile_context(do_profile): - result = await awaitable - except Exception as e: # pylint: disable=broad-except - result = e + with tracing.use_tracing_context(element.tracing_context): + # check if requested to shutdown + try: + do_profile = element.do_profile + awaitable = element.input + if awaitable is None: + break + with profile_context(do_profile): + result = await awaitable + except Exception as e: # pylint: disable=broad-except + result = e await out_q.put(result) logging.info( @@ -189,6 +192,7 @@ async def worker(in_q: Queue[QueueElement], out_q: Queue) -> None: queue_input = QueueElement( input=decorated_function(*args, **kwargs), do_profile=is_profiling(), + tracing_context=tracing.get_context(), ) await context.in_queue.put(queue_input) wrapped_result = await context.out_queue.get() diff --git a/packages/service-library/src/servicelib/fastapi/tracing.py b/packages/service-library/src/servicelib/fastapi/tracing.py index ee0258d93f4..e2cce12c319 100644 --- a/packages/service-library/src/servicelib/fastapi/tracing.py +++ b/packages/service-library/src/servicelib/fastapi/tracing.py @@ -70,7 +70,6 @@ def setup_tracing( ): _logger.warning("Skipping opentelemetry tracing setup") return - # Set up the tracer provider resource = Resource(attributes={"service.name": service_name}) trace.set_tracer_provider(TracerProvider(resource=resource)) diff --git a/packages/service-library/src/servicelib/logging_utils.py b/packages/service-library/src/servicelib/logging_utils.py index 1ee9494a84b..0db4b2febd3 100644 --- a/packages/service-library/src/servicelib/logging_utils.py +++ b/packages/service-library/src/servicelib/logging_utils.py @@ -16,7 +16,10 @@ from pathlib import Path from typing import Any, NotRequired, TypeAlias, TypedDict, TypeVar +from settings_library.tracing import TracingSettings + from .logging_utils_filtering import GeneralLogFilter, LoggerName, MessageSubstring +from .tracing import setup_log_tracing from .utils_secrets import mask_sensitive_data _logger = logging.getLogger(__name__) @@ -121,11 +124,11 @@ def config_all_loggers( *, log_format_local_dev_enabled: bool, logger_filter_mapping: dict[LoggerName, list[MessageSubstring]], + tracing_settings: TracingSettings | None, ) -> None: """ Applies common configuration to ALL registered loggers """ - fmt = DEFAULT_FORMATTING the_manager: logging.Manager = logging.Logger.manager root_logger = logging.getLogger() @@ -133,8 +136,29 @@ def config_all_loggers( logging.getLogger(name) for name in the_manager.loggerDict ] + fmt = DEFAULT_FORMATTING + if tracing_settings is not None: + fmt = ( + "log_level=%(levelname)s " + "| log_timestamp=%(asctime)s " + "| log_source=%(name)s:%(funcName)s(%(lineno)d) " + "| log_uid=%(log_uid)s " + "| log_oec=%(log_oec)s" + "| log_trace_id=%(otelTraceID)s " + "| log_span_id=%(otelSpanID)s " + "| log_resource.service.name=%(otelServiceName)s " + "| log_trace_sampled=%(otelTraceSampled)s] " + "| log_msg=%(message)s" + ) + setup_log_tracing(tracing_settings=tracing_settings) if log_format_local_dev_enabled: fmt = LOCAL_FORMATTING + if tracing_settings is not None: + fmt = ( + "%(levelname)s: [%(asctime)s/%(processName)s] " + "[log_trace_id=%(otelTraceID)s log_span_id=%(otelSpanID)s log_resource.service.name=%(otelServiceName)s log_trace_sampled=%(otelTraceSampled)s] " + "[%(name)s:%(funcName)s(%(lineno)d)] - %(message)s" + ) for logger in loggers: _set_logging_handler( diff --git a/packages/service-library/src/servicelib/tracing.py b/packages/service-library/src/servicelib/tracing.py new file mode 100644 index 00000000000..6635e824a46 --- /dev/null +++ b/packages/service-library/src/servicelib/tracing.py @@ -0,0 +1,35 @@ +from contextlib import contextmanager +from typing import TypeAlias + +from opentelemetry import context as otcontext +from opentelemetry import trace +from opentelemetry.instrumentation.logging import LoggingInstrumentor +from settings_library.tracing import TracingSettings + +TracingContext: TypeAlias = otcontext.Context | None + + +def _is_tracing() -> bool: + return trace.get_current_span().is_recording() + + +def get_context() -> TracingContext: + if not _is_tracing(): + return None + return otcontext.get_current() + + +@contextmanager +def use_tracing_context(context: TracingContext): + if context is not None: + otcontext.attach(context) + try: + yield + finally: + if context is not None: + otcontext.detach(context) + + +def setup_log_tracing(tracing_settings: TracingSettings): + _ = tracing_settings + LoggingInstrumentor().instrument(set_logging_format=False) diff --git a/packages/simcore-sdk/requirements/_base.txt b/packages/simcore-sdk/requirements/_base.txt index 541037d54fe..b00b9f66957 100644 --- a/packages/simcore-sdk/requirements/_base.txt +++ b/packages/simcore-sdk/requirements/_base.txt @@ -165,6 +165,7 @@ opentelemetry-api==1.27.0 # opentelemetry-instrumentation-aiopg # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-dbapi + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -184,6 +185,7 @@ opentelemetry-instrumentation==0.48b0 # opentelemetry-instrumentation-aiopg # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-dbapi + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-aiopg==0.48b0 @@ -192,6 +194,8 @@ opentelemetry-instrumentation-asyncpg==0.48b0 # via -r requirements/../../../packages/postgres-database/requirements/_base.in opentelemetry-instrumentation-dbapi==0.48b0 # via opentelemetry-instrumentation-aiopg +opentelemetry-instrumentation-logging==0.48b0 + # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.48b0 diff --git a/services/agent/requirements/_base.txt b/services/agent/requirements/_base.txt index 4fddb46bb50..95f8e56d4cb 100644 --- a/services/agent/requirements/_base.txt +++ b/services/agent/requirements/_base.txt @@ -157,6 +157,7 @@ opentelemetry-api==1.28.2 # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -176,6 +177,7 @@ opentelemetry-instrumentation==0.49b2 # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.49b2 @@ -184,7 +186,9 @@ opentelemetry-instrumentation-fastapi==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in -opentelemetry-instrumentation-redis==0.49b2 +opentelemetry-instrumentation-logging==0.48b0 + # via -r requirements/../../../packages/service-library/requirements/_base.in +opentelemetry-instrumentation-redis==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/agent/src/simcore_service_agent/core/application.py b/services/agent/src/simcore_service_agent/core/application.py index 42cc067a211..fe226a33558 100644 --- a/services/agent/src/simcore_service_agent/core/application.py +++ b/services/agent/src/simcore_service_agent/core/application.py @@ -33,6 +33,7 @@ def _setup_logger(settings: ApplicationSettings): config_all_loggers( log_format_local_dev_enabled=settings.AGENT_VOLUMES_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=settings.AGENT_VOLUMES_LOG_FILTER_MAPPING, + tracing_settings=settings.AGENT_TRACING, ) diff --git a/services/api-server/requirements/_base.txt b/services/api-server/requirements/_base.txt index bb064316789..48d12d8b832 100644 --- a/services/api-server/requirements/_base.txt +++ b/services/api-server/requirements/_base.txt @@ -357,6 +357,7 @@ opentelemetry-api==1.27.0 # opentelemetry-instrumentation-dbapi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -381,6 +382,7 @@ opentelemetry-instrumentation==0.48b0 # opentelemetry-instrumentation-dbapi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-aiopg==0.48b0 @@ -397,6 +399,10 @@ opentelemetry-instrumentation-fastapi==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in +opentelemetry-instrumentation-logging==0.48b0 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.48b0 # via # -r requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/api-server/src/simcore_service_api_server/core/application.py b/services/api-server/src/simcore_service_api_server/core/application.py index 8f9eed26ef3..714d7993b6b 100644 --- a/services/api-server/src/simcore_service_api_server/core/application.py +++ b/services/api-server/src/simcore_service_api_server/core/application.py @@ -54,6 +54,7 @@ def init_app(settings: ApplicationSettings | None = None) -> FastAPI: config_all_loggers( log_format_local_dev_enabled=settings.API_SERVER_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=settings.API_SERVER_LOG_FILTER_MAPPING, + tracing_settings=settings.API_SERVER_TRACING, ) _logger.debug("App settings:\n%s", settings.model_dump_json(indent=2)) diff --git a/services/autoscaling/requirements/_base.txt b/services/autoscaling/requirements/_base.txt index 5b02f55cb96..dec4d478b86 100644 --- a/services/autoscaling/requirements/_base.txt +++ b/services/autoscaling/requirements/_base.txt @@ -297,6 +297,7 @@ opentelemetry-api==1.26.0 # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-propagator-aws-xray @@ -320,6 +321,7 @@ opentelemetry-instrumentation==0.47b0 # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.47b0 @@ -330,6 +332,10 @@ opentelemetry-instrumentation-fastapi==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in +opentelemetry-instrumentation-logging==0.47b0 + # via + # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.47b0 # via # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/autoscaling/src/simcore_service_autoscaling/main.py b/services/autoscaling/src/simcore_service_autoscaling/main.py index c73f3bdf94c..102258cac70 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/main.py +++ b/services/autoscaling/src/simcore_service_autoscaling/main.py @@ -15,6 +15,7 @@ config_all_loggers( log_format_local_dev_enabled=the_settings.AUTOSCALING_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=the_settings.AUTOSCALING_LOG_FILTER_MAPPING, + tracing_settings=the_settings.AUTOSCALING_TRACING, ) # SINGLETON FastAPI app diff --git a/services/catalog/requirements/_base.txt b/services/catalog/requirements/_base.txt index 78fac9431bf..3c2384e6ebb 100644 --- a/services/catalog/requirements/_base.txt +++ b/services/catalog/requirements/_base.txt @@ -222,6 +222,7 @@ opentelemetry-api==1.27.0 # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -242,6 +243,7 @@ opentelemetry-instrumentation==0.48b0 # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.48b0 @@ -252,6 +254,8 @@ opentelemetry-instrumentation-fastapi==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in +opentelemetry-instrumentation-logging==0.48b0 + # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.48b0 diff --git a/services/catalog/src/simcore_service_catalog/main.py b/services/catalog/src/simcore_service_catalog/main.py index 53cd5da07c5..52bd949a542 100644 --- a/services/catalog/src/simcore_service_catalog/main.py +++ b/services/catalog/src/simcore_service_catalog/main.py @@ -16,6 +16,7 @@ config_all_loggers( log_format_local_dev_enabled=_the_settings.CATALOG_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=_the_settings.CATALOG_LOG_FILTER_MAPPING, + tracing_settings=_the_settings.CATALOG_TRACING, ) diff --git a/services/clusters-keeper/requirements/_base.txt b/services/clusters-keeper/requirements/_base.txt index 15a9a8f8114..b5e0a2e1b12 100644 --- a/services/clusters-keeper/requirements/_base.txt +++ b/services/clusters-keeper/requirements/_base.txt @@ -295,6 +295,7 @@ opentelemetry-api==1.26.0 # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-propagator-aws-xray @@ -318,6 +319,7 @@ opentelemetry-instrumentation==0.47b0 # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.47b0 @@ -328,6 +330,10 @@ opentelemetry-instrumentation-fastapi==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in +opentelemetry-instrumentation-logging==0.47b0 + # via + # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.47b0 # via # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/main.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/main.py index bcf872e807d..b2844bde6af 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/main.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/main.py @@ -15,6 +15,7 @@ config_all_loggers( log_format_local_dev_enabled=the_settings.CLUSTERS_KEEPER_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=the_settings.CLUSTERS_KEEPER_LOG_FILTER_MAPPING, + tracing_settings=the_settings.CLUSTERS_KEEPER_TRACING, ) # SINGLETON FastAPI app diff --git a/services/dask-sidecar/requirements/_base.txt b/services/dask-sidecar/requirements/_base.txt index 15392d474dd..0096bb1b261 100644 --- a/services/dask-sidecar/requirements/_base.txt +++ b/services/dask-sidecar/requirements/_base.txt @@ -209,6 +209,7 @@ opentelemetry-api==1.26.0 # opentelemetry-exporter-otlp-proto-grpc # opentelemetry-exporter-otlp-proto-http # opentelemetry-instrumentation + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -225,8 +226,11 @@ opentelemetry-exporter-otlp-proto-http==1.26.0 # via opentelemetry-exporter-otlp opentelemetry-instrumentation==0.47b0 # via + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests +opentelemetry-instrumentation-logging==0.47b0 + # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.47b0 diff --git a/services/dask-sidecar/src/simcore_service_dask_sidecar/tasks.py b/services/dask-sidecar/src/simcore_service_dask_sidecar/tasks.py index c8611a500ed..cc061d6cd39 100644 --- a/services/dask-sidecar/src/simcore_service_dask_sidecar/tasks.py +++ b/services/dask-sidecar/src/simcore_service_dask_sidecar/tasks.py @@ -65,6 +65,7 @@ async def dask_setup(worker: distributed.Worker) -> None: config_all_loggers( log_format_local_dev_enabled=settings.DASK_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=settings.DASK_LOG_FILTER_MAPPING, + tracing_settings=None, # no tracing for dask sidecar ) logger.info("Setting up worker...") diff --git a/services/datcore-adapter/requirements/_base.txt b/services/datcore-adapter/requirements/_base.txt index fca17558d12..7e0a7936e48 100644 --- a/services/datcore-adapter/requirements/_base.txt +++ b/services/datcore-adapter/requirements/_base.txt @@ -178,6 +178,7 @@ opentelemetry-api==1.26.0 # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -197,6 +198,7 @@ opentelemetry-instrumentation==0.47b0 # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.47b0 @@ -205,6 +207,8 @@ opentelemetry-instrumentation-fastapi==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in +opentelemetry-instrumentation-logging==0.47b0 + # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.47b0 diff --git a/services/datcore-adapter/src/simcore_service_datcore_adapter/core/application.py b/services/datcore-adapter/src/simcore_service_datcore_adapter/core/application.py index ff2e7741164..d653dc6a090 100644 --- a/services/datcore-adapter/src/simcore_service_datcore_adapter/core/application.py +++ b/services/datcore-adapter/src/simcore_service_datcore_adapter/core/application.py @@ -42,6 +42,7 @@ def create_app(settings: ApplicationSettings | None = None) -> FastAPI: config_all_loggers( log_format_local_dev_enabled=settings.DATCORE_ADAPTER_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=settings.DATCORE_ADAPTER_LOG_FILTER_MAPPING, + tracing_settings=settings.DATCORE_ADAPTER_TRACING, ) # keep mostly quiet noisy loggers diff --git a/services/director-v2/requirements/_base.txt b/services/director-v2/requirements/_base.txt index 20ff744f93c..0d514a1b886 100644 --- a/services/director-v2/requirements/_base.txt +++ b/services/director-v2/requirements/_base.txt @@ -406,6 +406,7 @@ opentelemetry-api==1.27.0 # opentelemetry-instrumentation-dbapi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -430,6 +431,7 @@ opentelemetry-instrumentation==0.48b0 # opentelemetry-instrumentation-dbapi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-aiopg==0.48b0 @@ -446,6 +448,10 @@ opentelemetry-instrumentation-fastapi==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in +opentelemetry-instrumentation-logging==0.48b0 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.48b0 # via # -r requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/director-v2/src/simcore_service_director_v2/core/application.py b/services/director-v2/src/simcore_service_director_v2/core/application.py index 4b62b4ce73c..be96e845307 100644 --- a/services/director-v2/src/simcore_service_director_v2/core/application.py +++ b/services/director-v2/src/simcore_service_director_v2/core/application.py @@ -108,6 +108,7 @@ def create_base_app(settings: AppSettings | None = None) -> FastAPI: config_all_loggers( log_format_local_dev_enabled=settings.DIRECTOR_V2_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=settings.DIRECTOR_V2_LOG_FILTER_MAPPING, + tracing_settings=settings.DIRECTOR_V2_TRACING, ) _logger.debug(settings.model_dump_json(indent=2)) diff --git a/services/director/requirements/_base.txt b/services/director/requirements/_base.txt index 67e2c6e55f3..ced8f7909f0 100644 --- a/services/director/requirements/_base.txt +++ b/services/director/requirements/_base.txt @@ -192,6 +192,7 @@ opentelemetry-api==1.28.1 # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -211,6 +212,7 @@ opentelemetry-instrumentation==0.49b1 # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.49b1 @@ -219,6 +221,8 @@ opentelemetry-instrumentation-fastapi==0.49b1 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.49b1 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in +opentelemetry-instrumentation-logging==0.49b1 + # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.49b1 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.49b1 diff --git a/services/director/src/simcore_service_director/main.py b/services/director/src/simcore_service_director/main.py index 02636e753bf..da0c480065f 100644 --- a/services/director/src/simcore_service_director/main.py +++ b/services/director/src/simcore_service_director/main.py @@ -17,6 +17,7 @@ config_all_loggers( log_format_local_dev_enabled=_the_settings.DIRECTOR_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=_the_settings.DIRECTOR_LOG_FILTER_MAPPING, + tracing_settings=_the_settings.DIRECTOR_TRACING, ) # SINGLETON FastAPI app diff --git a/services/dynamic-scheduler/requirements/_base.txt b/services/dynamic-scheduler/requirements/_base.txt index c6fcc166562..dd73276b15a 100644 --- a/services/dynamic-scheduler/requirements/_base.txt +++ b/services/dynamic-scheduler/requirements/_base.txt @@ -231,6 +231,7 @@ opentelemetry-api==1.28.2 # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -251,6 +252,7 @@ opentelemetry-instrumentation==0.49b2 # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.49b2 @@ -261,7 +263,9 @@ opentelemetry-instrumentation-fastapi==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in -opentelemetry-instrumentation-redis==0.49b2 +opentelemetry-instrumentation-logging==0.48b0 + # via -r requirements/../../../packages/service-library/requirements/_base.in +opentelemetry-instrumentation-redis==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/main.py b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/main.py index 4431038df10..ab726883237 100644 --- a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/main.py +++ b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/main.py @@ -15,6 +15,7 @@ config_all_loggers( log_format_local_dev_enabled=_the_settings.DYNAMIC_SCHEDULER_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=_the_settings.DYNAMIC_SCHEDULER_LOG_FILTER_MAPPING, + tracing_settings=_the_settings.DYNAMIC_SCHEDULER_TRACING, ) # SINGLETON FastAPI app diff --git a/services/dynamic-sidecar/requirements/_base.txt b/services/dynamic-sidecar/requirements/_base.txt index 10ad9581448..02aab36cf3b 100644 --- a/services/dynamic-sidecar/requirements/_base.txt +++ b/services/dynamic-sidecar/requirements/_base.txt @@ -286,6 +286,7 @@ opentelemetry-api==1.28.2 # opentelemetry-instrumentation-dbapi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -310,6 +311,7 @@ opentelemetry-instrumentation==0.49b2 # opentelemetry-instrumentation-dbapi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-aiopg==0.49b2 @@ -326,7 +328,11 @@ opentelemetry-instrumentation-fastapi==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in -opentelemetry-instrumentation-redis==0.49b2 +opentelemetry-instrumentation-logging==0.48b0 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in +opentelemetry-instrumentation-redis==0.48b0 # via # -r requirements/../../../packages/service-library/requirements/_base.in # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/application.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/application.py index 5fd6c90b26b..58c5495563f 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/application.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/application.py @@ -119,6 +119,7 @@ def setup_logger(settings: ApplicationSettings): config_all_loggers( log_format_local_dev_enabled=settings.DY_SIDECAR_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=settings.DY_SIDECAR_LOG_FILTER_MAPPING, + tracing_settings=settings.DYNAMIC_SIDECAR_TRACING, ) diff --git a/services/efs-guardian/requirements/_base.txt b/services/efs-guardian/requirements/_base.txt index c5dbeb68306..558b6f5b43e 100644 --- a/services/efs-guardian/requirements/_base.txt +++ b/services/efs-guardian/requirements/_base.txt @@ -278,6 +278,7 @@ opentelemetry-api==1.27.0 # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-propagator-aws-xray @@ -302,6 +303,7 @@ opentelemetry-instrumentation==0.48b0 # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.48b0 @@ -314,6 +316,10 @@ opentelemetry-instrumentation-fastapi==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in +opentelemetry-instrumentation-logging==0.48b0 + # via + # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.48b0 # via # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/efs-guardian/src/simcore_service_efs_guardian/main.py b/services/efs-guardian/src/simcore_service_efs_guardian/main.py index f155d24f0f8..711d32d83ee 100644 --- a/services/efs-guardian/src/simcore_service_efs_guardian/main.py +++ b/services/efs-guardian/src/simcore_service_efs_guardian/main.py @@ -15,6 +15,7 @@ config_all_loggers( log_format_local_dev_enabled=the_settings.EFS_GUARDIAN_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=the_settings.EFS_GUARDIAN_LOG_FILTER_MAPPING, + tracing_settings=the_settings.EFS_GUARDIAN_TRACING, ) # SINGLETON FastAPI app diff --git a/services/invitations/requirements/_base.txt b/services/invitations/requirements/_base.txt index 38827d398db..4aad9be2472 100644 --- a/services/invitations/requirements/_base.txt +++ b/services/invitations/requirements/_base.txt @@ -175,6 +175,7 @@ opentelemetry-api==1.28.2 # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -194,6 +195,7 @@ opentelemetry-instrumentation==0.49b2 # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.49b2 @@ -202,7 +204,9 @@ opentelemetry-instrumentation-fastapi==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in -opentelemetry-instrumentation-redis==0.49b2 +opentelemetry-instrumentation-logging==0.47b0 + # via -r requirements/../../../packages/service-library/requirements/_base.in +opentelemetry-instrumentation-redis==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/invitations/src/simcore_service_invitations/main.py b/services/invitations/src/simcore_service_invitations/main.py index 407e239c1bd..4a21e994b31 100644 --- a/services/invitations/src/simcore_service_invitations/main.py +++ b/services/invitations/src/simcore_service_invitations/main.py @@ -17,6 +17,7 @@ config_all_loggers( log_format_local_dev_enabled=the_settings.INVITATIONS_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=the_settings.INVITATIONS_LOG_FILTER_MAPPING, + tracing_settings=the_settings.INVITATIONS_TRACING, ) # SINGLETON FastAPI app diff --git a/services/payments/requirements/_base.txt b/services/payments/requirements/_base.txt index 4d758aea4d6..e021ae5074c 100644 --- a/services/payments/requirements/_base.txt +++ b/services/payments/requirements/_base.txt @@ -236,6 +236,7 @@ opentelemetry-api==1.28.2 # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -256,6 +257,7 @@ opentelemetry-instrumentation==0.49b2 # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.49b2 @@ -266,7 +268,9 @@ opentelemetry-instrumentation-fastapi==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in -opentelemetry-instrumentation-redis==0.49b2 +opentelemetry-instrumentation-logging==0.48b0 + # via -r requirements/../../../packages/service-library/requirements/_base.in +opentelemetry-instrumentation-redis==0.48b0 # via -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-requests==0.49b2 # via -r requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/payments/src/simcore_service_payments/main.py b/services/payments/src/simcore_service_payments/main.py index 6ff09676f1f..53e19bd22a1 100644 --- a/services/payments/src/simcore_service_payments/main.py +++ b/services/payments/src/simcore_service_payments/main.py @@ -17,6 +17,7 @@ config_all_loggers( log_format_local_dev_enabled=_the_settings.PAYMENTS_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=_the_settings.PAYMENTS_LOG_FILTER_MAPPING, + tracing_settings=_the_settings.PAYMENTS_TRACING, ) # SINGLETON FastAPI app diff --git a/services/resource-usage-tracker/requirements/_base.txt b/services/resource-usage-tracker/requirements/_base.txt index da9a82895d9..45848d96288 100644 --- a/services/resource-usage-tracker/requirements/_base.txt +++ b/services/resource-usage-tracker/requirements/_base.txt @@ -300,6 +300,7 @@ opentelemetry-api==1.26.0 # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-propagator-aws-xray @@ -324,6 +325,7 @@ opentelemetry-instrumentation==0.47b0 # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-asgi==0.47b0 @@ -336,6 +338,10 @@ opentelemetry-instrumentation-fastapi==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in opentelemetry-instrumentation-httpx==0.47b0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in +opentelemetry-instrumentation-logging==0.47b0 + # via + # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.47b0 # via # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/main.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/main.py index 05890bd7a51..079ba5cdf79 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/main.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/main.py @@ -17,6 +17,7 @@ config_all_loggers( log_format_local_dev_enabled=the_settings.RESOURCE_USAGE_TRACKER_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=the_settings.RESOURCE_USAGE_TRACKER_LOG_FILTER_MAPPING, + tracing_settings=the_settings.RESOURCE_USAGE_TRACKER_TRACING, ) # SINGLETON FastAPI app diff --git a/services/storage/requirements/_base.txt b/services/storage/requirements/_base.txt index c5a74d9831e..203572eef60 100644 --- a/services/storage/requirements/_base.txt +++ b/services/storage/requirements/_base.txt @@ -276,6 +276,7 @@ opentelemetry-api==1.26.0 # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-dbapi + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-propagator-aws-xray @@ -301,6 +302,7 @@ opentelemetry-instrumentation==0.47b0 # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-botocore # opentelemetry-instrumentation-dbapi + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-aiohttp-client==0.47b0 @@ -317,6 +319,10 @@ opentelemetry-instrumentation-botocore==0.47b0 # -r requirements/_base.in opentelemetry-instrumentation-dbapi==0.47b0 # via opentelemetry-instrumentation-aiopg +opentelemetry-instrumentation-logging==0.47b0 + # via + # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.47b0 # via # -r requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/_base.in diff --git a/services/storage/src/simcore_service_storage/cli.py b/services/storage/src/simcore_service_storage/cli.py index d50d540d5b4..bf37855e6c8 100644 --- a/services/storage/src/simcore_service_storage/cli.py +++ b/services/storage/src/simcore_service_storage/cli.py @@ -28,6 +28,7 @@ def run(): config_all_loggers( log_format_local_dev_enabled=settings_obj.STORAGE_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=settings_obj.STORAGE_LOG_FILTER_MAPPING, + tracing_settings=settings_obj.STORAGE_TRACING, ) # keep mostly quiet noisy loggers diff --git a/services/web/server/requirements/_base.txt b/services/web/server/requirements/_base.txt index cc870dec999..ada75776f9e 100644 --- a/services/web/server/requirements/_base.txt +++ b/services/web/server/requirements/_base.txt @@ -340,6 +340,7 @@ opentelemetry-api==1.27.0 # opentelemetry-instrumentation-aiopg # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-dbapi + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -363,6 +364,7 @@ opentelemetry-instrumentation==0.48b0 # opentelemetry-instrumentation-aiopg # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-dbapi + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-aiohttp-client==0.48b0 @@ -380,6 +382,10 @@ opentelemetry-instrumentation-asyncpg==0.48b0 # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in opentelemetry-instrumentation-dbapi==0.48b0 # via opentelemetry-instrumentation-aiopg +opentelemetry-instrumentation-logging==0.48b0 + # via + # -r requirements/../../../../packages/service-library/requirements/_base.in + # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.48b0 # via # -r requirements/../../../../packages/service-library/requirements/_base.in diff --git a/services/web/server/src/simcore_service_webserver/cli.py b/services/web/server/src/simcore_service_webserver/cli.py index b09f4eca0c4..feec4b29e0c 100644 --- a/services/web/server/src/simcore_service_webserver/cli.py +++ b/services/web/server/src/simcore_service_webserver/cli.py @@ -57,6 +57,7 @@ def _setup_app_from_settings( slow_duration=settings.AIODEBUG_SLOW_DURATION_SECS, log_format_local_dev_enabled=settings.WEBSERVER_LOG_FORMAT_LOCAL_DEV_ENABLED, logger_filter_mapping=settings.WEBSERVER_LOG_FILTER_MAPPING, + tracing_settings=settings.WEBSERVER_TRACING, ) app = create_application() diff --git a/services/web/server/src/simcore_service_webserver/log.py b/services/web/server/src/simcore_service_webserver/log.py index ee6957732f4..f1cbbada057 100644 --- a/services/web/server/src/simcore_service_webserver/log.py +++ b/services/web/server/src/simcore_service_webserver/log.py @@ -7,6 +7,7 @@ from aiodebug import log_slow_callbacks # type: ignore[import-untyped] from aiohttp.log import access_logger from servicelib.logging_utils import config_all_loggers +from settings_library.tracing import TracingSettings LOG_LEVEL_STEP = logging.CRITICAL - logging.ERROR NOISY_LOGGERS = ( @@ -29,6 +30,7 @@ def setup_logging( slow_duration: float | None = None, log_format_local_dev_enabled: bool, logger_filter_mapping: dict, + tracing_settings: TracingSettings | None ): # service log level logging.basicConfig(level=level) @@ -38,6 +40,7 @@ def setup_logging( config_all_loggers( log_format_local_dev_enabled=log_format_local_dev_enabled, logger_filter_mapping=logger_filter_mapping, + tracing_settings=tracing_settings, ) # Enforces same log-level to aiohttp & gunicorn access loggers diff --git a/services/web/server/tests/unit/with_dbs/03/meta_modeling/conftest.py b/services/web/server/tests/unit/with_dbs/03/meta_modeling/conftest.py index 2a26d924622..3b965a09e46 100644 --- a/services/web/server/tests/unit/with_dbs/03/meta_modeling/conftest.py +++ b/services/web/server/tests/unit/with_dbs/03/meta_modeling/conftest.py @@ -68,7 +68,10 @@ def app_cfg(default_app_cfg, unused_tcp_port_factory, monkeypatch) -> dict[str, # NOTE: To see logs, use pytest -s --log-cli-level=DEBUG setup_logging( - level=logging.DEBUG, log_format_local_dev_enabled=True, logger_filter_mapping={} + level=logging.DEBUG, + log_format_local_dev_enabled=True, + logger_filter_mapping={}, + tracing_settings=None, ) # Enforces smallest GC in the background task diff --git a/services/web/server/tests/unit/with_dbs/03/version_control/conftest.py b/services/web/server/tests/unit/with_dbs/03/version_control/conftest.py index 679091f6e85..6903e2e1ef5 100644 --- a/services/web/server/tests/unit/with_dbs/03/version_control/conftest.py +++ b/services/web/server/tests/unit/with_dbs/03/version_control/conftest.py @@ -122,7 +122,10 @@ def app_cfg( # NOTE: To see logs, use pytest -s --log-cli-level=DEBUG setup_logging( - level=logging.DEBUG, log_format_local_dev_enabled=True, logger_filter_mapping={} + level=logging.DEBUG, + log_format_local_dev_enabled=True, + logger_filter_mapping={}, + tracing_settings=None, ) # Enforces smallest GC in the background task diff --git a/services/web/server/tests/unit/with_dbs/04/studies_dispatcher/conftest.py b/services/web/server/tests/unit/with_dbs/04/studies_dispatcher/conftest.py index a03a5713e59..864dbbe7be0 100644 --- a/services/web/server/tests/unit/with_dbs/04/studies_dispatcher/conftest.py +++ b/services/web/server/tests/unit/with_dbs/04/studies_dispatcher/conftest.py @@ -54,7 +54,10 @@ def app_environment(app_environment: EnvVarsDict, monkeypatch: pytest.MonkeyPatc # NOTE: To see logs, use pytest -s --log-cli-level=DEBUG setup_logging( - level=logging.DEBUG, log_format_local_dev_enabled=True, logger_filter_mapping={} + level=logging.DEBUG, + log_format_local_dev_enabled=True, + logger_filter_mapping={}, + tracing_settings=None, ) plugin_settings = StudiesDispatcherSettings.create_from_envs() diff --git a/tests/swarm-deploy/requirements/_test.txt b/tests/swarm-deploy/requirements/_test.txt index ddd2910ff59..e18b8c99a1b 100644 --- a/tests/swarm-deploy/requirements/_test.txt +++ b/tests/swarm-deploy/requirements/_test.txt @@ -240,6 +240,7 @@ opentelemetry-api==1.27.0 # opentelemetry-instrumentation-aiopg # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-dbapi + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests # opentelemetry-sdk @@ -261,6 +262,7 @@ opentelemetry-instrumentation==0.48b0 # opentelemetry-instrumentation-aiopg # opentelemetry-instrumentation-asyncpg # opentelemetry-instrumentation-dbapi + # opentelemetry-instrumentation-logging # opentelemetry-instrumentation-redis # opentelemetry-instrumentation-requests opentelemetry-instrumentation-aiopg==0.48b0 @@ -269,6 +271,10 @@ opentelemetry-instrumentation-asyncpg==0.48b0 # via -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in opentelemetry-instrumentation-dbapi==0.48b0 # via opentelemetry-instrumentation-aiopg +opentelemetry-instrumentation-logging==0.48b0 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in opentelemetry-instrumentation-redis==0.48b0 # via # -r requirements/../../../packages/service-library/requirements/_base.in