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 2 commits into
base: master
Choose a base branch
from

Conversation

cswatt
Copy link
Contributor

@cswatt cswatt commented Jan 24, 2025

What does this PR do? What is the motivation?

Merge instructions

Merge readiness:

  • Ready for merge

Merge queue is enabled in this repo. To have it automatically merged after it receives the required reviews, create the PR (from a branch that follows the <yourname>/description naming convention) and then add the following PR comment:

/merge

Additional notes

@cswatt cswatt added the WORK IN PROGRESS No review needed, it's a wip ;) label Jan 24, 2025
@cswatt cswatt requested review from a team as code owners January 24, 2025 19:33
Copy link
Contributor

Preview links (active after the build_preview check completes)

New or renamed files

Copy link
Contributor

@duncanpharvey duncanpharvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this started @cswatt! Let me know what you think about my suggestions.

Can we mention that we support runtime metrics and custom metrics and link the relevant documentation?

Could we also have more section (maybe under troubleshooting?) to document that if deploying to a Linux Consumption function with a Github Action that the "Using Azure Service Principal for RBAC as Deployment Credential" method needs to be used?

https://github.com/Azure/functions-action?tab=readme-ov-file#using-azure-service-principal-for-rbac-as-deployment-credential

Comment on lines +22 to +24
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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the last week the v4 tracer release line status was updated to end of life. I think we can remove any references to the v4 release line and using versions of Node.js earlier than 18and instead just mention using v5.25+ for auto instrumentation.

pip install ddtrace
```

You must use `ddtrace` v2.19+.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the same language here that we use for Node?

To use automatic instrumentation, you must use ddtrace v2.19+

Comment on lines +95 to +98
`DD_TRACE_DEBUG`
: Enables (`true`) or disables (`false`) debug logging for the Datadog Tracing Library. Defaults to `false`.

**Values**: `true`, `false`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +83 to +89
## 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].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about a What's next? section like we have for AWS Lambda where we link to other pages that explain how to view traces in the trace explorer, serverless page, etc.?

Comment on lines +74 to +82
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>"
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>"
```
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="<ENVIRONMENT>"
DD_SERVICE="<SERVICE_NAME>"
DD_VERSION="<VERSION>"
DD_TAGS="<KEY_1:VALUE_1>,<KEY_2:VALUE_2>"
```


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

This page explains how to collect traces from your Azure Functions. To collect metrics, install the [Datadog Azure integration][6].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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].

Comment on lines +116 to +118
### Correlate logs and traces

<!-- TODO: to be continued -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can drop this for now while we work on more logging capabilities

**Values**: `true`, `false`

`DD_LOG_LEVEL`
: Sets logging level for the Datadog Serverless Agent. Defaults to `info`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: Sets logging level for the Datadog Serverless Agent. Defaults to `info`.
: Sets logging level for the Datadog Serverless Compatibility Layer. Defaults to `info`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WORK IN PROGRESS No review needed, it's a wip ;)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants