Skip to content

Commit 3ad2788

Browse files
Serverless > Azure App Services Linux > Update .NET instructions (#30470)
Co-authored-by: Andrew Lock <[email protected]>
1 parent d3f13b3 commit 3ad2788

File tree

2 files changed

+117
-63
lines changed

2 files changed

+117
-63
lines changed

content/en/serverless/azure_app_services/_index.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,48 +28,52 @@ To get started with monitoring Azure App Service, install the Azure integration
2828

2929
### Azure Integration
3030

31-
The [Azure integration][3] provides [enriched metrics][2] and resource metadata for Azure App Service, and are required for the [Azure App Service View][4] in Datadog. Follow the [Azure integration setup instructions][6] to install the Azure integration.
31+
The [Azure integration][2] provides [enriched metrics][3] and resource metadata for Azure App Service, and are required for the [Azure App Service View][4] in Datadog. Follow the [Azure integration setup instructions][5] to install the Azure integration.
3232

33-
Additionally, [set up Azure log forwarding][5] to automatically collect and send Azure App Service resource and application logs to Datadog.
33+
Additionally, [set up Azure log forwarding][6] to automatically collect and send Azure App Service resource and application logs to Datadog.
3434

3535
### Azure App Service Instrumentation
3636

3737
To monitor Azure App Service workloads with APM and custom metrics, install instrumentation on your Azure App Service workloads. This instrumentation is available for both Windows and Linux App Services, and supports the following runtimes on Basic, Standard, and Premium plans:
3838

39-
| OS | Runtime |Documentation|
40-
|----|---------|-----|
41-
|Windows|.NET|[Windows .NET setup][7]|
42-
|Windows|Java|[Windows Java setup][8]|
43-
|Windows|Node|[Windows Node setup][13]|
44-
|Linux|.NET|[Linux .NET setup][9]|
45-
|Linux|Node|[Linux Node setup][9]|
46-
|Linux|PHP|[Linux PHP setup][9]|
47-
|Linux|Java|[Linux Java setup][10]|
48-
|Linux|Python|[Linux Python setup][9]|
49-
|Linux|Container|[Linux Container setup][12]|
39+
| OS | Runtime | Documentation |
40+
|---------|-----------|-----------------------------|
41+
| Windows | .NET | [Windows .NET setup][7] |
42+
| Windows | Java | [Windows Java setup][8] |
43+
| Windows | Node.js | [Windows Node.js setup][9] |
44+
| Linux | .NET | [Linux .NET setup][10] |
45+
| Linux | Java | [Linux Java setup][11] |
46+
| Linux | Node.js | [Linux Node.js setup][12] |
47+
| Linux | PHP | [Linux PHP setup][13] |
48+
| Linux | Python | [Linux Python setup][14] |
49+
| Linux | Container | [Linux Container setup][15] |
5050

5151

5252
Capabilities:
5353
- Fully distributed APM tracing using automatic instrumentation
5454
- Customized APM service and trace views showing relevant Azure App Service metrics and metadata
5555
- Manual APM instrumentation to customize spans
5656
- `Trace_ID` injection into application logs
57-
- Custom metrics with [DogStatsD][11]
57+
- Custom metrics with [DogStatsD][16]
5858

5959
## Further reading
6060

6161
{{< partial name="whats-next/whats-next.html" >}}
6262

6363
[1]: https://learn.microsoft.com/en-us/azure/app-service/overview
64-
[2]: /integrations/azure_app_services/#metrics
65-
[3]: /integrations/azure/
64+
[2]: /integrations/azure/
65+
[3]: /integrations/azure_app_services/#metrics
6666
[4]: https://app.datadoghq.com/serverless/azure/app-service-plan
67-
[5]: /logs/guide/azure-logging-guide/
68-
[6]: /integrations/azure/#setup
69-
[7]: /serverless/azure_app_services/azure_app_services_windows?tab=net#setup
70-
[8]: /serverless/azure_app_services/azure_app_services_windows?tab=java#setup
71-
[9]: /serverless/azure_app_services/azure_app_services_linux?tab=nodenetphppython
72-
[10]: /serverless/azure_app_services/azure_app_services_linux?tab=java
73-
[11]: /developers/dogstatsd/
74-
[12]: /serverless/azure_app_services/azure_app_services_container
75-
[13]: /serverless/azure_app_services/azure_app_services_windows?tab=nodejs#setup
67+
[5]: /integrations/azure/#setup
68+
[6]: /logs/guide/azure-logging-guide/
69+
[7]: /serverless/azure_app_services/azure_app_services_windows?tab=net
70+
[8]: /serverless/azure_app_services/azure_app_services_windows?tab=java
71+
[9]: /serverless/azure_app_services/azure_app_services_windows?tab=nodejs
72+
[10]: /serverless/azure_app_services/azure_app_services_linux?tab=net
73+
[11]: /serverless/azure_app_services/azure_app_services_linux?tab=java
74+
[12]: /serverless/azure_app_services/azure_app_services_linux/?tab=nodejs
75+
[13]: /serverless/azure_app_services/azure_app_services_linux/?tab=php
76+
[14]: /serverless/azure_app_services/azure_app_services_linux/?tab=python
77+
[15]: /serverless/azure_app_services/azure_app_services_container
78+
[16]: /developers/dogstatsd/
79+

content/en/serverless/azure_app_services/azure_app_services_linux.md

Lines changed: 88 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ further_reading:
99

1010
This solution uses a sidecar container and Application Settings for Linux Azure App Service to instrument the application and manage its configuration.
1111

12-
If you would prefer to not use the sidecar approach (Not Recommended), you can instead follow the instructions to [Instrument Azure App Service - Linux Code Deployment with the Datadog wrapper][17].
12+
If you would prefer to not use the sidecar approach (Not Recommended), you can instead follow the instructions to [Instrument Azure App Service - Linux Code Deployment with the Datadog wrapper][1].
1313

1414
**Supported runtimes**: Java, Node.js, .NET, PHP, Python
1515

@@ -21,6 +21,7 @@ Install the tracing library for your language:
2121

2222
{{< tabs >}}
2323
{{% tab "Java" %}}
24+
2425
Java supports adding instrumentation code through the use of a command line argument, `javaagent`.
2526

2627
1. Download the [latest version of Datadog's Java tracing library][101].
@@ -31,8 +32,10 @@ Java supports adding instrumentation code through the use of a command line argu
3132
Instrumentation starts when the application is launched.
3233

3334
[101]: https://dtdg.co/latest-java-tracer
35+
3436
{{% /tab %}}
3537
{{% tab "Node.js" %}}
38+
3639
1. Add the `ddtrace` package to your project using your package manager.
3740
1. Initialize the tracer by doing one of the following:
3841
- Set `NODE_OPTIONS` with `--require=dd-trace/init`
@@ -45,9 +48,15 @@ Instrumentation starts when the application is launched.
4548
{{% /tab %}}
4649
{{% tab ".NET" %}}
4750

48-
Add the `Datadog.Trace.Bundle` Nuget package to your project.
51+
Add the `Datadog.Trace.Bundle` Nuget package to your project. See [the Nuget package page for more details][102].
52+
53+
For example:
54+
55+
```shell
56+
dotnet add package Datadog.Trace.Bundle --version 3.21.0
57+
```
4958

50-
**Note**: When you complete Step 2, ensure that you also set the [additional environment variables](#configure-environment-variables) required by the .NET tracer.
59+
[102]: https://www.nuget.org/packages/Datadog.Trace.Bundle#readme-body-tab
5160

5261
{{% /tab %}}
5362
{{% tab "PHP" %}}
@@ -123,27 +132,64 @@ Additional flags, like `--service` and `--env`, can be used to set the service a
123132
1. **Configure environment variables**.
124133
In Azure, add the following key-value pairs in **Settings** > **Configuration** > **Application settings**:
125134
126-
| Name | Value | Description |
127-
|------|-------|-------------|
128-
| `DD_API_KEY` | Your Datadog API key. | See [Organization Settings > API Keys][301] in Datadog. |
129-
| `DD_SITE` | {{< region-param key="dd_site" code="true" >}} | Your [Datadog site][302]. Defaults to `datadoghq.com`. |
130-
| `DD_SERVICE` | Your application's service name. | Defaults to the name field value in `package.json`. |
131-
| `DD_ENV` | Your application's environment name. | There is no default value for this field. |
132-
| `DD_SERVERLESS_LOG_PATH` | The log path the sidecar uses to collect logs. | Where you write your logs. For example, `/home/LogFiles/*.log` or `/home/LogFiles/myapp/*.log`. |
133-
| `WEBSITES_ENABLE_APP_SERVICE_STORAGE` | `true` | Setting this environment variable to `true` allows the `/home/` mount to persist and be shared with the sidecar. |
135+
`DD_API_KEY`
136+
: **Value**: Your Datadog API key.<br>
137+
See [Organization Settings > API Keys][301] in Datadog.<br>
138+
139+
`DD_SITE`
140+
: **Value**: {{< region-param key="dd_site" code="true" >}}<br>
141+
Your [Datadog site][302]. Defaults to `datadoghq.com`.<br>
142+
Use the "Datadog Site" drop-down menu on this page's right navigation bar to select your site.<br>
143+
144+
`DD_SERVICE`
145+
: **Value**: Your application's service name.<br>
146+
Defaults to the name field value in `package.json`.<br>
147+
See [Unified Service Tagging][303] for more information on the `service` tag.<br>
148+
149+
`DD_ENV`
150+
: **Value**: Your application's environment name.<br>
151+
There is no default value for this field.<br>
152+
See [Unified Service Tagging][303] for more information on the `env` tag.<br>
153+
154+
`DD_VERSION`
155+
: **Value**: Your application's version.<br>
156+
There is no default value for this field.<br>
157+
See [Unified Service Tagging][303] for more information on the `version` tag.<br>
158+
159+
`DD_SERVERLESS_LOG_PATH`
160+
: **Value**: The log path the sidecar uses to collect logs.<br>
161+
Where you write your logs. For example, `/home/LogFiles/*.log` or `/home/LogFiles/myapp/*.log`.<br>
162+
163+
`WEBSITES_ENABLE_APP_SERVICE_STORAGE`
164+
: **Value**: `true`<br>
165+
Setting this environment variable to `true` allows the `/home/` mount to persist and be shared with the sidecar.<br>
134166
135167
{{% collapse-content title=".NET: Additional required environment variables" level="h4" id="dotnet-additional-settings" %}}
136168
137-
For .NET applications, the following environment variables are **required** unless otherwise specified:
169+
For .NET applications, the following environment variables are **required**. See the `Datadog.Tracer.Bundle` [Nuget package README file][1] for more details.
170+
171+
`DD_DOTNET_TRACER_HOME`
172+
: **Value**: `/home/site/wwwroot/datadog`<br>
173+
Path to the directory containing the .NET tracing libraries.<br>
174+
175+
`DD_TRACE_LOG_DIRECTORY`
176+
: **Value**: `/home/LogFiles/dotnet`<br>
177+
Path where the .NET tracing library will write its logs.<br>
178+
179+
`CORECLR_ENABLE_PROFILING`
180+
: **Value**: `1`<br>
181+
Enables the instrumentation APIs in the .NET runtime.<br>
138182
139-
| Name | Value | Description |
140-
|------|-------|-------------|
141-
| `DD_DOTNET_TRACER_HOME` | `/home/site/wwwroot/datadog` | Path to tracing libraries, copied within the Docker file |
142-
| `DD_TRACE_LOG_DIRECTORY` | `/home/LogFiles/dotnet` | Where tracer logs are stored |
143-
| `CORECLR_ENABLE_PROFILING` | 1 | Instructs the .NET CLR that profiling should be enabled. |
144-
| `CORECLR_PROFILER` | `{846F5F1C-F9AE-4B07-969E-05C26BC060D8}` | Profiler GUID. |
145-
| `CORECLR_PROFILER_PATH` | `/home/site/wwwroot/datadog/linux-musl-x64/Datadog.Trace.ClrProfiler.Native.so` | The profiler binary that the .NET CLR loads into memory, which contains the GUID. |
146-
| `DD_PROFILING_ENABLED` (_optional_) | `true` | Enables Datadog's [Continuous Profiler][303]. |
183+
`CORECLR_PROFILER`
184+
: **Value**: `{846F5F1C-F9AE-4B07-969E-05C26BC060D8}`<br>
185+
Identifier for Datadog's .NET the instrumentation library.<br>
186+
187+
`CORECLR_PROFILER_PATH`
188+
: **Value**: `/home/site/wwwroot/datadog/`<br>
189+
`linux-x64/Datadog.Trace.ClrProfiler.Native.so` (single line)<br>
190+
Path to the instrumentation library loaded by the .NET runtime.<br>
191+
192+
[1]: https://www.nuget.org/packages/Datadog.Trace.Bundle#readme-body-tab
147193

148194
{{% /collapse-content %}}
149195

@@ -165,23 +211,28 @@ For .NET applications, the following environment variables are **required** unle
165211

166212
[301]: https://app.datadoghq.com/organization-settings/api-keys
167213
[302]: /getting_started/site/
168-
[303]: /profiler
214+
[303]: /getting_started/tagging/unified_service_tagging
215+
169216
{{% /tab %}}
170217
{{< /tabs >}}
171218

172219
### View traces in Datadog
173220

174-
After your application restarts, go to Datadog's [APM Service page][4] and search for the service name you set for your application (`DD_SERVICE`).
221+
After your application restarts, go to Datadog's [APM Service page][1] and search for the service name you set for your application (`DD_SERVICE`).
175222
176223
### Custom metrics
177224
178225
To configure your application to submit custom metrics, follow the appropriate steps for your runtime:
179226
180-
- [Java][9]
181-
- [Node][5]
182-
- [.NET][6]
183-
- [PHP][10]
184-
- [Python][11]
227+
- [Java][3]
228+
- [Node.js][4]
229+
- [.NET][5]
230+
- [PHP][6]
231+
- [Python][7]
232+
233+
### Continuous Profiler
234+
235+
To enable the Continuous Profiler, set the environment variable `DD_PROFILING_ENABLED=true`. For more information, see the [Continuous Profiler documentation][8].
185236
186237
## Deployment
187238
@@ -195,19 +246,18 @@ Be sure to enable **App Service logs** to receive debugging logs.
195246
196247
{{< img src="serverless/azure_app_service/app-service-logs.png" alt="Azure App Service Configuration: App Service logs, under the Monitoring section of Settings in the Azure UI. The 'Application logging' option is set to 'File System'." style="width:100%;" >}}
197248
198-
Share the content of the **Log stream** with [Datadog Support][14].
249+
Share the content of the **Log stream** with [Datadog Support][9].
199250
200251
## Further reading
201252
202253
{{< partial name="whats-next/whats-next.html" >}}
203254
204-
[1]: /developers/dogstatsd
205-
[3]: https://www.datadoghq.com/blog/azure-app-service-datadog-serverless-view/
206-
[4]: /tracing/services/service_page/
207-
[5]: https://github.com/brightcove/hot-shots
208-
[6]: /developers/dogstatsd/?tab=hostagent&code-lang=dotnet#code
209-
[9]: https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent&code-lang=java
210-
[10]: https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent&code-lang=php
211-
[11]: https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent&code-lang=python
212-
[14]: /help
213-
[17]: /serverless/guide/azure_app_service_linux_code_wrapper_script
255+
[1]: /serverless/guide/azure_app_service_linux_code_wrapper_script
256+
[2]: /tracing/services/service_page/
257+
[3]: /developers/dogstatsd/?tab=java#dogstatsd-client
258+
[4]: https://github.com/brightcove/hot-shots
259+
[5]: /developers/dogstatsd/?tab=dotnet#dogstatsd-client
260+
[6]: /developers/dogstatsd/?tab=php#dogstatsd-client
261+
[7]: /developers/dogstatsd/?tab=python#dogstatsd-client
262+
[8]: /profiler/
263+
[9]: /help

0 commit comments

Comments
 (0)