logging

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogProcess

type LogProcess struct {
	Span opentracing.Span
	// contains filtered or unexported fields
}

LogProcess is returned from a logging function

func (*LogProcess) Finished

func (l *LogProcess) Finished()

Finished operation

func (*LogProcess) SetError

func (l *LogProcess) SetError(err error)

SetError for the current operation

func (*LogProcess) SetMetadata

func (l *LogProcess) SetMetadata(key, value string)

SetMetadata for the process

type Logger

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

func NewLogger

func NewLogger(m Metrics, l hclog.Logger, sdf tracing.SpanDetailsFunc) *Logger

func (*Logger) CallGRCPUpstream

func (l *Logger) CallGRCPUpstream(uri string, ctx opentracing.SpanContext) (*LogProcess, context.Context)

Logs data regarding upstream grpc requests returns a context containing span context for tracing

func (*Logger) CallHTTPUpstream

func (l *Logger) CallHTTPUpstream(parentRequest *http.Request, upstreamRequest *http.Request, ctx opentracing.SpanContext) *LogProcess

Logs data regarding upstream http requests

func (*Logger) CallHealthHTTP

func (l *Logger) CallHealthHTTP() *LogProcess

func (*Logger) CallReadyHTTP

func (l *Logger) CallReadyHTTP() *LogProcess

func (*Logger) HandleGRCPRequest

func (l *Logger) HandleGRCPRequest(ctx context.Context) *LogProcess

func (*Logger) HandleHTTPRequest

func (l *Logger) HandleHTTPRequest(r *http.Request) *LogProcess

HandleHTTPRequest creates the request span and timing metrics for the handler

func (*Logger) Log

func (l *Logger) Log() hclog.Logger

func (*Logger) ServiceStarted

func (l *Logger) ServiceStarted(name, upstreamURIs string, upstreamWorkers int, listenAddress string)

LogServiceStarted logs information when the service starts

func (*Logger) SleepService

func (l *Logger) SleepService(parentSpan opentracing.Span, d time.Duration) *LogProcess

Logs data about service duration simulation

type Metrics

type Metrics interface {
	Timing(name string, duration time.Duration, tags []string)
	Increment(name string, tags []string)
}

func NewStatsDMetrics

func NewStatsDMetrics(serviceName, environment, uri string) Metrics

type NullMetrics

type NullMetrics struct {
}

func (*NullMetrics) Increment

func (s *NullMetrics) Increment(name string, tags []string)

func (*NullMetrics) Timing

func (s *NullMetrics) Timing(name string, duration time.Duration, tags []string)

type StatsDMetrics

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

func (*StatsDMetrics) Increment

func (s *StatsDMetrics) Increment(name string, tags []string)

func (*StatsDMetrics) Timing

func (s *StatsDMetrics) Timing(name string, duration time.Duration, tags []string)

Jump to

Keyboard shortcuts

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