Skip to content

Commit

Permalink
Apply new docs template to X-Ray
Browse files Browse the repository at this point in the history
  • Loading branch information
joe4dev committed Sep 12, 2023
1 parent b5e6bfd commit 330eddf
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion content/en/getting-started/api-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The easiest way to check if LocalStack is activated is to query the health endpo
$ curl localhost:4566/_localstack/health | jq
{{< / command >}}

If a Pro-only [service]({{< ref "aws" >}}) -- like [XRay]({{< ref "XRay-Tracing" >}}) -- is running, LocalStack has started successfully. You can also check the logs of the LocalStack container to see if the activation was successful.
If a Pro-only [service]({{< ref "aws" >}}) -- like [XRay]({{< ref "xray" >}}) -- is running, LocalStack has started successfully. You can also check the logs of the LocalStack container to see if the activation was successful.

{{< command >}}
[...] Successfully activated API key
Expand Down
2 changes: 1 addition & 1 deletion content/en/getting-started/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ The easiest way to check if LocalStack Pro or Enterprise is activated is to chec
$ curl localhost:4566/_localstack/health | jq
{{< / command >}}

If a Pro-only [service]({{< ref "aws" >}}) -- like [XRay]({{< ref "XRay-Tracing" >}}) -- is running, LocalStack Pro or Enterprise has started successfully. If your API key is invalid, you will see an error message like this in the logs of LocalStack:
If a Pro-only [service]({{< ref "aws" >}}) -- like [XRay]({{< ref "xray" >}}) -- is running, LocalStack Pro or Enterprise has started successfully. If your API key is invalid, you will see an error message like this in the logs of LocalStack:

```bash
Activation key "abc..."(10) is invalid or expired! Reason: ...
Expand Down
2 changes: 1 addition & 1 deletion content/en/user-guide/aws/feature-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ In the coverage table below, the features are marked with their respective avail
| SSH Public Keys | ⭐⭐⭐ | CRUD | |
| Tags | \- | | |
| Users | ⭐⭐⭐ | Emulated | |
| [**X-Ray** (Pro)]({{< ref "xray-tracing" >}}) | [Details 🔍]({{< ref "references/coverage/coverage_xray" >}}) | | |
| [**X-Ray** (Pro)]({{< ref "xray" >}}) | [Details 🔍]({{< ref "references/coverage/coverage_xray" >}}) | | |
| Encryption Configs | \- | | |
| Groups | \- | | |
| Insights | \- | | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
---
title: "XRay Tracing"
linkTitle: "XRay Tracing"
title: "X-Ray"
linkTitle: "X-Ray"
categories: ["LocalStack Pro"]
description: >
Get started with XRay Tracing on LocalStack
Get started with X-Ray on LocalStack
aliases:
- /aws/xray-tracing/
---

LocalStack Pro allows to instrument your applications using [XRay](https://aws.amazon.com/xray/) tracing. This helps in optimizing the interactions between service calls, and facilitates debugging of performance bottlenecks.
## Introduction

AWS X-Ray is a distributed tracing service that helps to understand cross-service interactions and facilitates
debugging of performance bottlenecks.

LocalStack supports X-Ray via the Pro/Team offering, allowing
you to use the X-Ray APIs in your local environment.
The supported APIs are available on our [API Coverage Page](https://docs.localstack.cloud/references/coverage/coverage_xray/),
which provides information on the extent of X-Ray integration with LocalStack.

## Getting started

This guide is designed for users new to X-Ray and assumes basic
knowledge of the AWS CLI and our `awslocal` wrapper script.

// Provide a short tutorial to use the <Service Name> with AWS CLI/`awslocal`

// TODO: describe short tutorial
For example, a Python Lambda function can be instrumented as follows (based on the example [here](https://docs.aws.amazon.com/lambda/latest/dg/python-tracing.html)):

```python
Expand All @@ -28,8 +44,14 @@ def lambda_handler(event, context):

Running this code in Lambda on LocalStack will result in two trace segments being created in XRay - one from the instrumented `boto3` client when running `create_bucket(..)`, and one for the custom subsegment denoted `'my_code'`. You can use the regular XRay API calls (e.g., [`GetTraceSummaries`](https://docs.aws.amazon.com/xray/latest/api/API_GetTraceSummaries.html), [`BatchGetTraces`](https://docs.aws.amazon.com/xray/latest/api/API_BatchGetTraces.html)) to retrieve the details (timestamps, IDs, etc) of these segments.

## Examples

// share any examples for this <Service Name> across Dev Hub, Pro Samples, etc

// TODO: link to new pro sample
You can also checkout another of our examples with Xray and Lambda, deployed via the Serverless framework, [`here`](https://github.com/localstack/localstack-pro-samples/tree/master/lambda-xray)

{{< alert title="Note" >}}
To use XRay in Lambdas, please note that you'll need to configure `LAMBDA_XRAY_INIT=1` - this will ensure that the XRay daemon process is fully initialized when spawning Lambda containers (may slightly increase startup times).
{{< /alert >}}
## Limitations

LocalStack supports collecting trace segments but currently does not correlate multiple trace segments with the same
`trace_id` into a single aggregated trace.

0 comments on commit 330eddf

Please sign in to comment.