requestcheck

package
v0.0.0-...-8702c58 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package requestcheck has protobuf logging functions.

Currently this only has a set of grpc interceptors which will log when the client populates deprecated fields (i.e. fields in the request proto which were marked with the field option `[deprecated = true]`).

The implementation uses the go.chromium.org/luci/common/proto/protowalk library, so in the average case this will only touch O(F) fields in the message where F are fields marked as deprecated. This means that the per-request overhead for request messages with no deprecated field option is ~zero.

To further cut down on spam, this is also rate-limits the deprecated field detection to no more than once per 10s, per (user agent x request type). This rate limit only applies to this process, though, so if your service has many different processes you may see a burst of logged warnings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeprecationLoggerInterceptors

func DeprecationLoggerInterceptors(ctx context.Context, serviceDescs []*grpc.ServiceDesc) (grpc.UnaryServerInterceptor, grpc.StreamServerInterceptor)

DeprecationLoggerInterceptors returns a pair of unary and stream interceptors which will walk all incoming request protos and log (in a rate limited way) when incoming requests have non-default values for fields marked with the `deprecated = true` field option.

Types

This section is empty.

Directories

Path Synopsis
Package testproto holds some non-production protos for testing `requestcheck`.
Package testproto holds some non-production protos for testing `requestcheck`.

Jump to

Keyboard shortcuts

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