Skip to content

Commit c6c00fb

Browse files
committed
Test update
1 parent b9c43ac commit c6c00fb

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

code/function/fastapp/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def setup_opentelemetry(app: FastAPI):
103103
reader = PeriodicExportingMetricReader(
104104
metrics_exporter, export_interval_millis=5000
105105
)
106-
meter_provider = MeterProvider(metric_readers=[reader])
106+
meter_provider = MeterProvider(metric_readers=[reader], resource=resource)
107107
set_meter_provider(meter_provider)
108108

109109
# Configure custom metrics
@@ -116,11 +116,11 @@ def setup_opentelemetry(app: FastAPI):
116116
}
117117

118118
# Create instrumenter
119-
FastAPIInstrumentor.instrument_app(
120-
app,
121-
excluded_urls=f"{settings.API_V1_STR}/health/heartbeat",
122-
tracer_provider=tracer_provider,
123-
meter_provider=meter_provider,
124-
)
119+
# FastAPIInstrumentor.instrument_app(
120+
# app,
121+
# excluded_urls=f"{settings.API_V1_STR}/health/heartbeat",
122+
# tracer_provider=tracer_provider,
123+
# meter_provider=meter_provider,
124+
# )
125125
HTTPXClientInstrumentor().instrument()
126126
SystemMetricsInstrumentor(config=system_metrics_config).instrument()

code/function/wrapper/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ async def main(req: func.HttpRequest, context: func.Context) -> func.HttpRespons
1919

2020
# Function logic
2121
with tracer.start_as_current_span("wrapper", context=parent_context) as span:
22-
response = await func.AsgiMiddleware(app).handle_async(req, parent_context)
22+
response = await func.AsgiMiddleware(app).handle_async(
23+
req=req, # context=parent_context
24+
)
2325

2426
# token = attach(parent_context)
2527
# try:

0 commit comments

Comments
 (0)