> For the complete documentation index, see [llms.txt](https://archivedocs.stackstate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://archivedocs.stackstate.com/5.1/stackpacks/integrations/aws/aws-x-ray.md).

# AWS X-ray

## Overview

AWS X-Ray is a service that collects data about requests that your application serves, and provides tools you can use to view, filter, and gain insights into that data to identify issues, and opportunities for optimization.

AWS services integrate with AWS X-Ray by adding a tracing header to requests, running the X-Ray daemon, or making sampling decisions, and uploading trace data to X-Ray. The X-Ray SDKs include plugins for additional integration with AWS services.

AWS X-ray is a [StackState core integration](/5.1/stackpacks/integrations/about_integrations.md#stackstate-core-integrations).

## Functionality

The StackState AWS X-Ray integration provides the following functionality:

* Enriches AWS components with X-Ray trace service data.
* Allows mapping the relations between X-Ray services, and ultimately AWS resources.
* Provides performance metrics on relations between X-Ray services, as well as local anomaly detection on all performance metrics.

## Setup

To get X-Ray traces you need to attach policy **AWSXrayFullAccess** to the AWS service roles in the IAM console. Check [AWS X-Ray Developer guide](https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html) for more information about setting up X-Ray.

### Installation

The AWS X-Ray check is included in the [Agent V2 StackPack](/5.1/stackpacks/integrations/agent.md). You also need to install [AWS StackPack](/5.1/stackpacks/integrations/aws/aws.md) to see rest of you AWS topology and metrics.

### Configuration

1. Edit the `aws_xray.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your Tomcat metrics and logs. See the sample `aws_xray.d/conf.yaml.example` for all available configuration options.

   ```
   # Section used for global AWS check config
   init_config:
       # optional
       # cache_file: '/opt/stackstate-agent/tmp'

   instances:
     # mandatory AWS credentials and config
     - aws_access_key_id: 'abc'
       aws_secret_access_key: 'cde'
       role_arn: 'arn:aws:iam::0123456789:role/RoleName'
       region: 'ijk'
       # optional
       # min_collection_interval: 60 # use in place of collection_interval for Agent V2.14.x or earlier  
       # collection_interval: 60
   ```
2. Restart the Agent.

Need help? Please contact [StackState support](http://support.stackstate.com/).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://archivedocs.stackstate.com/5.1/stackpacks/integrations/aws/aws-x-ray.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
