|
1 | | -# AWS X-Ray Kotlin code examples |
| 1 | +# X-Ray code examples for the SDK for Kotlin |
2 | 2 |
|
3 | | -This README discusses how to run the Kotlin code examples for AWS X-Ray. |
| 3 | +## Overview |
4 | 4 |
|
5 | | -## Running the AWS X-Ray Kotlin files |
| 5 | +Shows how to use the AWS SDK for Kotlin to work with AWS X-Ray. |
6 | 6 |
|
7 | | -**IMPORTANT** |
| 7 | +<!--custom.overview.start--> |
| 8 | +<!--custom.overview.end--> |
8 | 9 |
|
9 | | -The Kotlin code examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. |
| 10 | +_X-Ray _ |
10 | 11 |
|
11 | | -Some of these examples perform *destructive* operations on AWS resources, such as deleting an AWS X-Ray group. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. |
| 12 | +## ⚠ Important |
12 | 13 |
|
13 | | -You will find these examples: |
| 14 | +* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/). |
| 15 | +* Running the tests might result in charges to your AWS account. |
| 16 | +* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). |
| 17 | +* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). |
14 | 18 |
|
15 | | -- **CreateGroup** - Demonstrates how to create an AWS X-Ray group with a filter expression. |
16 | | -- **CreateSamplingRule** - Demonstrates how to create a rule to control sampling behavior for instrumented applications. |
17 | | -- **DeleteGroup** - Demonstrates how to delete an AWS X-Ray group. |
18 | | -- **DeleteSamplingRule** - Demonstrates how to create a rule to control sampling behavior for instrumented applications. |
19 | | -- **GetGroups** - Demonstrates how to retrieve all active group details. |
20 | | -- **GetSamplingRules** - Demonstrates how to retrieve sampling rules. |
21 | | -- **GetServiceGraph** - Demonstrates how to retrieve a document that describes services that process incoming requests. |
| 19 | +<!--custom.important.start--> |
| 20 | +<!--custom.important.end--> |
22 | 21 |
|
23 | | -To run these examples, you can setup your development environment to use Gradle to configure and build AWS SDK for Kotlin projects. For more information, |
24 | | -see [Get started with the AWS SDK for Kotlin](https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/setup.html). |
| 22 | +## Code examples |
| 23 | + |
| 24 | +### Prerequisites |
| 25 | + |
| 26 | +For prerequisites, see the [README](../../README.md#Prerequisites) in the `kotlin` folder. |
| 27 | + |
| 28 | + |
| 29 | +<!--custom.prerequisites.start--> |
| 30 | +<!--custom.prerequisites.end--> |
| 31 | + |
| 32 | +### Single actions |
| 33 | + |
| 34 | +Code excerpts that show you how to call individual service functions. |
| 35 | + |
| 36 | +- [CreateGroup](src/main/kotlin/com/kotlin/xray/CreateGroup.kt#L39) |
| 37 | +- [CreateSamplingRule](src/main/kotlin/com/kotlin/xray/CreateSamplingRule.kt#L41) |
| 38 | +- [DeleteGroup](src/main/kotlin/com/kotlin/xray/DeleteGroup.kt#L39) |
| 39 | +- [DeleteSamplingRule](src/main/kotlin/com/kotlin/xray/DeleteSamplingRule.kt#L39) |
| 40 | +- [GetGroups](src/main/kotlin/com/kotlin/xray/GetGroups.kt#L22) |
| 41 | +- [GetSamplingRules](src/main/kotlin/com/kotlin/xray/GetSamplingRules.kt#L22) |
| 42 | +- [GetServiceGraph](src/main/kotlin/com/kotlin/xray/GetServiceGraph.kt#L39) |
| 43 | + |
| 44 | + |
| 45 | +<!--custom.examples.start--> |
| 46 | +<!--custom.examples.end--> |
| 47 | + |
| 48 | +## Run the examples |
| 49 | + |
| 50 | +### Instructions |
| 51 | + |
| 52 | + |
| 53 | +<!--custom.instructions.start--> |
| 54 | +<!--custom.instructions.end--> |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +### Tests |
| 59 | + |
| 60 | +⚠ Running tests might result in charges to your AWS account. |
| 61 | + |
| 62 | + |
| 63 | +To find instructions for running these tests, see the [README](../../README.md#Tests) |
| 64 | +in the `kotlin` folder. |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +<!--custom.tests.start--> |
| 69 | +<!--custom.tests.end--> |
| 70 | + |
| 71 | +## Additional resources |
| 72 | + |
| 73 | +- [X-Ray Developer Guide](https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html) |
| 74 | +- [X-Ray API Reference](https://docs.aws.amazon.com/xray/latest/api/Welcome.html) |
| 75 | +- [SDK for Kotlin X-Ray reference](https://sdk.amazonaws.com/kotlin/api/latest/xray/index.html) |
| 76 | + |
| 77 | +<!--custom.resources.start--> |
| 78 | +<!--custom.resources.end--> |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 83 | + |
| 84 | +SPDX-License-Identifier: Apache-2.0 |
0 commit comments