File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class Settings(BaseSettings):
14
14
LOGGING_SCHEDULE_DELAY : int = 5000
15
15
DEBUG : bool = False
16
16
APPLICATIONINSIGHTS_CONNECTION_STRING : str = Field (
17
- default = "" , env = "APPLICATIONINSIGHTS_CONNECTION_STRING"
17
+ default = "" , alias = "APPLICATIONINSIGHTS_CONNECTION_STRING"
18
18
)
19
19
WEBSITE_NAME : str = Field (default = "test" , alias = "WEBSITE_SITE_NAME" )
20
20
WEBSITE_INSTANCE_ID : str = Field (default = "0" , alias = "WEBSITE_INSTANCE_ID" )
Original file line number Diff line number Diff line change 1
1
import logging
2
2
from logging import Logger
3
3
4
- from azure .monitor .opentelemetry import configure_azure_monitor
5
-
6
4
# from azure.identity import ManagedIdentityCredential
7
5
from azure .monitor .opentelemetry .exporter import (
8
6
ApplicationInsightsSampler ,
25
23
from opentelemetry .sdk .resources import SERVICE_NAME , Resource
26
24
from opentelemetry .sdk .trace import TracerProvider
27
25
from opentelemetry .sdk .trace .export import BatchSpanProcessor
28
- from opentelemetry .trace import Tracer , get_tracer_provider , set_tracer_provider
26
+ from opentelemetry .trace import Tracer , set_tracer_provider
29
27
30
28
31
29
def setup_logging (module ) -> Logger :
@@ -130,7 +128,7 @@ def setup_opentelemetry(app: FastAPI):
130
128
# Create instrumenter
131
129
FastAPIInstrumentor .instrument_app (
132
130
app ,
133
- excluded_urls = f"{ settings .API_V1_STR } /health/heartbeat" ,
131
+ excluded_urls = f".*.in.applicationinsights.azure.com/.*, { settings .API_V1_STR } /health/heartbeat" ,
134
132
tracer_provider = tracer_provider ,
135
133
meter_provider = meter_provider ,
136
134
)
Original file line number Diff line number Diff line change 4
4
5
5
# azure-identity~=1.15.0
6
6
azure-functions ~= 1.17.0
7
- fastapi ~= 0.106 .0
7
+ fastapi ~= 0.108 .0
8
8
pydantic-settings ~= 2.1.0
9
9
httpx ~= 0.26.0
10
- azure-monitor-opentelemetry ~= 1.1.1
10
+ azure-monitor-opentelemetry-exporter == 1.0.0b20
11
+ opentelemetry-instrumentation-fastapi == 0.43b0
11
12
opentelemetry-instrumentation-httpx ~= 0.43b0
12
13
opentelemetry-instrumentation-system-metrics ~= 0.43b0
You can’t perform that action at this time.
0 commit comments