Closed mantism closed 1 year ago
@mantism , thank you very much for opening the issue and sorry for late response!
Indeed, documentation is confusing with respect of latency
being a string
type. Thats said, if I execute following code:
log.write(logging.entry({
httpRequest: {
requestMethod: 'GET',
requestUrl: 'http://some-url.com',
status: 200,
latency: {
seconds: 1,
nanos: 2,
},
}}, {message: "This is an info 1"}));
I see that latency generated properly in Logs Explorer:
Would you be able to share the code snippet you used to repro a problem? Thanks!
Closing this due to no response - please feel free to reactivate if there are any questions or new findings.
I want to log http requests to LogExplorer by printing LogEntry objects to stdout. This works for the most part, but I've noticed latency doesn't get automatically parsed in Log Explorer from the HttpRequest object.
The LogEntry.HttpRequest documentation lists the JSON representation as having
latency
by of typestring
, but the proto and other types for HttpRequest have latency as a Duration with seconds and nano.As a result, when logged to stdout, Log Explorer leaves the latency object in the jsonPayload field as opposed to the httpRequest field of the LogEntry.
1) Is this a client library issue or a product issue?
2) Did someone already solve this?
3) Do you have a support contract? N/A
Environment details
@google-cloud/logging
version: 10.3.2Steps to reproduce
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!