Skip to content

Commit ed03fce

Browse files
committed
Edits to Leighton's additions
1 parent ef42e0c commit ed03fce

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed

articles/azure-functions/functions-app-settings.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ This setting enables the Python worker to use shared memory to improve throughpu
506506

507507
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).
508508

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+
509513
## JAVA_ENABLE_SDK_TYPES
510514

511515
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
565569

566570
To learn more, see [Dependency management](functions-reference-powershell.md#dependency-management).
567571

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+
568580
## PIP\_INDEX\_URL
569581

570582
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
593605
|---|------------|
594606
|PROJECT |`WebProject/WebProject.csproj` |
595607

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+
596612
## PYTHON\_ISOLATE\_WORKER\_DEPENDENCIES
597613

598614
The configuration is specific to Python function apps. It defines the prioritization of module loading order. By default, this value is set to `0`.

articles/azure-functions/opentelemetry-howto.md

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,38 @@ Create specific application settings in your function app based on the OpenTelem
5252

5353
### [Application Insights](#tab/app-insights)
5454

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
5663

5764
### [OTLP Exporter](#tab/otlp-export)
5865

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.
6069

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
6273

6374
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/).
6475

6576
You should remove the `APPLICATIONINSIGHTS_CONNECTION_STRING` setting, unless you also want OpenTelemetry output from the host sent to Application Insights.
6677

6778
---
6879

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-
7680
## Enable OpenTelemetry in your app
7781

7882
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.
7983

8084
The way that you instrument your application to use OpenTelemetry depends on your target OpenTelemetry endpoint:
8185
::: 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.
8387

8488
1. Run these commands to install the required assemblies in your app:
8589

@@ -353,20 +357,6 @@ These instructions only apply for an OTLP exporter:
353357
354358
::: zone-end
355359
::: 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-
370360
1. Make sure these libraries are in your `requirements.txt` file, whether from uncommenting or adding yourself:
371361
372362
### [Application Insights](#tab/app-insights)
@@ -388,17 +378,15 @@ These instructions only apply for an OTLP exporter:
388378
389379
### [Application Insights](#tab/app-insights)
390380
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:
394382
395383
```python
396384
from azure.monitor.opentelemetry import configure_azure_monitor
397385
configure_azure_monitor()
398386
```
399387
### [OTLP Exporter](#tab/otlp-export)
400388
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.
402390
403391
This is a simple implementation for exporting logs:
404392
@@ -429,7 +417,7 @@ These instructions only apply for an OTLP exporter:
429417
430418
---
431419
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.
433421
434422
::: zone-end
435423
## Considerations for OpenTelemetry

0 commit comments

Comments
 (0)