From 56fd52b0a9537285377c1dafe2bd786e906b47c9 Mon Sep 17 00:00:00 2001 From: Duncan Harvey Date: Mon, 21 Jul 2025 16:42:49 -0400 Subject: [PATCH 01/12] add instructions to install serverless monitoring for .net azure functions --- .../en/serverless/azure_functions/_index.md | 185 +++++++++++------- 1 file changed, 111 insertions(+), 74 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 9a84bd3fa529d..7c2f3805423a9 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -3,11 +3,11 @@ title: Install Serverless Monitoring for Azure Functions --- ## Overview -This page explains how to collect traces, trace metrics, runtime metrics, and custom metrics from your Azure Functions. To collect additional metrics, install the [Datadog Azure integration][6]. +This page explains how to collect traces, trace metrics, runtime metrics, and custom metrics from your Azure Functions. To collect additional metrics, install the [Datadog Azure integration][5]. ## Setup -{{< programming-lang-wrapper langs="nodejs,python,java" >}} +{{< programming-lang-wrapper langs="nodejs,python,java,dotnet" >}} {{< programming-lang lang="nodejs" >}} 1. **Install dependencies**. Run the following commands: ```shell @@ -15,11 +15,9 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu npm install dd-trace ``` - To use [automatic instrumentation][1], you must use `dd-trace` v5.25+. - Datadog recommends pinning the package versions and regularly upgrading to the latest versions of both `@datadog/serverless-compat` and `dd-trace` to ensure you have access to enhancements and bug fixes. -2. **Start the Datadog serverless compatibility layer and initialize the Node.js tracer**. Add the following lines to your main application entry point file (for example, `app.js`): +2. **Start the Datadog Serverless Compatibility Layer and initialize the Datadog Node.js tracer**. Add the following lines to your main application entry point file (for example, `app.js`): ```js require('@datadog/serverless-compat').start(); @@ -28,13 +26,12 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu const tracer = require('dd-trace').init() ``` -3. (Optional) **Enable runtime metrics**. See [Node.js Runtime Metrics][2]. +3. (Optional) **Enable runtime metrics**. See [Node.js Runtime Metrics][1]. -4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][3]. +4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][2]. -[1]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation -[2]: /tracing/metrics/runtime_metrics/nodejs/?tab=environmentvariables -[3]: /metrics/custom_metrics/dogstatsd_metrics_submission/?code-lang=nodejs +[1]: /tracing/metrics/runtime_metrics/?tab=nodejs#environment-variables +[2]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=nodejs {{< /programming-lang >}} {{< programming-lang lang="python" >}} 1. **Install dependencies**. Run the following commands: @@ -43,11 +40,9 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu pip install ddtrace ``` - To use [automatic instrumentation][1], you must use `dd-trace` v2.19+. - Datadog recommends using the latest versions of both `datadog-serverless-compat` and `ddtrace` to ensure you have access to enhancements and bug fixes. -2. **Initialize the Datadog Python tracer and serverless compatibility layer**. Add the following lines to your main application entry point file: +2. **Start the Datadog Serverless Compatibility Layer and initialize the Datadog Python tracer**. Add the following lines to your main application entry point file: ```python from datadog_serverless_compat import start @@ -56,13 +51,12 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu start() ``` -3. (Optional) **Enable runtime metrics**. See [Python Runtime Metrics][2]. +3. (Optional) **Enable runtime metrics**. See [Python Runtime Metrics][1]. -4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][3]. +4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][2]. -[1]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation -[2]: /tracing/metrics/runtime_metrics/python/ -[3]: /metrics/custom_metrics/dogstatsd_metrics_submission/?code-lang=python +[1]: /tracing/metrics/runtime_metrics/?tab=python#code-based-configuration +[2]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=python {{< /programming-lang >}} {{< programming-lang lang="java" >}} 1. **Install dependencies**. Download the Datadog JARs and deploy them with your function: @@ -70,29 +64,104 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer' wget -O dd-serverless-compat-java-agent.jar 'https://dtdg.co/latest-serverless-compat-java-agent' ``` - See Datadog's [Maven Repository][4] for any specific version of the Datadog Serverless Compatibility Layer. - - To use [automatic instrumentation][1], you must use `dd-java-agent` v1.48.0+. + See Datadog's [Maven Repository][3] for any specific version of the Datadog Serverless Compatibility Layer. Datadog recommends regularly upgrading to the latest versions of both `dd-serverless-compat-java-agent` and `dd-java-agent` to ensure you have access to enhancements and bug fixes. -2. **Start the Datadog serverless compatibility layer and initialize the Java tracer**. Add the following `-javaagent` arguments to the JVM options.: +2. **Start the Datadog Serverless Compatibility Layer and initialize the Datadog Java tracer**. Add the following `-javaagent` arguments to the JVM options.: ```bash -javaagent:/path/to/dd-serverless-compat-java-agent.jar -javaagent:/path/to/dd-java-agent.jar ``` - **Note**: the environment variable to set JVM options depends on the hosting plan (example, Consumption, Elastic Premium, Dedicated). See [Azure Functions Java developer guide][5] for more details on the appropriate environment variable for your hosting plan. + **Note**: the environment variable to set JVM options depends on the hosting plan (example, Consumption, Elastic Premium, Dedicated). See [Azure Functions Java developer guide][4] for more details on the appropriate environment variable for your hosting plan. + +3. (Optional) **Enable runtime metrics**. See [Java Runtime Metrics][1]. + +4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][2]. + +[1]: /tracing/metrics/runtime_metrics/?tab=java#environment-variables +[2]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=java +[3]: https://repo1.maven.org/maven2/com/datadoghq/dd-serverless-compat-java-agent/ +[4]: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#customize-jvm +{{< /programming-lang >}} +{{< programming-lang lang="dotnet" >}} +1. **Install dependencies**. Run the following commands: + ```shell + dotnet package add Datadog.Azure.Functions + ``` + + Datadog recommends regularly upgrading to the latest version of `Datadog.AzureFunctions` to ensure you have access to enhancements and bug fixes. + +2. **Start the Datadog Serverless Compatibility Layer**. Add the following lines to your main application entry point file: + If your Azure Function app uses the Isolated Worker model + ```csharp + using Datadog.Serverless; + ... + Datadog.Serverless.CompatibilityLayer.Start(); + ``` + + If your Azure Function app uses the In-Process model + ```shell + dotnet package add Microsoft.Azure.Functions.Extensions + ``` + + ```csharp + using Datadog.Serverless; + using Microsoft.Azure.Functions.Extensions.DependencyInjection; + + [assembly: FunctionsStartup(typeof(MyFunctionApp.Startup))] + + namespace MyFunctionApp + { + public class Startup : FunctionsStartup + { + public override void Configure(IFunctionsHostBuilder builder) + { + Datadog.Serverless.CompatibilityLayer.Start(); + } + } + } + ``` + +3. Configure Automatic Instrumentation + If your Azure Function app runs on Windows + ``` + CORECLR_ENABLE_PROFILING=1 + + CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8} + + CORECLR_PROFILER_PATH_64= + C:\home\site\wwwroot\datadog\win-x64\Datadog.Trace.ClrProfiler.Native.dll + + CORECLR_PROFILER_PATH_32= + C:\home\site\wwwroot\datadog\win-x86\Datadog.Trace.ClrProfiler.Native.dll + + DD_DOTNET_TRACER_HOME=C:\home\site\wwwroot\datadog + + DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS=monitor.azure, applicationinsights.azure, metadata/instance/compute, admin/host, AzureFunctionsRpcMessages.FunctionRpc + ``` + + If your Azure Function app runs on Linux + ``` + CORECLR_ENABLE_PROFILING=1 + + CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8} + + CORECLR_PROFILER_PATH= + /home/site/wwwroot/datadog/linux-x64/Datadog.Trace.ClrProfiler.Native.so -3. (Optional) **Enable runtime metrics**. See [Java Runtime Metrics][2]. + DD_DOTNET_TRACER_HOME=/home/site/wwwroot/datadog -4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][3]. + DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS=monitor.azure, applicationinsights.azure, metadata/instance/compute, admin/host, AzureFunctionsRpcMessages.FunctionRpc + ``` + +4. (Optional) **Enable runtime metrics**. See [.NET Runtime Metrics][1]. -[1]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation -[2]: /tracing/metrics/runtime_metrics/?tab=java#environment-variables -[3]: /metrics/custom_metrics/dogstatsd_metrics_submission/?code-lang=java -[4]: https://repo1.maven.org/maven2/com/datadoghq/dd-serverless-compat-java-agent/ -[5]: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#customize-jvm +5. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][2]. + +[1]: /tracing/metrics/runtime_metrics/?tab=net#environment-variables +[2]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=dotnet {{< /programming-lang >}} {{< /programming-lang-wrapper >}} @@ -105,50 +174,25 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu | `DD_API_KEY` | Your [Datadog API key][1]. | | `DD_SITE` | Your [Datadog site][2]. For example, {{< region-param key=dd_site code="true" >}}. | -7. **Configure Unified Service Tagging**. You can collect metrics from your Azure Functions by installing the [Datadog Azure integration][6]. To correlate these metrics with your traces, first set the `env`, `service`, and `version` tags on your resource in Azure. Then, configure the following environment variables. You can add custom tags as `DD_TAGS`. +7. **Configure Unified Service Tagging**. You can collect metrics from your Azure Functions by installing the [Datadog Azure integration][5]. To correlate these metrics with your traces, first set the `env`, `service`, and `version` tags on your resource in Azure. Then, configure the following environment variables. You can add custom tags as `DD_TAGS`. | Name | Value | | ---- | ----- | - | `DD_ENV` | How you want to tag your env for [Unified Service Tagging][9]. For example, `prod`. | - | `DD_SERVICE` | How you want to tag your service for [Unified Service Tagging][9]. | - | `DD_VERSION` | How you want to tag your version for [Unified Service Tagging][9]. | + | `DD_ENV` | How you want to tag your env for [Unified Service Tagging][7]. For example, `prod`. | + | `DD_SERVICE` | How you want to tag your service for [Unified Service Tagging][7]. | + | `DD_VERSION` | How you want to tag your version for [Unified Service Tagging][7]. | | `DD_TAGS` | Your comma-separated custom tags. For example, `key1:value1,key2:value2`. | ## What's next? -- You can view your Azure Functions traces in [Trace Explorer][4]. Search for the service name you set in the `DD_SERVICE` environment variable to see your traces. -- You can use the [Serverless > Azure Functions][5] page to see your traces enriched with telemetry collected by the [Datadog Azure integration][6]. - -### Enable/disable trace metrics - -[Trace metrics][3] are enabled by default. To configure trace metrics, use the following environment variable: - -{{< programming-lang-wrapper langs="nodejs,python,java" >}} -{{< programming-lang lang="nodejs" >}} -`DD_TRACE_STATS_COMPUTATION_ENABLED` -: Enables (`true`) or disables (`false`) trace metrics. Defaults to `true`. - - **Values**: `true`, `false` -{{< /programming-lang >}} -{{< programming-lang lang="python" >}} -`DD_TRACE_STATS_COMPUTATION_ENABLED` -: Enables (`true`) or disables (`false`) trace metrics. Defaults to `true`. - - **Values**: `true`, `false` -{{< /programming-lang >}} -{{< programming-lang lang="java" >}} -`DD_TRACE_TRACER_METRICS_ENABLED` -: Enables (`true`) or disables (`false`) trace metrics. Defaults to `true`. - - **Values**: `true`, `false` -{{< /programming-lang >}} -{{< /programming-lang-wrapper >}} +- You can view your Azure Functions traces in [Trace Explorer][3]. Search for the service name you set in the `DD_SERVICE` environment variable to see your traces. +- You can use the [Serverless > Azure Functions][4] page to see your traces enriched with telemetry collected by the [Datadog Azure integration][5]. ## Troubleshooting ### Enable debug logs -You can collect [debug logs][7] for troubleshooting. To configure debug logs, use the following environment variables: +You can collect [debug logs][6] for troubleshooting. To configure debug logs, use the following environment variables: `DD_TRACE_DEBUG` : Enables (`true`) or disables (`false`) debug logging for the Datadog Tracing Library. Defaults to `false`. @@ -160,17 +204,10 @@ You can collect [debug logs][7] for troubleshooting. To configure debug logs, us **Values**: `trace`, `debug`, `info`, `warn`, `error`, `critical`, `off` -### Linux Consumption plans and GitHub Actions - -To use a GitHub Action to deploy to a Linux Consumption function, you must configure your workflow to use an Azure Service Principal for RBAC. See [Using Azure Service Principal for RBAC as Deployment Credential][8]. - - [1]: /account_management/api-app-keys/#add-an-api-key-or-client-token [2]: /getting_started/site -[3]: /tracing/metrics/metrics_namespace/ -[4]: https://app.datadoghq.com/apm/traces -[5]: https://app.datadoghq.com/functions?cloud=azure&entity_view=function -[6]: /integrations/azure/ -[7]: /tracing/troubleshooting/tracer_debug_logs/#enable-debug-mode -[8]: https://github.com/Azure/functions-action?tab=readme-ov-file#using-azure-service-principal-for-rbac-as-deployment-credential -[9]: /getting_started/tagging/unified_service_tagging/ \ No newline at end of file +[3]: https://app.datadoghq.com/apm/traces +[4]: https://app.datadoghq.com/functions?cloud=azure&entity_view=function +[5]: /integrations/azure/ +[6]: /tracing/troubleshooting/tracer_debug_logs/#enable-debug-mode +[7]: /getting_started/tagging/unified_service_tagging/ From b3f35fb95903daf7ec4d56046b0bb62f0189774c Mon Sep 17 00:00:00 2001 From: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:15:06 -0400 Subject: [PATCH 02/12] Update content/en/serverless/azure_functions/_index.md Co-authored-by: Lucas Pimentel --- content/en/serverless/azure_functions/_index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 7c2f3805423a9..157293530cb72 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -96,8 +96,6 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu 2. **Start the Datadog Serverless Compatibility Layer**. Add the following lines to your main application entry point file: If your Azure Function app uses the Isolated Worker model ```csharp - using Datadog.Serverless; - ... Datadog.Serverless.CompatibilityLayer.Start(); ``` From 2b56d15e27fb3994d04749af405277c8146c6b4a Mon Sep 17 00:00:00 2001 From: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:15:26 -0400 Subject: [PATCH 03/12] Update content/en/serverless/azure_functions/_index.md Co-authored-by: Lucas Pimentel --- content/en/serverless/azure_functions/_index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 157293530cb72..a4399f066b8c7 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -93,8 +93,9 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu Datadog recommends regularly upgrading to the latest version of `Datadog.AzureFunctions` to ensure you have access to enhancements and bug fixes. -2. **Start the Datadog Serverless Compatibility Layer**. Add the following lines to your main application entry point file: - If your Azure Function app uses the Isolated Worker model +2. **Start the Datadog Serverless Compatibility Layer**. + + If your Azure Function app uses the Isolated Worker model, add the following lines to your main application entry point file: ```csharp Datadog.Serverless.CompatibilityLayer.Start(); ``` From f833a4ae566d78dc6d5b3952b149851d7818eef0 Mon Sep 17 00:00:00 2001 From: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:15:40 -0400 Subject: [PATCH 04/12] Update content/en/serverless/azure_functions/_index.md Co-authored-by: Lucas Pimentel --- content/en/serverless/azure_functions/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index a4399f066b8c7..9445b2861b8d8 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -100,7 +100,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu Datadog.Serverless.CompatibilityLayer.Start(); ``` - If your Azure Function app uses the In-Process model + If your Azure Function app uses the In-Process model, add a NuGet package reference to `Microsoft.Azure.Functions.Extensions`: ```shell dotnet package add Microsoft.Azure.Functions.Extensions ``` From 3e926bad867c87c61bc82f6e29c857e80fb1d27c Mon Sep 17 00:00:00 2001 From: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:16:00 -0400 Subject: [PATCH 05/12] Update content/en/serverless/azure_functions/_index.md Co-authored-by: Lucas Pimentel --- content/en/serverless/azure_functions/_index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 9445b2861b8d8..17f0cdb46610b 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -105,6 +105,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu dotnet package add Microsoft.Azure.Functions.Extensions ``` + And add the following `.cs` file to your application: ```csharp using Datadog.Serverless; using Microsoft.Azure.Functions.Extensions.DependencyInjection; From 566986b83c3cf1b4f54fbba2e3a4edd818d13c2b Mon Sep 17 00:00:00 2001 From: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:16:08 -0400 Subject: [PATCH 06/12] Update content/en/serverless/azure_functions/_index.md Co-authored-by: Lucas Pimentel --- content/en/serverless/azure_functions/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 17f0cdb46610b..075f735335d27 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -125,7 +125,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu ``` 3. Configure Automatic Instrumentation - If your Azure Function app runs on Windows + If your Azure Function app runs on Windows, add the following environment variables to your Function app: ``` CORECLR_ENABLE_PROFILING=1 From e48c916ddc909d412bedd59ae3caebd3203bc710 Mon Sep 17 00:00:00 2001 From: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:16:15 -0400 Subject: [PATCH 07/12] Update content/en/serverless/azure_functions/_index.md Co-authored-by: Lucas Pimentel --- content/en/serverless/azure_functions/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 075f735335d27..17f9319bdbcf8 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -142,7 +142,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS=monitor.azure, applicationinsights.azure, metadata/instance/compute, admin/host, AzureFunctionsRpcMessages.FunctionRpc ``` - If your Azure Function app runs on Linux + If your Azure Function app runs on Linux, add the following environment variables to your Function app: ``` CORECLR_ENABLE_PROFILING=1 From 6cb000a2a738525b80a7894cb7cd78730ca80b50 Mon Sep 17 00:00:00 2001 From: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:17:08 -0400 Subject: [PATCH 08/12] Update content/en/serverless/azure_functions/_index.md Co-authored-by: Lucas Pimentel --- content/en/serverless/azure_functions/_index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 17f9319bdbcf8..d64788fff76ee 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -153,7 +153,6 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu DD_DOTNET_TRACER_HOME=/home/site/wwwroot/datadog - DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS=monitor.azure, applicationinsights.azure, metadata/instance/compute, admin/host, AzureFunctionsRpcMessages.FunctionRpc ``` 4. (Optional) **Enable runtime metrics**. See [.NET Runtime Metrics][1]. From f0008e8e90c9c55e024f70866e145fa81bc65211 Mon Sep 17 00:00:00 2001 From: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:17:26 -0400 Subject: [PATCH 09/12] Update content/en/serverless/azure_functions/_index.md Co-authored-by: Lucas Pimentel --- content/en/serverless/azure_functions/_index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index d64788fff76ee..7911f19a1bfd7 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -139,7 +139,6 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu DD_DOTNET_TRACER_HOME=C:\home\site\wwwroot\datadog - DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS=monitor.azure, applicationinsights.azure, metadata/instance/compute, admin/host, AzureFunctionsRpcMessages.FunctionRpc ``` If your Azure Function app runs on Linux, add the following environment variables to your Function app: From b7b2458a3929b947600e96070baac5ef15bc81b1 Mon Sep 17 00:00:00 2001 From: Duncan Harvey Date: Tue, 22 Jul 2025 17:23:05 -0400 Subject: [PATCH 10/12] remove references to runtime metrics, custom metrics, and DD_TAGS --- .../en/serverless/azure_functions/_index.md | 35 +++---------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 7911f19a1bfd7..a775d4048c23b 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -26,12 +26,6 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu const tracer = require('dd-trace').init() ``` -3. (Optional) **Enable runtime metrics**. See [Node.js Runtime Metrics][1]. - -4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][2]. - -[1]: /tracing/metrics/runtime_metrics/?tab=nodejs#environment-variables -[2]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=nodejs {{< /programming-lang >}} {{< programming-lang lang="python" >}} 1. **Install dependencies**. Run the following commands: @@ -51,12 +45,6 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu start() ``` -3. (Optional) **Enable runtime metrics**. See [Python Runtime Metrics][1]. - -4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][2]. - -[1]: /tracing/metrics/runtime_metrics/?tab=python#code-based-configuration -[2]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=python {{< /programming-lang >}} {{< programming-lang lang="java" >}} 1. **Install dependencies**. Download the Datadog JARs and deploy them with your function: @@ -64,7 +52,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer' wget -O dd-serverless-compat-java-agent.jar 'https://dtdg.co/latest-serverless-compat-java-agent' ``` - See Datadog's [Maven Repository][3] for any specific version of the Datadog Serverless Compatibility Layer. + See Datadog's [Maven Repository][1] for any specific version of the Datadog Serverless Compatibility Layer. Datadog recommends regularly upgrading to the latest versions of both `dd-serverless-compat-java-agent` and `dd-java-agent` to ensure you have access to enhancements and bug fixes. @@ -74,16 +62,10 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu -javaagent:/path/to/dd-serverless-compat-java-agent.jar -javaagent:/path/to/dd-java-agent.jar ``` - **Note**: the environment variable to set JVM options depends on the hosting plan (example, Consumption, Elastic Premium, Dedicated). See [Azure Functions Java developer guide][4] for more details on the appropriate environment variable for your hosting plan. + **Note**: the environment variable to set JVM options depends on the hosting plan (example, Consumption, Elastic Premium, Dedicated). See [Azure Functions Java developer guide][2] for more details on the appropriate environment variable for your hosting plan. -3. (Optional) **Enable runtime metrics**. See [Java Runtime Metrics][1]. - -4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][2]. - -[1]: /tracing/metrics/runtime_metrics/?tab=java#environment-variables -[2]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=java -[3]: https://repo1.maven.org/maven2/com/datadoghq/dd-serverless-compat-java-agent/ -[4]: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#customize-jvm +[1]: https://repo1.maven.org/maven2/com/datadoghq/dd-serverless-compat-java-agent/ +[2]: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#customize-jvm {{< /programming-lang >}} {{< programming-lang lang="dotnet" >}} 1. **Install dependencies**. Run the following commands: @@ -154,12 +136,6 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu ``` -4. (Optional) **Enable runtime metrics**. See [.NET Runtime Metrics][1]. - -5. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][2]. - -[1]: /tracing/metrics/runtime_metrics/?tab=net#environment-variables -[2]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=dotnet {{< /programming-lang >}} {{< /programming-lang-wrapper >}} @@ -172,14 +148,13 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu | `DD_API_KEY` | Your [Datadog API key][1]. | | `DD_SITE` | Your [Datadog site][2]. For example, {{< region-param key=dd_site code="true" >}}. | -7. **Configure Unified Service Tagging**. You can collect metrics from your Azure Functions by installing the [Datadog Azure integration][5]. To correlate these metrics with your traces, first set the `env`, `service`, and `version` tags on your resource in Azure. Then, configure the following environment variables. You can add custom tags as `DD_TAGS`. +7. **Configure Unified Service Tagging**. You can collect metrics from your Azure Functions by installing the [Datadog Azure integration][5]. To correlate these metrics with your traces, first set the `env`, `service`, and `version` tags on your resource in Azure. Then, configure the following environment variables. | Name | Value | | ---- | ----- | | `DD_ENV` | How you want to tag your env for [Unified Service Tagging][7]. For example, `prod`. | | `DD_SERVICE` | How you want to tag your service for [Unified Service Tagging][7]. | | `DD_VERSION` | How you want to tag your version for [Unified Service Tagging][7]. | - | `DD_TAGS` | Your comma-separated custom tags. For example, `key1:value1,key2:value2`. | ## What's next? From 4f39f5ca2fd5128194f7916c3eb184c2824e6e0a Mon Sep 17 00:00:00 2001 From: Duncan Harvey Date: Tue, 22 Jul 2025 17:39:45 -0400 Subject: [PATCH 11/12] add links to tracer configuration --- .../en/serverless/azure_functions/_index.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index a775d4048c23b..def0c479410c5 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -26,6 +26,11 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu const tracer = require('dd-trace').init() ``` +3. **Configure the Datadog Node.js tracer** + + [Configuring the Node.js Tracing Library][1] + +[1]:/tracing/trace_collection/library_config/nodejs {{< /programming-lang >}} {{< programming-lang lang="python" >}} 1. **Install dependencies**. Run the following commands: @@ -45,6 +50,11 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu start() ``` +3. **Configure the Datadog Python tracer** + + [Configuring the Python Tracing Library][1] + +[1]:/tracing/trace_collection/library_config/python {{< /programming-lang >}} {{< programming-lang lang="java" >}} 1. **Install dependencies**. Download the Datadog JARs and deploy them with your function: @@ -64,8 +74,13 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu **Note**: the environment variable to set JVM options depends on the hosting plan (example, Consumption, Elastic Premium, Dedicated). See [Azure Functions Java developer guide][2] for more details on the appropriate environment variable for your hosting plan. +3. **Configure the Datadog Java tracer** + + [Configuring the Java Tracing Library][3] + [1]: https://repo1.maven.org/maven2/com/datadoghq/dd-serverless-compat-java-agent/ [2]: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#customize-jvm +[3]: /tracing/trace_collection/library_config/java {{< /programming-lang >}} {{< programming-lang lang="dotnet" >}} 1. **Install dependencies**. Run the following commands: @@ -136,6 +151,13 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu ``` +4. **Configure the Datadog .NET tracer** + + - [Configuring the .NET Core Tracing Library][1] + - [Configuring the .NET Framework Tracing Library][2] + +[1]:/tracing/trace_collection/library_config/dotnet-core +[2]:/tracing/trace_collection/library_config/dotnet-framework {{< /programming-lang >}} {{< /programming-lang-wrapper >}} From 36ced4d2b57f85529a060a3f3258c51732e83872 Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Tue, 29 Jul 2025 09:29:21 -0700 Subject: [PATCH 12/12] just fixing formatting on step 3 --- content/en/serverless/azure_functions/_index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index def0c479410c5..60f1d94c62194 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -121,7 +121,8 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu } ``` -3. Configure Automatic Instrumentation +3. **Configure Automatic Instrumentation** + If your Azure Function app runs on Windows, add the following environment variables to your Function app: ``` CORECLR_ENABLE_PROFILING=1