trace

package module
v0.0.0-...-4a8f52d Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2017 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package trace defines common-use Dapper-style tracing APIs for the Go programming language.

Example
package main

import (
	"fmt"
	"time"

	"github.com/rakyll/trace"
)

func main() {
	trace.Start(func(s *trace.Span) {
		fmt.Printf("recorded span: %v\n", s)
	})

	s := trace.NewSpan("/foo")
	time.Sleep(time.Second)
	s.End()

	time.Sleep(time.Second)
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, span *Span) context.Context

func Start

func Start(fn func(s *Span))

func Stop

func Stop()

Types

type Span

type Span struct {
	TraceID  []byte
	ParentID []byte
	ID       []byte

	Name      string
	StartTime time.Time
	EndTime   time.Time
	// contains filtered or unexported fields
}

func FromContext

func FromContext(ctx context.Context) *Span

func NewSpan

func NewSpan(name string) *Span

func (*Span) End

func (s *Span) End()

func (*Span) ForLabels

func (s *Span) ForLabels(f func(key, value string))

func (*Span) NewChild

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

func (*Span) SetLabels

func (s *Span) SetLabels(args ...string)

Directories

Path Synopsis
Package gcp contains a Google Cloud Platform-specific implementation of the generic tracing APIs.
Package gcp contains a Google Cloud Platform-specific implementation of the generic tracing APIs.
Package minitrace contains primitives to support propagation of tracing information.
Package minitrace contains primitives to support propagation of tracing information.

Jump to

Keyboard shortcuts

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