MCPcopy
hub / github.com/grafana/dskit / ShouldLog

Method ShouldLog

middleware/grpc_logging.go:34–34  ·  view source on GitHub ↗

ShouldLog returns whether the error should be logged and the reason. For example, if the error should be sampled return returned reason could be something like "sampled 1/10". The reason, if any, is used to decorate the error both in case the error should be logged or skipped.

(ctx context.Context)

Source from the content-addressed store, hash-verified

32 // return returned reason could be something like "sampled 1/10". The reason, if any, is used to decorate the error
33 // both in case the error should be logged or skipped.
34 ShouldLog(ctx context.Context) (bool, string)
35}
36
37type DoNotLogError struct{ Err error }

Callers 2

shouldLogFunction · 0.95

Implementers 2

DoNotLogErrormiddleware/grpc_logging.go
sampledErrormiddleware/grpc_logging_test.go

Calls

no outgoing calls

Tested by 1