You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/opentelemetry-howto.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,14 +215,26 @@ These instructions only apply for an OTLP exporter:
215
215
216
216
::: zone-end
217
217
::: zone pivot="programming-language-python"
218
-
1. Add an application setting named PYTHON_ENABLE_OPENTELEMETRY with value of True.
218
+
1. Add the following application settings with value of True.
219
219
220
-
1. Add this entry in your `requirements.txt` file:
220
+
### [Application Insights](#tab/app-insights)
221
+
222
+
```text
223
+
PYTHON_APPLICATIONINSIGHTS_ENABLE_TELEMETRY
224
+
```
225
+
### [OTLP Exporter](#tab/otlp-export)
226
+
227
+
```text
228
+
PYTHON_ENABLE_OPENTELEMETRY
229
+
```
230
+
---
231
+
232
+
1. Make sure the below library is in your `requirements.txt` file, whether from uncommenting or adding yourself:
221
233
222
234
### [Application Insights](#tab/app-insights)
223
235
224
236
```text
225
-
azure.monitor.opentelemetry
237
+
azure-monitor-opentelemetry
226
238
```
227
239
### [OTLP Exporter](#tab/otlp-export)
228
240
@@ -238,6 +250,10 @@ These instructions only apply for an OTLP exporter:
238
250
239
251
### [Application Insights](#tab/app-insights)
240
252
253
+
If you followed the above steps by setting the `PYTHON_APPLICATIONINSIGHTS_ENABLE_TELEMETRY`, you don't need to add any additional code and skip the below.
254
+
255
+
If you would like to enable Application Insights collection manually without automatic instrumentation, add the following code:
256
+
241
257
```python
242
258
from azure.monitor.opentelemetry import configure_azure_monitor
243
259
configure_azure_monitor()
@@ -275,6 +291,8 @@ These instructions only apply for an OTLP exporter:
275
291
276
292
---
277
293
294
+
1. Refer to [Azure monitor Distro usage]https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-opentelemetry#usage) documentation for how to configure the SDK.
0 commit comments