otaws

package module
v0.0.0-...-56bd80c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 11

README

Build Status GoDoc Apache-2.0 license

OpenTracing support for AWS SDK in Go

The otaws package makes it easy to add OpenTracing support for AWS SDK in Go.

Installation

go get github.com/opentracing-contrib/go-aws-sdk

Documentation

See the basic usage examples below and the package documentation on godoc.org.

Usage

// You must have some sort of OpenTracing Tracer instance on hand
var tracer opentracing.Tracer = ...

// Optionally set Tracer as global 
opentracing.SetGlobalTracer(tracer)

// Create AWS Session
sess := session.NewSession(...)

// Create AWS service client e.g. DynamoDB client
dbCient := dynamodb.New(sess)

// Add OpenTracing handlers using global tracer
AddOTHandlers(dbClient.Client)

// Or specify tracer explicitly
AddOTHandlers(dbClient.Client, WithTracer(tracer))

// Call AWS client
result, err := dbClient.ListTables(&dynamodb.ListTablesInput{})

License

Apache 2.0 License.

Documentation

Overview

Package otaws provides OpenTracing support for AWS SDK.

See the README for simple usage examples: https://github.com/opentracing-contrib/go-aws/README.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOTHandlers

func AddOTHandlers(cl *client.Client, opts ...Option)

Types

type Option

type Option func(*config)

func WithTracer

func WithTracer(tracer opentracing.Tracer) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL