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/functions-app-settings.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -506,6 +506,10 @@ This setting enables the Python worker to use shared memory to improve throughpu
506
506
507
507
With this setting enabled, you can use the [DOCKER_SHM_SIZE](#docker_shm_size) setting to set the shared memory size. To learn more, see [Shared memory](functions-reference-python.md#shared-memory).
508
508
509
+
## JAVA_APPLICATIONINSIGHTS_ENABLE_TELEMETRY
510
+
511
+
Indicates whether the Java worker process should output telemetry in an Open Telemetry format to the Application Insights endpoint. Setting this flag to `True` tells the Functions host to let the Java worker process stream OpenTelemetry logs directly, which prevents duplicate host-level entries. For more information, see [Configure application settings](opentelemetry-howto.md?pivots=programming-language-java#configure-application-settings).
512
+
509
513
## JAVA_ENABLE_SDK_TYPES
510
514
511
515
Enables your function app to use native Azure SDK types in bindings.
@@ -565,6 +569,14 @@ To avoid excessive module upgrades on frequent Worker restarts, checking for mod
565
569
566
570
To learn more, see [Dependency management](functions-reference-powershell.md#dependency-management).
567
571
572
+
## OTEL_EXPORTER_OTLP_ENDPOINT
573
+
574
+
Indicates the URL to which OpenTelemetry-formatted data is exported for ingestion. For more information, see [Use OpenTelemetry with Azure Functions](opentelemetry-howto.md).
575
+
576
+
## OTEL_EXPORTER_OTLP_HEADERS
577
+
578
+
Sets an optional list of headers that are appled to all outgoing data exported to an OpenTelemetry endpoint. You should use this setting when the OpenTelemetry endpoint requires to supply an API key. For more information, see [Use OpenTelemetry with Azure Functions](opentelemetry-howto.md).
579
+
568
580
## PIP\_INDEX\_URL
569
581
570
582
This setting lets you override the base URL of the Python Package Index, which by default is `https://pypi.org/simple`. Use this setting when you need to run a remote build using custom dependencies. These custom dependencies can be in a package index repository compliant with PEP 503 (the simple repository API) or in a local directory that follows the same format.
@@ -593,6 +605,10 @@ A [continuous deployment](./functions-continuous-deployment.md) setting that tel
593
605
|---|------------|
594
606
|PROJECT |`WebProject/WebProject.csproj`|
595
607
608
+
## PYTHON_APPLICATIONINSIGHTS_ENABLE_TELEMETRY
609
+
610
+
Indicates whether the Python worker process should output telemetry in an Open Telemetry format to the Application Insights endpoint. Setting this flag to `True` tells the Functions host to let the Python worker process stream OpenTelemetry logs directly, which prevents duplicate host-level entries. For more information, see [Configure application settings](opentelemetry-howto.md?pivots=programming-language-python#configure-application-settings).
611
+
596
612
## PYTHON\_ISOLATE\_WORKER\_DEPENDENCIES
597
613
598
614
The configuration is specific to Python function apps. It defines the prioritization of module loading order. By default, this value is set to `0`.
Copy file name to clipboardExpand all lines: articles/azure-functions/opentelemetry-howto.md
+18-30Lines changed: 18 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,34 +52,38 @@ Create specific application settings in your function app based on the OpenTelem
52
52
53
53
### [Application Insights](#tab/app-insights)
54
54
55
-
**`APPLICATIONINSIGHTS_CONNECTION_STRING`**: the connection string for an Application Insights workspace. When this setting exists, OpenTelemetry data is sent to that workspace. This setting is the same one used to connect to Application Insights without OpenTelemetry enabled. If your app doesn't already have this setting, you might need to [Enable Application Insights integration](configure-monitoring.md#enable-application-insights-integration).
55
+
**[APPLICATIONINSIGHTS_CONNECTION_STRING](./functions-app-settings.md#applicationinsights_connection_string)**: the connection string for an Application Insights workspace. When this setting exists, OpenTelemetry data is sent to that workspace. This setting is the same one used to connect to Application Insights without OpenTelemetry enabled. If your app doesn't already have this setting, you might need to [Enable Application Insights integration](configure-monitoring.md#enable-application-insights-integration).
56
+
57
+
::: zone pivot="programming-language-java"
58
+
**[JAVA_APPLICATIONINSIGHTS_ENABLE_TELEMETRY](./functions-app-settings.md#java_applicationinsights_enable_telemetry)**: set to `true` so that the Functions host allows the Java worker process to stream OpenTelemetry logs directly, which prevents duplicate host-level entries.
59
+
::: zone-end
60
+
::: zone pivot="programming-language-python"
61
+
**[PYTHON_APPLICATIONINSIGHTS_ENABLE_TELEMETRY](./functions-app-settings.md#python_applicationinsights_enable_telemetry)**: set to `true` so that the Functions host allows the Python worker process to stream OpenTelemetry logs directly, which prevents duplicate host-level entries.
62
+
::: zone-end
56
63
57
64
### [OTLP Exporter](#tab/otlp-export)
58
65
59
-
**`OTEL_EXPORTER_OTLP_ENDPOINT`**: an OTLP exporter endpoint URL.
66
+
**[OTEL_EXPORTER_OTLP_ENDPOINT](functions-app-settings.md#otel_exporter_otlp_endpoint)**: an OTLP exporter endpoint URL.
67
+
68
+
**[OTEL_EXPORTER_OTLP_HEADERS](functions-app-settings.md#otel_exporter_otlp_headers)**: (Optional) list of headers to apply to all outgoing data. This setting is used by many endpoints to pass an API key.
60
69
61
-
**`OTEL_EXPORTER_OTLP_HEADERS`**: (Optional) list of headers to apply to all outgoing data. This setting is used by many endpoints to pass an API key.
70
+
::: zone pivot="programming-language-python"
71
+
**[PYTHON_ENABLE_OPENTELEMETRY](./functions-app-settings.md#python_applicationinsights_enable_telemetry)**: set to `true` so that the Functions host allows the Java worker process to stream OpenTelemetry logs directly, which prevents duplicate host-level entries.
72
+
::: zone-end
62
73
63
74
If your endpoint requires you to set other environment variables, you need to also add them to your application settings. For more information, see the [OTLP Exporter Configuration documentation](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/).
64
75
65
76
You should remove the `APPLICATIONINSIGHTS_CONNECTION_STRING` setting, unless you also want OpenTelemetry output from the host sent to Application Insights.
66
77
67
78
---
68
79
69
-
::: zone pivot="programming-language-java"
70
-
You must also add `JAVA_APPLICATIONINSIGHTS_ENABLE_TELEMETRY=true` to your application settings. Setting this flag tells the Functions host to let the Java worker process stream OpenTelemetry logs directly, which prevents duplicate host-level entries.
71
-
72
-
> [!NOTE]
73
-
> When both Application Insights and OTLP exporter settings are present, telemetry flows to both backends.
74
-
::: zone-end
75
-
76
80
## Enable OpenTelemetry in your app
77
81
78
82
With the Functions host configured to use OpenTelemetry, you should also update your application code to output OpenTelemetry data. Enabling OpenTelemetry in both the host and your application code enables better correlation between traces and logs emitted both by the Functions host process and from your language worker process.
79
83
80
84
The way that you instrument your application to use OpenTelemetry depends on your target OpenTelemetry endpoint:
81
85
::: zone pivot="programming-language-csharp"
82
-
Examples in this article assume your app is using `IHostApplicationBuilder`, which is avaible in version 2.x and later version of [Microsoft.Azure.Functions.Worker](/dotnet/api/microsoft.extensions.hosting.ihostapplicationbuilder). For more information, see [Version 2.x](dotnet-isolated-process-guide.md#version-2x) in the C# isolated worker model guide.
86
+
Examples in this article assume your app is using `IHostApplicationBuilder`, which is available in version 2.x and later version of [Microsoft.Azure.Functions.Worker](/dotnet/api/microsoft.extensions.hosting.ihostapplicationbuilder). For more information, see [Version 2.x](dotnet-isolated-process-guide.md#version-2x) in the C# isolated worker model guide.
83
87
84
88
1. Run these commands to install the required assemblies in your app:
85
89
@@ -353,20 +357,6 @@ These instructions only apply for an OTLP exporter:
353
357
354
358
::: zone-end
355
359
::: zone pivot="programming-language-python"
356
-
1. Add the following application settings with value of True.
357
-
358
-
### [Application Insights](#tab/app-insights)
359
-
360
-
```text
361
-
PYTHON_APPLICATIONINSIGHTS_ENABLE_TELEMETRY
362
-
```
363
-
### [OTLP Exporter](#tab/otlp-export)
364
-
365
-
```text
366
-
PYTHON_ENABLE_OPENTELEMETRY
367
-
```
368
-
---
369
-
370
360
1. Make sure these libraries are in your `requirements.txt` file, whether from uncommenting or adding yourself:
371
361
372
362
### [Application Insights](#tab/app-insights)
@@ -388,17 +378,15 @@ These instructions only apply for an OTLP exporter:
388
378
389
379
### [Application Insights](#tab/app-insights)
390
380
391
-
If you followed the above steps by setting the `PYTHON_APPLICATIONINSIGHTS_ENABLE_TELEMETRY`, you don't need to add any other code and skip the below.
392
-
393
-
If you would like to enable Application Insights collection manually without automatic instrumentation, add the following code:
381
+
If you already added `PYTHON_APPLICATIONINSIGHTS_ENABLE_TELEMETRY=true` in your application settings, you can skip this step. To manually enable Application Insights collection without automatic instrumentation, add this code to your app:
394
382
395
383
```python
396
384
from azure.monitor.opentelemetry import configure_azure_monitor
397
385
configure_azure_monitor()
398
386
```
399
387
### [OTLP Exporter](#tab/otlp-export)
400
388
401
-
Traces, metrics, and logs being exported using OpenTelemetry must be configured manually. For more information, see [Instrumentation](https://opentelemetry.io/docs/languages/python/instrumentation/) for Python.
389
+
Exporting traces, metrics, and logs using OpenTelemetry must be configured manually. For more information, see [Instrumentation](https://opentelemetry.io/docs/languages/python/instrumentation/) for Python.
402
390
403
391
This is a simple implementation for exporting logs:
404
392
@@ -429,7 +417,7 @@ These instructions only apply for an OTLP exporter:
429
417
430
418
---
431
419
432
-
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.
420
+
1. Review [Azure monitor Distro usage](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-opentelemetry#usage) documentation for options on how to further configure the SDK.
0 commit comments