opencensus

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package opencensus provides helpers for OpenCensus instrumentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSpan

func AddSpan(ctx context.Context, attributes ...trace.Attribute) (context.Context, func(*error))

AddSpan starts OpenCensus trace span and returns updated context with callback to finish span.

Span is named by the parent function. Typically, span should be finished with deferred statement.

var err error
ctx, finish := opencensus.AddSpan(ctx,
	trace.StringAttribute("key", "value"),
)
defer finish(&err)

func Middleware

func Middleware(handler http.Handler) http.Handler

Middleware instruments router with OpenCensus metrics.

func Views

func Views() []*view.View

Views lists OpenCensus views rendered as metrics.

Types

type UseCaseMiddleware

type UseCaseMiddleware struct {
	WithInput bool
}

UseCaseMiddleware is a tracing usecase middleware.

func (UseCaseMiddleware) Wrap

Wrap makes an instrumented use case interactor.

Jump to

Keyboard shortcuts

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