diff --git a/docker-compose.yml b/docker-compose.yml index e04b3e7..0e74c49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -141,13 +141,7 @@ services: - ./scripts:/app/scripts environment: <<: *app-env - SERVICE_NAME: sanctions - OTEL_SERVICE_NAME: sanctions OTEL_EXPORTER_OTLP_ENDPOINT: https://otlp.vione.cloud - OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf - OTEL_TRACES_EXPORTER: otlp - OTEL_METRICS_EXPORTER: none - OTEL_LOGS_EXPORTER: none env_file: - .env.observability command: uvicorn services.sanctions.app:app --host 0.0.0.0 --port 8003 --reload --no-access-log diff --git a/services/sanctions/app.py b/services/sanctions/app.py index 147a05c..4407a4b 100644 --- a/services/sanctions/app.py +++ b/services/sanctions/app.py @@ -3,6 +3,7 @@ import asyncio from fastapi import FastAPI, Request from fastapi.responses import JSONResponse from pydantic import BaseModel +from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor from common.db import engine from common.logging_config import configure_logging @@ -16,6 +17,11 @@ logger = configure_logging(SERVICE_NAME) setup_telemetry(service_name=SERVICE_NAME) app = FastAPI(title=SERVICE_NAME) +FastAPIInstrumentor.instrument_app( + app, + excluded_urls="/healthz", + exclude_spans=["receive", "send"], +) class LookupRequest(BaseModel): holder_name: str