gostellar

package module
v0.0.0-...-a82c2c7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 16 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCollectorDir

func CheckCollectorDir(path string) error

func ClearDir

func ClearDir(dir string) error

func CollectTraces

func CollectTraces(ctx context.Context, path string) chan interface{}

func Log

func Log(data []byte, traceid, spanid string) error

func NewTracedContext

func NewTracedContext(ctx context.Context, span Spanner) context.Context

func NewTracedGRPCContext

func NewTracedGRPCContext(ctx context.Context, span Spanner) context.Context

func NewTracedRequest

func NewTracedRequest(method, url string, body io.Reader, span Spanner) (*http.Request, error)

func TracedRequest

func TracedRequest(r *http.Request, span Spanner) *http.Request

func TracedResponse

func TracedResponse(w http.ResponseWriter, span Spanner) http.ResponseWriter

Types

type Collector

type Collector interface {
	Collect(data []*sPb.Span)
}

type Deamon

type Deamon struct {
	Path string
	// contains filtered or unexported fields
}

func InitCollector

func InitCollector(path string, c Collector) (*Deamon, error)

func (*Deamon) Start

func (dc *Deamon) Start(ctx context.Context, t time.Duration)

type KV

type KV struct {
	Key   string
	Value string
}

type NatsCollector

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

func NewCollector

func NewCollector(address, topic string) (*NatsCollector, error)

func (NatsCollector) Collect

func (n NatsCollector) Collect(data []*sPb.Span)

type Scanner

type Scanner interface {
	Start(ctx context.Context, t time.Duration)
}

type Span

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

func InitSpan

func InitSpan(c *SpanContext, name string) *Span

func (Span) AddBaggage

func (s Span) AddBaggage(kvs ...*KV)

func (*Span) AddLog

func (s *Span) AddLog(kvs ...*KV)

func (*Span) AddTag

func (s *Span) AddTag(kvs ...*KV)

func (*Span) Child

func (s *Span) Child(name string) *Span

func (*Span) EndTime

func (s *Span) EndTime()

func (*Span) Finish

func (s *Span) Finish()

func (*Span) Marshall

func (s *Span) Marshall() ([]byte, error)

func (*Span) Serialize

func (span *Span) Serialize() *Values

func (*Span) StartTime

func (s *Span) StartTime()

func (*Span) String

func (s *Span) String() string

type SpanContext

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

func NewSpanContext

func NewSpanContext(tid, pid string) *SpanContext

func (*SpanContext) String

func (s *SpanContext) String() string

type Spanner

type Spanner interface {
	Child(name string) *Span
	AddLog(kvs ...*KV)
	AddTag(kvs ...*KV)
	AddBaggage(kvs ...*KV)
	StartTime()
	EndTime()
	Finish() // send data to collector and maybe serialize to ctx ot request
	Serialize() *Values
	Marshall() ([]byte, error)
}

func FromContext

func FromContext(ctx context.Context, name string) (Spanner, error)

func FromCustomSource

func FromCustomSource(ctx *sPb.SpanContext, tags map[string]string, name string) (Spanner, error)

func FromGRPCContext

func FromGRPCContext(ctx context.Context, name string) (Spanner, error)

func FromRequest

func FromRequest(r *http.Request, name string) (Spanner, error)

func FromResponse

func FromResponse(w http.ResponseWriter, name string) (Spanner, error)

type Trace

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

func Init

func Init(name string) *Trace

func (*Trace) Finish

func (t *Trace) Finish()

func (*Trace) Span

func (t *Trace) Span(name string) *Span

func (*Trace) String

func (t *Trace) String() string

type Tracer

type Tracer interface {
	Span(name string) Spanner
	Finish()
}

type Values

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

func (Values) Get

func (v Values) Get(key string) []string

Jump to

Keyboard shortcuts

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