Skip to content

Commit 56ce6f6

Browse files
authored
Merge pull request DataDog#8601 from DataDog/alex.cuoci/serverless-xray-cleanup
AWS X-Ray integration documentation and cleanup
2 parents d2b868e + 3115c6a commit 56ce6f6

File tree

5 files changed

+54
-52
lines changed

5 files changed

+54
-52
lines changed

content/en/serverless/installation/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Install the [AWS integration][1]. This allows Datadog to ingest Lambda metrics f
1616

1717
### 2. Install the Datadog Forwarder
1818

19-
Install the [Datadog Forwarder Lambda function][2], which is required for ingestion of AWS Lambda traces, enhanced metrics, custom metrics, and logs. **Note**: Skip this step if you already have the Forwarder function installed as part of the [AWS integration][1] CloudFormation stack.
19+
Install the [Datadog Forwarder Lambda function][2], which is required to ingest AWS Lambda traces, enhanced metrics, custom metrics, and logs.
20+
21+
**Note**: Skip this step if you already have the Forwarder function installed as part of the [AWS integration][1] CloudFormation Stack.
2022

2123
### 3. Instrument Your Application
2224

content/en/serverless/installation/nodejs.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ You need to subscribe the Datadog Forwarder Lambda function to each of your func
250250
251251
After you have configured your function following the steps above, you can view metrics, logs and traces on the [Serverless Homepage][2].
252252
253+
### Monitor Custom Business Metrics
254+
253255
If you would like to submit a custom metric or manually instrument a function, see the sample code below:
254256
255257
```javascript
@@ -278,6 +280,15 @@ exports.handler = async (event) => {
278280
return response;
279281
};
280282
```
283+
[Enable custom metric submission][3] to get started.
284+
285+
### Enable the AWS X-Ray Integration
286+
287+
Datadog’s integration with AWS X-Ray allows you to visualize end-to-end serverless transactions, so you can zero in on the source of any errors or slowdowns, and see how the performance of your functions impacts your users’ experience. Depending on your language and configuration, [choose between setting up Datadog APM or the AWS X-Ray integration][4] for your tracing needs.
288+
289+
{{< img src="integrations/amazon_lambda/lambda_tracing.png" alt="Architecture diagram for tracing AWS Lambda with Datadog" >}}
281290

282291
[1]: /integrations/amazon_web_services/
283-
[2]: https://app.datadoghq.com/functions
292+
[2]: /serverless/forwarder
293+
[3]: /serverless/custom_metrics
294+
[4]: /serverless/distributed_tracing

content/en/serverless/installation/python.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,13 @@ arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python37:19
245245

246246
#### Using the Package
247247

248-
Install `datadog-lambda` and its dependencies locally to your function project folder. **Note**: `datadog-lambda` depends on `ddtrace`, which uses native extensions; therefore they must be installed and compiled in a Linux environment. For example, you can use [dockerizePip][8] for the Serverless Framework and [--use-container][9] for AWS SAM. For more details, see [how to add dependencies to your function deployment package][3].
248+
Install `datadog-lambda` and its dependencies locally to your function project folder. **Note**: `datadog-lambda` depends on `ddtrace`, which uses native extensions; therefore they must be installed and compiled in a Linux environment. For example, you can use [dockerizePip][3] for the Serverless Framework and [--use-container][4] for AWS SAM. For more details, see [how to add dependencies to your function deployment package][5].
249249

250250
```
251251
pip install datadog-lambda -t ./
252252
```
253253

254-
See the [latest release][4].
254+
See the [latest release][6].
255255

256256
### Configure the Function
257257

@@ -265,27 +265,29 @@ See the [latest release][4].
265265

266266
You need to subscribe the Datadog Forwarder Lambda function to each of your function’s log groups, to send metrics, traces, and logs to Datadog.
267267

268-
1. [Install the Datadog Forwarder][5] if you haven't.
269-
2. [Ensure the option DdFetchLambdaTags is enabled][6].
270-
3. [Subscribe the Datadog Forwarder to your function's log groups][7].
268+
1. [Install the Datadog Forwarder][7] if you haven't.
269+
2. [Ensure the option DdFetchLambdaTags is enabled][8].
270+
3. [Subscribe the Datadog Forwarder to your function's log groups][9].
271271

272272

273273
[1]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html
274274
[2]: https://github.com/DataDog/datadog-lambda-python/releases
275-
[3]: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-dependencies
276-
[4]: https://pypi.org/project/datadog-lambda/
277-
[5]: https://docs.datadoghq.com/serverless/forwarder/
278-
[6]: https://docs.datadoghq.com/serverless/forwarder/#experimental-optional
279-
[7]: https://docs.datadoghq.com/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function/#collecting-logs-from-cloudwatch-log-group
280-
[8]: https://github.com/UnitedIncome/serverless-python-requirements#cross-compiling
281-
[9]: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html
275+
[3]: https://github.com/UnitedIncome/serverless-python-requirements#cross-compiling
276+
[4]: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html
277+
[5]: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-dependencies
278+
[6]: https://pypi.org/project/datadog-lambda/
279+
[7]: https://docs.datadoghq.com/serverless/forwarder/
280+
[8]: https://docs.datadoghq.com/serverless/forwarder/#experimental-optional
281+
[9]: https://docs.datadoghq.com/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function/#collecting-logs-from-cloudwatch-log-group
282282
{{% /tab %}}
283283
{{< /tabs >}}
284284

285285
## Explore Datadog Serverless Monitoring
286286

287287
After you have configured your function following the steps above, you can view metrics, logs and traces on the [Serverless Homepage][3].
288288

289+
### Monitor Custom Business Metrics
290+
289291
If you would like to submit a custom metric or manually instrument a function, see the sample code below:
290292

291293
```python
@@ -310,6 +312,16 @@ def get_message():
310312
return "Hello from serverless!"
311313
```
312314

315+
[Enable custom metric submission][3] to get started.
316+
317+
### Enable the AWS X-Ray Integration
318+
319+
Datadog’s integration with AWS X-Ray allows you to visualize end-to-end serverless transactions, so you can zero in on the source of any errors or slowdowns, and see how the performance of your functions impacts your users’ experience. Depending on your language and configuration, [choose between setting up Datadog APM or the AWS X-Ray integration][5] for your tracing needs.
320+
321+
{{< img src="integrations/amazon_lambda/lambda_tracing.png" alt="Architecture diagram for tracing AWS Lambda with Datadog" >}}
322+
313323
[1]: /integrations/amazon_web_services/
314324
[2]: /serverless/forwarder
315325
[3]: https://app.datadoghq.com/functions
326+
[4]: /serverless/custom_metrics
327+
[5]: /serverless/distributed_tracing

content/en/serverless/installation/ruby.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ You need to subscribe the Datadog Forwarder Lambda function to each of your func
6161

6262
After you have configured your function following the steps above, you should be able to view metrics, logs and traces on the [Serverless Homepage][8].
6363

64+
### Monitor Custom Business Metrics
65+
6466
If you would like to submit a custom metric or manually instrument a function, see the sample code below:
6567

6668
```ruby
@@ -92,7 +94,13 @@ def some_operation()
9294
end
9395
end
9496
```
97+
[Enable custom metric submission][3] to get started.
98+
99+
### Enable the AWS X-Ray Integration
100+
101+
Datadog’s integration with AWS X-Ray allows you to visualize end-to-end serverless transactions, so you can zero in on the source of any errors or slowdowns, and see how the performance of your functions impacts your users’ experience. Depending on your language and configuration, [choose between setting up Datadog APM or the AWS X-Ray integration][5] for your tracing needs.
95102

103+
{{< img src="integrations/amazon_lambda/lambda_tracing.png" alt="Architecture diagram for tracing AWS Lambda with Datadog" >}}
96104

97105
[1]: /serverless/#1-install-the-cloud-integration
98106
[2]: https://docs.datadoghq.com/serverless/forwarder/
@@ -102,3 +110,5 @@ end
102110
[6]: https://docs.datadoghq.com/serverless/forwarder/#experimental-optional
103111
[7]: https://docs.datadoghq.com/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function/#collecting-logs-from-cloudwatch-log-group
104112
[8]: https://app.datadoghq.com/functions
113+
[9]: /serverless/custom_metrics
114+
[10]: /serverless/distributed_tracing

content/en/tracing/serverless_functions/_index.md

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,20 @@ Depending on your language and configuration, choose between setting up Datadog
2020
| Set up using your developer tools without making any changes to your code with Serverless Framework and AWS SAM Integrations. | Install the AWS X-Ray client library for your Lambda runtime. |
2121
| Support for Python, Node.js, Ruby. | Support for all Lambda runtimes. |
2222

23-
24-
## Organizing your Serverless infrastructure with tags
25-
26-
Any [tag][3] applied to your AWS Lambda function automatically becomes a new dimension on which you can slice and dice your traces.
27-
28-
Tags are especially powerful for consistency across the Datadog platform, which has [first-class support][4] for the `env` and `service` tags.
29-
30-
**Note**: If you are tracing with Datadog APM, set the parameter `DdFetchLambdaTags` to `true` on the forwarder CloudFormation stack to ensure your traces are tagged with the resource tags on the originating Lambda function. Lambda function resource tags are automatically surfaced to X-Ray traces in Datadog without any additional configuration.
31-
32-
### The env tag
33-
34-
Use `env` to separate out your staging, development, and production environments. This works for any kind of infrastructure, not just for your serverless functions. As an example, you could tag your production EU Lambda functions with `env:prod-eu`.
35-
36-
By default, AWS Lambda functions are tagged with `env:none` in Datadog. Add your own tag to override this.
37-
38-
### The service tag
39-
40-
Add the `service` [tag][5] in order to group related Lambda functions into a [service][6]. The [Service Map][5] and [Services List][7] use this tag to show relationships between services and the health of their monitors. Services are represented as individual nodes on the Service Map.
41-
42-
By default, each Lambda function is treated as its own `service`. Add your own tag to override this.
43-
44-
**Note**: The default behavior for new Datadog customers is for all Lambda functions to be grouped under the `aws.lambda` service, and represented as a single node on the Service map. Tag your functions by `service` to override this.
45-
46-
{{< img src="integrations/amazon_lambda/animated_service_map.gif" alt="animated service map of Lambda functions" >}}
47-
4823
## Augment AWS X-Ray Tracing with Datadog APM
4924

5025
{{< img src="integrations/amazon_lambda/lambda_tracing.png" alt="Architecture diagram for tracing AWS Lambda with Datadog" >}}
5126

52-
You might also configure _both_ AWS X-Ray Tracing and Datadog APM, which can be useful, but will result in higher usage bills. If you are unsure whether to use Datadog APM or AWS X-Ray, contact [our support team][8] to discuss.
53-
54-
You can find setup instructions for this case when you want to do both below:
27+
You might also configure _both_ AWS X-Ray Tracing and Datadog APM. Note that this may result in higher usage bills. You can find setup instructions for this case when you want to do both below:
5528

5629
- [Tracing in a serverless-first environment](#tracing-in-a-serverless-first-environment)
5730
- [Tracing across AWS Lambda and hosts](#tracing-across-aws-lambda-and-hosts)
5831

5932
#### Tracing in a serverless-first environment
6033

61-
AWS X-Ray is both a backend AWS service and a set of client libraries. The service gives you an Invocation span for your AWS Lambda functions and traces across Amazon API Gateways and message queues.
34+
AWS X-Ray provides both a backend AWS service and a set of client libraries. Enabling the backend AWS service alone gives you an Invocation span for your AWS Lambda functions as well as traces across Amazon API Gateways and message queues.
6235

63-
The client libraries trace the integrations in your code. If you are using the Datadog APM client library instead of the AWS X-Ray client library to trace and visualize traces, follow the below two steps:
36+
Both the AWS X-Ray and Datadog APM client libraries trace the integrations in your code. If you are using the Datadog APM client library instead of the AWS X-Ray client library to trace and visualize traces, follow the below two steps:
6437

6538
1. Enable the [AWS X-Ray integration][2] for tracing your Lambda functions.
6639
2. [Set up Datadog APM][1] on your Lambda functions.
@@ -103,7 +76,7 @@ Set the `DD_MERGE_DATADOG_XRAY_TRACES` environment variable to `True` on your La
10376
When applicable, Datadog merges AWS X-Ray traces with native Datadog APM traces. This means that your traces will show the complete picture of requests that cross infrastructure boundaries, whether it be AWS Lambda, containers, on-prem hosts, or managed services.
10477

10578
1. Enable the [AWS X-Ray integration][2] for tracing your Lambda functions.
106-
2. [Set up Datadog APM][9] on your hosts and container-based infrastructure.
79+
2. [Set up Datadog APM][3] on your hosts and container-based infrastructure.
10780

10881
**Note**: Distributed Tracing is supported for any runtime for your host or container-based applications.
10982

@@ -117,10 +90,4 @@ When applicable, Datadog merges AWS X-Ray traces with native Datadog APM traces.
11790

11891
[1]: /serverless/
11992
[2]: /tracing/serverless_functions/enable_aws_xray/
120-
[3]: /getting_stared/tagging/
121-
[4]: /getting_started/tagging/unified_service_tagging
122-
[5]: /tracing/visualization/services_map/#the-service-tag
123-
[6]: /tracing/visualization/#services
124-
[7]: /tracing/visualization/services_list/
125-
[8]: /help
126-
[9]: /tracing/send_traces/
93+
[3]: /tracing/send_traces/

0 commit comments

Comments
 (0)