Skip to content

Commit c040142

Browse files
committed
add settings for OpenTelemetry
1 parent 70f06f2 commit c040142

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.env.template

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Azure Application Insights
2+
APPLICATIONINSIGHTS_CONNECTION_STRING="InstrumentationKey=xxx;IngestionEndpoint=https://xxx.applicationinsights.azure.com/;LiveEndpoint=https://xxx.livediagnostics.monitor.azure.com/"
3+
OTEL_RESOURCE_ATTRIBUTES="service.namespace=template-fastapi-namespace,service.instance.id=template-fastapi-instance"
4+
OTEL_SERVICE_NAME="template-fastapi-service"
5+
OTEL_TRACES_SAMPLER_ARG="1"
6+
17
# Azure OpenAI Service
28
AZURE_OPENAI_ENDPOINT="https://<YOUR_AOAI_NAME>.openai.azure.com/"
39
AZURE_OPENAI_API_KEY="<YOUR_API_KEY>"

template_fastapi/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def server_request_hook(span: Span, scope: dict):
3838

3939
configure_azure_monitor(
4040
connection_string=AZURE_CONNECTION_STRING,
41-
# enable_live_metrics=True,
41+
enable_live_metrics=True,
4242
server_request_hook=server_request_hook,
4343
)
4444
FastAPIInstrumentor.instrument_app(app)

0 commit comments

Comments
 (0)