zerologgcloud

package
v0.0.0-...-bb2e6d5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequestLoggingHandler

func NewRequestLoggingHandler() func(http.Handler) http.Handler

func SetCloudLoggingFieldFormat

func SetCloudLoggingFieldFormat()

SetCloudLoggingFieldFormat sets zerolog field names that are compatible with the Cloud Logging format.

func WithCloudLoggingSpanContext

func WithCloudLoggingSpanContext(ctx context.Context, projectID string) context.Context

WithCloudLoggingSpanContext retrieves a span context using OpenTelemetry API and initialize context sub logger. Sub logger has two fields that are compatible with the Cloud Logging format.

Types

type SpanContextConnectInterceptor

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

SpanContextConnectInterceptor is a connect-go interceptor which sets zerolog sub logger into context.Context.

func NewCloudLoggingTraceContextInterceptor

func NewCloudLoggingTraceContextInterceptor(googleCloudProjectID string) *SpanContextConnectInterceptor

NewCloudLoggingTraceContextInterceptor initializes a pointer of SpanContextConnectInterceptor.

func (*SpanContextConnectInterceptor) WrapStreamingClient

func (i *SpanContextConnectInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc

func (*SpanContextConnectInterceptor) WrapStreamingHandler

func (i *SpanContextConnectInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc

func (*SpanContextConnectInterceptor) WrapUnary

func (i *SpanContextConnectInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc

Jump to

Keyboard shortcuts

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