googleapis / googleapis/google-cloud-php
GAX: Debug Logging improvements
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 463
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 145
Description
A few things to keep track of for improving Debug Logging for next year:
- [ ] Remove logging of client configuration when `OperationsClient` is created by GAPIC clients (this is a tricky issue that will require some consideration)
- [ ] Create a standalone logging library (e.g. `StructuredLoggingEvent` or something similar) based on https://cloud.google.com/logging/docs/structured-logging
- [ ] Test the logging in `GrpcFallbackTransport`
- [ ] Consider logging Response Status Code ONLY when logger level is set to `INFO`
- [ ] Add back `readonly` to `RpcLogEvent::$timestamp` and `RpcLogEvent::$milliseconds` once we drop support for PHP 8.0
- [ ] Add a static method to get the `requestId` instead of repeating "`crc32((string) spl_object_id($request) . getmypid())`" every time.
- **NOTE**: There are some places which use the requestID, like `RestTransport`, which do not implement `LoggingTrait`, and so if we wanted one place for it to be generated, we would need a static method somewhere instead. Could be a private method like `LoggingTrait::getRequestId`, or a public static method such as `RpcLogEvent::getRequestId($request)`.
- [ ] Verify what types of requests/responses ClientStream/BidiStream can accept and potentially tighten the typing and/or log them (right now it only logs requests of type `Message`)
- [ ] Look into why REST JSON responses contain newlines (might be in Guzzle), and if we can strip them.
Contributor guide
Assessment
This issue has not been assessed yet.