diff --git a/Automat/automat/server.py b/Automat/automat/server.py index 331d3ee..de82b5f 100644 --- a/Automat/automat/server.py +++ b/Automat/automat/server.py @@ -34,9 +34,7 @@ async def __call__(self, scope, receive, send): from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware from opentelemetry.util.http import ExcludeList - - # from opentelemetry.instrumentation.aiohttp_client import AioHttpClientInstrumentor - # would need requirement like opentelemetry-instrumentation-aiohttp-client==0.48b0 + from opentelemetry.instrumentation.aiohttp_client import AioHttpClientInstrumentor resource = Resource(attributes={ SERVICE_NAME: config.get("OTEL_SERVICE_NAME", "Automat"), @@ -59,8 +57,8 @@ async def __call__(self, scope, receive, send): # NOTE - This is here because OpenTelemetryMiddleware excluded_urls actually expects ExcludeList and not the typical # comma separated regex list. In the future if we upgrade OpenTelemetryMiddleware we might have to change this. - exclude_list = ExcludeList(['heartbeat', 'meta', 'openapi']) + exclude_list = ExcludeList(['heartbeat', 'meta', 'openapi', '^$', 'docs']) # Enable OpenTelemetry instrumentation app = OpenTelemetryMiddleware(app, excluded_urls=exclude_list) - # AioHttpClientInstrumentor().instrument() + AioHttpClientInstrumentor().instrument() diff --git a/Automat/requirements.txt b/Automat/requirements.txt index b45b920..2e803bc 100644 --- a/Automat/requirements.txt +++ b/Automat/requirements.txt @@ -9,4 +9,5 @@ uvicorn[standard]==0.31.0 markupsafe==2.0.1 opentelemetry-sdk==1.27.0 opentelemetry-exporter-otlp-proto-grpc==1.27.0 -opentelemetry-instrumentation-asgi==0.48b0 \ No newline at end of file +opentelemetry-instrumentation-asgi==0.48b0 +opentelemetry-instrumentation-aiohttp-client==0.48b0 \ No newline at end of file