envoy
envoy copied to clipboard
OTel AccessLogger: support log_written/dropped for OTel partial rejected log records
This PR makes the OTel access logger to support log_written/log_dropped tracking
- failed gRPC requests
- partial rejected log entries, which is supported by OTel protocol
Context:
- After https://github.com/envoyproxy/envoy/pull/24268, OTel AccessLogger uses unary async client.
- The current
log_written/log_droppedtracked in GrpcAccessLogger doesn't make sense for unary gRPC client, which always increment log_written for each incoming log entry. It couldn't record the 2 cases mentioned above.
What this PR contains:
- move grpc access loggers clients to a new file and make them DI for GrpcAccessLogger
- for unary async case, move
log_written/log_droppedfrom GrpcAccessLogger to OpenTelemetry::GrpcAccessLoggerImpl while no changes for streaming case. - add an AsyncUnaryRequestCallbacks so that it can record the number of log entries on the fly and record correctly in the callback
could you take a look at the format error please @TAOXUY
ERROR: ./source/extensions/access_loggers/common/grpc_access_logger.h:108: Don't use std::optional; use absl::optional instead
https://dev.azure.com/cncf/envoy/_build/results?buildId=170151&view=logs&j=c7de00aa-b0fb-52ba-707b-da6afd918eda&t=449299ab-9da3-5c6b-afe3-e0c5dbf1dfd1&l=58
could you take a look at the format error please @TAOXUY
ERROR: ./source/extensions/access_loggers/common/grpc_access_logger.h:108: Don't use std::optional; use absl::optional insteadhttps://dev.azure.com/cncf/envoy/_build/results?buildId=170151&view=logs&j=c7de00aa-b0fb-52ba-707b-da6afd918eda&t=449299ab-9da3-5c6b-afe3-e0c5dbf1dfd1&l=58
Done. Thank!
/wait-any
The change does not build: https://source.cloud.google.com/results/invocations/53d8338b-909c-4f57-b0d7-e4bfd267524c
/wait
Details
Fixed.