You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adds custom durationFieldFunc to request/response log entries (#670)
the request and response log messages include a duration string,
but does not make use of the `durationFieldFunc` like other
parts of the request lifecycle.
The `durationFieldFunc` function is useful when conducting log analysis
with log aggregator tools out there, because it normalizes the value
to a number that can be filtered by or compared to. For example,
a GCP Log Explorer does not support converting log field types like
a duration to an integer, so you cannot run queries like "give me
all logs that took more than 50ms" because it would be interpreted
as a string comparison. This makes very tedious to audit application logs
that log API calls using this gRPC middleware.
The perhaps controversial part of this change is that request/response
logs have a different naming convention for the duration. I personally
don't find use for a different field name - grpc.time and grpc.time_ms
would seem expressive enough to support the 4 logged entries, but maybe
I'm missing something here. I would suggest to rename those fields as well,
but I understand that may be a "breaking change", if we consider the log fields
a contract.
0 commit comments