telemetry

package
v0.2.34 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

func Initialize

func Initialize(version string, logger *zap.SugaredLogger)

func InitializeIfNeeded

func InitializeIfNeeded(enabled bool, version string, logger *zap.SugaredLogger) bool

func LoggerFor

func LoggerFor(logger *zap.SugaredLogger, span *Span) *zap.SugaredLogger

func RunProcess added in v0.2.30

func RunProcess(ctx context.Context, cmd string, path string, in io.Reader, out io.Writer, er io.Writer, logger *zap.SugaredLogger) (int, error)

func RunProcessSimple added in v0.2.30

func RunProcessSimple(ctx context.Context, cmd string, path string, logger *zap.SugaredLogger) (int, string, error)

func WrapHTTPClient

func WrapHTTPClient(cl *http.Client) *http.Client

Types

type Attribute

type Attribute struct {
	Key   string `json:"key"`
	Value any    `json:"value"`
}

func (*Attribute) ToOT

func (a *Attribute) ToOT() attribute.KeyValue

type ErrHandler

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

func (*ErrHandler) Handle

func (e *ErrHandler) Handle(err error)

type Span

type Span struct {
	OT trace.Span
	// contains filtered or unexported fields
}

func StartAsyncSpan

func StartAsyncSpan(ctx context.Context, spanName string, logger *zap.SugaredLogger, opts ...any) (context.Context, *Span, *zap.SugaredLogger)

func StartSpan

func StartSpan(ctx context.Context, spanName string, logger *zap.SugaredLogger, opts ...any) (context.Context, *Span, *zap.SugaredLogger)

func (*Span) Attribute

func (s *Span) Attribute(k string, v any)

func (*Span) Attributes

func (s *Span) Attributes(attrs ...*Attribute)

func (*Span) Complete

func (s *Span) Complete()

Complete must be called, usually through a `defer` block.

func (*Span) Event

func (s *Span) Event(name string, attrs ...*Attribute)

func (*Span) OnError

func (s *Span) OnError(err error)

func (*Span) SetHTTPStatus

func (s *Span) SetHTTPStatus(code int)

func (*Span) SetName

func (s *Span) SetName(name string)

func (*Span) SetStatus

func (s *Span) SetStatus(status string, description string)

func (*Span) SpanID

func (s *Span) SpanID() string

func (*Span) String

func (s *Span) String() string

func (*Span) TraceID

func (s *Span) TraceID() string

Directories

Path Synopsis
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.

Jump to

Keyboard shortcuts

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