|
1 | 1 | [](https://travis-ci.org/aws/aws-xray-sdk-go)
|
2 | 2 |
|
3 |
| -# AWS X-Ray SDK for Go <sup><sup><sup>(RC)</sup></sup></sup> |
| 3 | +# AWS X-Ray SDK for Go |
4 | 4 |
|
5 | 5 | 
|
6 | 6 |
|
@@ -29,15 +29,19 @@ go get -u -t github.com/aws/aws-xray-sdk-go/...
|
29 | 29 |
|
30 | 30 | ## Installing using Go Modules
|
31 | 31 |
|
32 |
| -The X-Ray SDK for Go is currently in release candidate (RC) stage. The latest RC of the SDK is the recommended version and will be supported before the GA release of v1, which is tracked in this [issue](https://github.com/aws/aws-xray-sdk-go/issues/205). |
| 32 | +The latest version of the SDK is the recommended version. |
33 | 33 |
|
34 |
| -If you are using Go 1.11 and above, you can install the SDK using Go Modules. You must specify the latest RC version when installing the SDK, like so: |
| 34 | +If you are using Go 1.11 and above, you can install the SDK using Go Modules (in project's go.mod), like so: |
35 | 35 |
|
36 | 36 | ```
|
37 |
| -go get github.com/aws/aws-xray-sdk-go@v1.0.0-rc.15 |
| 37 | +go get github.com/aws/aws-xray-sdk-go |
38 | 38 | ```
|
39 | 39 |
|
40 |
| -To get a different specific release version of the SDK use `@<tag>` in your `go get` command. |
| 40 | +To get a different specific release version of the SDK use `@<tag>` in your `go get` command. Also, to get the rc version use this command with the specific version. |
| 41 | + |
| 42 | +``` |
| 43 | +go get github.com/aws/[email protected] |
| 44 | +``` |
41 | 45 |
|
42 | 46 | ## Installing using Dep
|
43 | 47 | If you are using Go 1.9 and above, you can also use [Dep](https://github.com/golang/dep) to add the SDK to your application's dependencies.
|
@@ -67,22 +71,14 @@ The GitHub issues are intended for bug reports and feature requests. For help an
|
67 | 71 |
|
68 | 72 | The [developer guide](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go.html) provides in-depth guidance on using the AWS X-Ray service and the AWS X-Ray SDK for Go.
|
69 | 73 |
|
| 74 | +See [aws-xray-sdk-go-sample](https://github.com/aws-samples/aws-xray-sdk-go-sample) for a sample application that provides example of tracing SQL queries, incoming and outgoing request. Follow [README instructions](https://github.com/aws-samples/aws-xray-sdk-go-sample/blob/master/README.md) in that repository to get started with sample application. |
| 75 | + |
70 | 76 | ## Quick Start
|
71 | 77 |
|
72 | 78 | **Configuration**
|
73 | 79 |
|
74 | 80 | ```go
|
75 |
| -import ( |
76 |
| - "context" |
77 |
| - |
78 |
| - "github.com/aws/aws-xray-sdk-go/xray" |
79 |
| - |
80 |
| - // Importing the plugins enables collection of AWS resource information at runtime. |
81 |
| - // Every plugin should be imported after "github.com/aws/aws-xray-sdk-go/xray" library. |
82 |
| - _ "github.com/aws/aws-xray-sdk-go/plugins/ec2" |
83 |
| - _ "github.com/aws/aws-xray-sdk-go/plugins/beanstalk" |
84 |
| - _ "github.com/aws/aws-xray-sdk-go/plugins/ecs" |
85 |
| -) |
| 81 | +import "github.com/aws/aws-xray-sdk-go/xray" |
86 | 82 |
|
87 | 83 | func init() {
|
88 | 84 | xray.Configure(xray.Config{
|
@@ -226,6 +222,7 @@ func main() {
|
226 | 222 | row, err := db.QueryRowContext(ctx, "SELECT 1") // Use as normal
|
227 | 223 | }
|
228 | 224 | ```
|
| 225 | + |
229 | 226 | **Lambda**
|
230 | 227 |
|
231 | 228 | ```
|
@@ -260,7 +257,7 @@ func HandleRequest(ctx context.Context, name string) (string, error) {
|
260 | 257 | _, subseg := xray.BeginSubsegment(ctx, "subsegment-name")
|
261 | 258 | subseg.Close(nil)
|
262 | 259 |
|
263 |
| - db := xray.SQL("postgres", "postgres://user:password@host:port/db") |
| 260 | + db := xray.SQLContext("postgres", "postgres://user:password@host:port/db") |
264 | 261 | row, _ := db.QueryRow(ctx, "SELECT 1")
|
265 | 262 |
|
266 | 263 | return fmt.Sprintf("Hello %s!", name), nil
|
|
0 commit comments