From 9e96892a60b4040a439b8c38e7a5f415062f99c1 Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Fri, 24 Jan 2025 11:32:23 -0800 Subject: [PATCH 1/9] initiali commit --- .../en/serverless/azure_functions/_index.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 content/en/serverless/azure_functions/_index.md diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md new file mode 100644 index 0000000000000..d0ed1c8d8c2d9 --- /dev/null +++ b/content/en/serverless/azure_functions/_index.md @@ -0,0 +1,94 @@ +--- +title: Serverless Monitoring for Azure Functions +--- + +## Overview +Azure Functions... + +## Setup + +{{< programming-lang-wrapper langs="nodejs,python" >}} +{{< programming-lang lang="nodejs" >}} +1. **Install dependencies**. Run the following commands: + ```shell + npm install @datadog/serverless-compat + npm install dd-trace + ``` + + If your Azure Functions use a version of Node.js earlier than v18, ensure that you use a [compatible version of `dd-trace`][1]. + + To use [automatic instrumentation][2], you must use `dd-trace` v4.48+ (v4 release line) or v5.25+ (v5 release line). + + 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`): + + ```js + require('@datadog/serverless-compat').start(); + + // This line must come before importing any instrumented module. + const tracer = require('dd-trace').init() + ``` + + [1]: https://github.com/DataDog/dd-trace-js?tab=readme-ov-file#version-release-lines-and-maintenance + [2]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation +{{< /programming-lang >}} +{{< programming-lang lang="python" >}} +1. **Install dependencies**. Run the following commands: + ```shell + pip install datadog-serverless-compat + pip install ddtrace + ``` + + You must use `ddtrace` 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: + + ```python + from datadog_serverless_compat import start + from ddtrace import tracer, patch_all + + start() + patch_all() + ``` + +{{< /programming-lang >}} +{{< /programming-lang-wrapper >}} + +3. **Deploy your function**. + +4. **Configure Datadog intake**. Add the following environment variables to your function's application settings: + ``` + DD_API_KEY= + DD_SITE={{< region-param key=dd_site code="true" >}} + ``` + - Set `DD_API_KEY` to your [Datadog API key][1]. + - Set `DD_SITE` to {{< region-param key=dd_site code="true" >}}. (Ensure that your correct [Datadog site][2] is selected in the drop-down on the right side of this page.) + +5. **Configure tags**. To filter and aggregate your telemetry in Datadog, configure the following tags as environment variables. You can add custom tags as `DD_TAGS`. + + ``` + DD_ENV="" + DD_SERVICE="" + DD_VERSION="" + DD_TAGS="," + ``` +## View traces in Datadog + +## Enable debug logs + +## Enable other features + +### Trace metrics + +[Trace metrics][3] are enabled by default. To disable them, set the following environment variable in your function's application settings: + +``` +DD_TRACE_STATS_COMPUTATION_ENABLED=false +``` + +[1]: /account_management/api-app-keys/#add-an-api-key-or-client-token +[2]: /getting_started/site +[3]: /tracing/metrics/metrics_namespace/ From 5bd850da947c3977170b7d4ec05c5d3d57da8fdc Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Fri, 24 Jan 2025 12:22:34 -0800 Subject: [PATCH 2/9] adding content --- .../en/serverless/azure_functions/_index.md | 45 ++++++++++++++++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index d0ed1c8d8c2d9..d3719eb4cad75 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -1,9 +1,13 @@ --- -title: Serverless Monitoring for Azure Functions +title: Tracing Azure Functions --- ## Overview -Azure Functions... +Azure Functions + + + +This page explains how to collect traces from your Azure Functions. To collect metrics, install the [Datadog Azure integration][6]. ## Setup @@ -67,7 +71,7 @@ Azure Functions... - Set `DD_API_KEY` to your [Datadog API key][1]. - Set `DD_SITE` to {{< region-param key=dd_site code="true" >}}. (Ensure that your correct [Datadog site][2] is selected in the drop-down on the right side of this page.) -5. **Configure tags**. To filter and aggregate your telemetry in Datadog, configure the following tags as environment variables. You can add custom tags as `DD_TAGS`. +5. **Correlate traces with metrics by setting tags**. You can collect metrics from your Azure Functions by installing the [Datadog Azure integration][6]. To correlate these metrics with your traces, configure the following tags as environment variables. You can add custom tags as `DD_TAGS`. ``` DD_ENV="" @@ -75,20 +79,47 @@ Azure Functions... DD_VERSION="" DD_TAGS="," ``` + ## View traces in Datadog +In Datadog, navigate to the [Trace Explorer][4] page and search for the service name you set in the `DD_SERVICE` environment variable + + + +You can also view traces on the [Serverless > Azure Functions][5] page. This view is enriched with telemetry collected by the [Datadog Azure integration][6]. + ## Enable debug logs +You can collect debug logs 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`. + + **Values**: `true`, `false` + +`DD_LOG_LEVEL` +: Sets logging level for the Datadog Serverless Agent. Defaults to `info`. + + **Values**: `trace`, `debug`, `info`, `warn`, `error`, `critical`, `off` + ## Enable other features ### Trace metrics -[Trace metrics][3] are enabled by default. To disable them, set the following environment variable in your function's application settings: +[Trace metrics][3] are enabled by default. To configure trace metrics, use the following environment variable: + +`DD_TRACE_STATS_COMPUTATION_ENABLED` +: Enables (`true`) or disables (`false`) trace metrics. Defaults to `true`. + + **Values**: `true`, `false` + +### Correlate logs and traces -``` -DD_TRACE_STATS_COMPUTATION_ENABLED=false -``` + [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/ \ No newline at end of file From 63d27c19d567a656987994db382782c3e979bcce Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Mon, 10 Feb 2025 10:13:53 -0800 Subject: [PATCH 3/9] Apply suggestions from code review Co-authored-by: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> --- .../en/serverless/azure_functions/_index.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index d3719eb4cad75..807bcf15a2d8f 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -7,7 +7,7 @@ Azure Functions -This page explains how to collect traces from your Azure Functions. To collect 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][6]. ## Setup @@ -71,15 +71,14 @@ This page explains how to collect traces from your Azure Functions. To collect m - Set `DD_API_KEY` to your [Datadog API key][1]. - Set `DD_SITE` to {{< region-param key=dd_site code="true" >}}. (Ensure that your correct [Datadog site][2] is selected in the drop-down on the right side of this page.) -5. **Correlate traces with metrics by setting tags**. You can collect metrics from your Azure Functions by installing the [Datadog Azure integration][6]. To correlate these metrics with your traces, configure the following tags as environment variables. You can add custom tags as `DD_TAGS`. - - ``` - DD_ENV="" - DD_SERVICE="" - DD_VERSION="" - DD_TAGS="," - ``` +5. **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`. + ``` + DD_ENV="" + DD_SERVICE="" + DD_VERSION="" + DD_TAGS="," + ``` ## View traces in Datadog In Datadog, navigate to the [Trace Explorer][4] page and search for the service name you set in the `DD_SERVICE` environment variable @@ -98,7 +97,7 @@ You can collect debug logs for troubleshooting. To configure debug logs, use the **Values**: `true`, `false` `DD_LOG_LEVEL` -: Sets logging level for the Datadog Serverless Agent. Defaults to `info`. +: Sets logging level for the Datadog Serverless Compatibility Layer. Defaults to `info`. **Values**: `trace`, `debug`, `info`, `warn`, `error`, `critical`, `off` From bcf62a3629cdbf07546af0f35f152f60ec8cb537 Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Mon, 10 Feb 2025 10:17:56 -0800 Subject: [PATCH 4/9] more edits --- .../en/serverless/azure_functions/_index.md | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 807bcf15a2d8f..35818e5f8de81 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -19,9 +19,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu npm install dd-trace ``` - If your Azure Functions use a version of Node.js earlier than v18, ensure that you use a [compatible version of `dd-trace`][1]. - - To use [automatic instrumentation][2], you must use `dd-trace` v4.48+ (v4 release line) or v5.25+ (v5 release line). + To use [automatic instrumentation][2], 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. @@ -34,8 +32,8 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu const tracer = require('dd-trace').init() ``` - [1]: https://github.com/DataDog/dd-trace-js?tab=readme-ov-file#version-release-lines-and-maintenance - [2]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation +[1]: https://github.com/DataDog/dd-trace-js?tab=readme-ov-file#version-release-lines-and-maintenance +[2]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation {{< /programming-lang >}} {{< programming-lang lang="python" >}} 1. **Install dependencies**. Run the following commands: @@ -44,7 +42,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu pip install ddtrace ``` - You must use `ddtrace` v2.19+. + 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. @@ -57,7 +55,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu start() patch_all() ``` - +[1]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation {{< /programming-lang >}} {{< /programming-lang-wrapper >}} @@ -89,7 +87,7 @@ You can also view traces on the [Serverless > Azure Functions][5] page. This vie ## Enable debug logs -You can collect debug logs for troubleshooting. To configure debug logs, use the following environment variables: +You can collect [debug logs][7] 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`. @@ -112,13 +110,10 @@ You can collect debug logs for troubleshooting. To configure debug logs, use the **Values**: `true`, `false` -### Correlate logs and traces - - - [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/ \ No newline at end of file +[6]: /integrations/azure/ +[7]: /tracing/troubleshooting/tracer_debug_logs/#enable-debug-mode \ No newline at end of file From 0df31aaa3e0f6a75185594c2e15439e5ec038144 Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Mon, 10 Feb 2025 10:50:28 -0800 Subject: [PATCH 5/9] last updates --- .../en/serverless/azure_functions/_index.md | 55 +++++++++++-------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 35818e5f8de81..f4ca800adddbc 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -3,10 +3,6 @@ title: Tracing Azure Functions --- ## Overview -Azure Functions - - - 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]. ## Setup @@ -19,7 +15,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu npm install dd-trace ``` - To use [automatic instrumentation][2], you must use `dd-trace` v5.25+. + 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. @@ -32,8 +28,13 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu const tracer = require('dd-trace').init() ``` -[1]: https://github.com/DataDog/dd-trace-js?tab=readme-ov-file#version-release-lines-and-maintenance -[2]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation +3. (Optional) **Enable runtime metrics**. See [Node.js Runtime Metrics][2]. + +4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][3]. + +[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 {{< /programming-lang >}} {{< programming-lang lang="python" >}} 1. **Install dependencies**. Run the following commands: @@ -55,7 +56,13 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu start() patch_all() ``` + +3. (Optional) **Enable runtime metrics**. See [Node.js Runtime Metrics][2]. + +4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][3]. [1]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation +[2]: /tracing/metrics/runtime_metrics/python/ +[3]: /metrics/custom_metrics/dogstatsd_metrics_submission/?code-lang=python {{< /programming-lang >}} {{< /programming-lang-wrapper >}} @@ -69,7 +76,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu - Set `DD_API_KEY` to your [Datadog API key][1]. - Set `DD_SITE` to {{< region-param key=dd_site code="true" >}}. (Ensure that your correct [Datadog site][2] is selected in the drop-down on the right side of this page.) -5. **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`. +5. **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`. ``` DD_ENV="" @@ -77,15 +84,24 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu DD_VERSION="" DD_TAGS="," ``` -## View traces in Datadog -In Datadog, navigate to the [Trace Explorer][4] page and search for the service name you set in the `DD_SERVICE` environment variable +## 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 -You can also view traces on the [Serverless > Azure Functions][5] page. This view is enriched with telemetry collected by the [Datadog Azure integration][6]. +[Trace metrics][3] are enabled by default. To configure trace metrics, use the following environment variable: -## Enable debug logs +`DD_TRACE_STATS_COMPUTATION_ENABLED` +: Enables (`true`) or disables (`false`) trace metrics. Defaults to `true`. + + **Values**: `true`, `false` + +## Troubleshooting + +### Enable debug logs You can collect [debug logs][7] for troubleshooting. To configure debug logs, use the following environment variables: @@ -99,16 +115,10 @@ You can collect [debug logs][7] for troubleshooting. To configure debug logs, us **Values**: `trace`, `debug`, `info`, `warn`, `error`, `critical`, `off` -## Enable other features - -### Trace metrics +### Linux Consumption plans and GitHub Actions -[Trace metrics][3] are enabled by default. To configure trace metrics, use the following environment variable: +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]. -`DD_TRACE_STATS_COMPUTATION_ENABLED` -: Enables (`true`) or disables (`false`) trace metrics. Defaults to `true`. - - **Values**: `true`, `false` [1]: /account_management/api-app-keys/#add-an-api-key-or-client-token [2]: /getting_started/site @@ -116,4 +126,5 @@ You can collect [debug logs][7] for troubleshooting. To configure debug logs, us [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 \ No newline at end of file +[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 \ No newline at end of file From 64344b8e014daab6af3f271a094fd7d27e5b8a3d Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Mon, 10 Feb 2025 11:25:54 -0800 Subject: [PATCH 6/9] adding to side nav --- config/_default/menus/main.en.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/config/_default/menus/main.en.yaml b/config/_default/menus/main.en.yaml index 918c8da1d1950..bcf3308bd9226 100644 --- a/config/_default/menus/main.en.yaml +++ b/config/_default/menus/main.en.yaml @@ -3024,21 +3024,26 @@ menu: parent: serverless identifier: serverless_container_apps weight: 5 + - name: Azure Functions + url: serverless/azure_functions + parent: serverless + identifier: serverless_azure_functions + weight: 6 - name: Google Cloud Run url: serverless/google_cloud_run parent: serverless identifier: serverless_gcr - weight: 6 + weight: 7 - name: Glossary url: serverless/glossary parent: serverless identifier: serverless_glossary - weight: 7 + weight: 8 - name: Guides url: serverless/guide/ identifier: serverless_guides parent: serverless - weight: 8 + weight: 9 - name: Network Monitoring url: network_monitoring/ pre: network From c6909f9f806ad2922c5f9818fa9732098077171a Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Tue, 11 Feb 2025 10:19:58 -0800 Subject: [PATCH 7/9] Update content/en/serverless/azure_functions/_index.md Co-authored-by: Duncan Harvey <35278470+duncanpharvey@users.noreply.github.com> --- 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 f4ca800adddbc..372763825393d 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -57,7 +57,7 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu patch_all() ``` -3. (Optional) **Enable runtime metrics**. See [Node.js Runtime Metrics][2]. +3. (Optional) **Enable runtime metrics**. See [Python Runtime Metrics][2]. 4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][3]. [1]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation From f003bd42abe289d0727f8e8c89c3ba686d215037 Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Tue, 11 Feb 2025 10:20:24 -0800 Subject: [PATCH 8/9] Update _index.md --- content/en/serverless/azure_functions/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 372763825393d..5b4c3da52a495 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -1,5 +1,5 @@ --- -title: Tracing Azure Functions +title: Install Serverless Monitoring for Azure Functions --- ## Overview @@ -127,4 +127,4 @@ To use a GitHub Action to deploy to a Linux Consumption function, you must confi [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 \ No newline at end of file +[8]: https://github.com/Azure/functions-action?tab=readme-ov-file#using-azure-service-principal-for-rbac-as-deployment-credential From c236a0e6e8be79d882c822e82a2c1d1cd0b376e5 Mon Sep 17 00:00:00 2001 From: cecilia saixue watt Date: Thu, 13 Feb 2025 11:02:01 -0800 Subject: [PATCH 9/9] resolving edits --- .../en/serverless/azure_functions/_index.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/content/en/serverless/azure_functions/_index.md b/content/en/serverless/azure_functions/_index.md index 5b4c3da52a495..a6a4d8925e3b0 100644 --- a/content/en/serverless/azure_functions/_index.md +++ b/content/en/serverless/azure_functions/_index.md @@ -60,30 +60,30 @@ This page explains how to collect traces, trace metrics, runtime metrics, and cu 3. (Optional) **Enable runtime metrics**. See [Python Runtime Metrics][2]. 4. (Optional) **Enable custom metrics**. See [Metric Submission: DogStatsD][3]. + [1]: /tracing/trace_collection/automatic_instrumentation/?tab=singlestepinstrumentation [2]: /tracing/metrics/runtime_metrics/python/ [3]: /metrics/custom_metrics/dogstatsd_metrics_submission/?code-lang=python {{< /programming-lang >}} {{< /programming-lang-wrapper >}} -3. **Deploy your function**. +5. **Deploy your function**. -4. **Configure Datadog intake**. Add the following environment variables to your function's application settings: - ``` - DD_API_KEY= - DD_SITE={{< region-param key=dd_site code="true" >}} - ``` - - Set `DD_API_KEY` to your [Datadog API key][1]. - - Set `DD_SITE` to {{< region-param key=dd_site code="true" >}}. (Ensure that your correct [Datadog site][2] is selected in the drop-down on the right side of this page.) +6. **Configure Datadog intake**. Add the following environment variables to your function's application settings: + + | Name | Value | + | ---- | ----- | + | `DD_API_KEY` | Your [Datadog API key][1]. | + | `DD_SITE` | Your [Datadog site][2]. For example, {{< region-param key=dd_site code="true" >}}. | -5. **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][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`. - ``` - DD_ENV="" - DD_SERVICE="" - DD_VERSION="" - 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_TAGS` | Your comma-separated custom tags. For example, `key1:value1,key2:value2`. | ## What's next? @@ -128,3 +128,4 @@ To use a GitHub Action to deploy to a Linux Consumption function, you must confi [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