Documentation ¶
Overview ¶
Package aws implements an AWS session wrapper, causing requests and responses to be traced.
The injected handler will create a new span with a name based on the called AWS service and operation. The span's status will be set based on the AWS response and include the following attributes:
- aws.user_agent
- aws.request.operation
- aws.request.service
- aws.request.region
- aws.request.method
- aws.request.url
- aws.response.status_code
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapSession ¶
WrapSession wraps an AWS Session, causing requests and responses to be traced.
Example ¶
To start tracing requests, wrap the AWS session.Session by invoking WrapSession.
package main import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" aws_trace "github.com/lonnblad/go-oc-aws-tracing" ) func main() { cfg := aws.NewConfig().WithRegion("us-west-2") sess := session.Must(session.NewSession(cfg)) sess = aws_trace.WrapSession(sess) s3api := s3.New(sess) // nolint:errcheck s3api.CreateBucket(&s3.CreateBucketInput{ Bucket: aws.String("some-bucket-name"), }) }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.