Skip to content

Commit

Permalink
fix isort
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonavic committed Sep 23, 2024
1 parent a718dd1 commit 793d957
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/main/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
from django.core.asgi import get_asgi_application
from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware


os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'main.settings')

django_application = get_asgi_application()
django_application = OpenTelemetryMiddleware(django_application)


async def application(scope, receive, send):
"""
Guvicorn doesn't work well with OpenTelemetry without implementing the ASGI middleware to catch requests
Expand Down
8 changes: 4 additions & 4 deletions app/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""
import os
# Export modules to Azure Application Insights
from azure.monitor.opentelemetry.exporter import AzureMonitorLogExporter, AzureMonitorTraceExporter

import os
from typing import Any

# Export modules to Azure Application Insights
from azure.monitor.opentelemetry.exporter import AzureMonitorLogExporter, AzureMonitorTraceExporter
# Opentelemetry modules needed for logging and tracing
from opentelemetry import trace
from opentelemetry.instrumentation.psycopg2 import Psycopg2Instrumentor
from opentelemetry.instrumentation.django import DjangoInstrumentor
from opentelemetry.instrumentation.psycopg2 import Psycopg2Instrumentor
from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from opentelemetry.sdk.resources import Resource
Expand Down

0 comments on commit 793d957

Please sign in to comment.