xray

package
Version: v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is struct of AWS X-Ray client for tracing.

func NewClient

func NewClient(conf Config) (*Client, error)

NewClient returns initialized *Client with running background daemon sends bulk of segment data.

func (*Client) Close added in v0.1.1

func (*Client) Close()

Close is dummy method.

func (*Client) Flush added in v0.1.1

func (*Client) Flush()

Flush is dummy method.

func (*Client) NewTrace

func (c *Client) NewTrace(_ context.Context) (platform.Trace, error)

NewTrace returns initialized Trace.

type Config

type Config struct {
	// AWS setting
	AccessKey string
	SecretKey string
	Region    string
	Endpoint  string
	Filename  string
	Profile   string

	// Checkpoint setting
	CheckpointSize     int
	CheckpointInterval time.Duration

	// Sampling rates
	SamplingFraction float64
	SamplingQPS      float64
}

Config contains auth and checkpoint setting for AWS X-Ray.

func (Config) ToConfig

func (c Config) ToConfig() config.Config

ToConfig converts Config to aws-sdk-go-wrapper/config.Config.

type Span

type Span struct {
	*xray.Segment
}

Span is wrapper struct of xray.Segment.

func (*Span) CanGetSummary

func (s *Span) CanGetSummary() bool

CanGetSummary determines Span can call GetSummary().

func (*Span) Finish

func (s *Span) Finish()

Finish sends trace data to xray asynchronously.

func (*Span) FinishWait

func (s *Span) FinishWait()

FinishWait sends trace data to xray asynchronously. (dummy method for xray)

func (*Span) GetSummary

func (s *Span) GetSummary() []string

GetSummary is dummy method.

func (*Span) NewChild

func (s *Span) NewChild(name string) platform.Span

NewChild creates child span data from this Span.

func (*Span) OutputSummary

func (s *Span) OutputSummary()

OutputSummary is dummy method.

func (*Span) SetEnvironment

func (s *Span) SetEnvironment(env string) platform.Span

SetEnvironment sets environment data into span.

func (*Span) SetError

func (s *Span) SetError(err error) platform.Span

SetError sets error data into span.

func (*Span) SetLabel

func (s *Span) SetLabel(key, value string) platform.Span

SetLabel sets label data into span.

func (*Span) SetResponse

func (s *Span) SetResponse(status int) platform.Span

SetResponse sets HTTP response status into span.

func (*Span) SetSQL

func (s *Span) SetSQL(sql string) platform.Span

SetSQL sets SQL query data into span.

func (*Span) SetServiceName

func (s *Span) SetServiceName(name string) platform.Span

SetServiceName sets service name into span.

func (*Span) SetUser

func (s *Span) SetUser(user string) platform.Span

SetUser sets user's id or name data into span.

func (*Span) SetVersion

func (s *Span) SetVersion(ver string) platform.Span

SetVersion sets version data into span.

func (*Span) TraceID

func (s *Span) TraceID() string

TraceID returns TraceID of segment.

type Trace

type Trace struct {
	Trace *xray.XRay
}

Trace is wrapper struct of AWS X-Ray *xray.XRay

func (*Trace) NewSpan

func (t *Trace) NewSpan(name string) platform.Span

NewSpan returns initialized span data with name.

func (*Trace) NewSpanFromRequest

func (t *Trace) NewSpanFromRequest(r *http.Request) platform.Span

NewSpanFromRequest returns initialized span data with *http.Request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL