Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS-9940: Serverless Monitoring for Azure Functions #27294

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding content
  • Loading branch information
cswatt committed Jan 24, 2025
commit 5bd850da947c3977170b7d4ec05c5d3d57da8fdc
45 changes: 38 additions & 7 deletions content/en/serverless/azure_functions/_index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---
title: Serverless Monitoring for Azure Functions
title: Tracing Azure Functions
duncanpharvey marked this conversation as resolved.
Show resolved Hide resolved
---

## Overview
Azure Functions...
Azure Functions

<!-- TODO: some more preamble -->

This page explains how to collect traces from your Azure Functions. To collect metrics, install the [Datadog Azure integration][6].
cswatt marked this conversation as resolved.
Show resolved Hide resolved

## Setup

Expand All @@ -19,7 +23,7 @@

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.

Check notice on line 26 in content/en/serverless/azure_functions/_index.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.sentencelength

Suggestion: Try to keep your sentence length to 25 words or fewer.

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`):

Expand Down Expand Up @@ -67,28 +71,55 @@
- 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="<ENVIRONMENT>"
DD_SERVICE="<SERVICE_NAME>"
DD_VERSION="<VERSION>"
DD_TAGS="<KEY_1:VALUE_1>,<KEY_2:VALUE_2>"
```

## 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

<!-- TODO: maybe some more here -->

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`
duncanpharvey marked this conversation as resolved.
Show resolved Hide resolved

`DD_LOG_LEVEL`
: Sets logging level for the Datadog Serverless Agent. Defaults to `info`.
cswatt marked this conversation as resolved.
Show resolved Hide resolved

**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
```
<!-- TODO: to be continued -->

[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/
Loading