Go function runtime logging
Cloud Functions automatically captures a Go application's standard output streams and sends them to the centralized logging system available in Yandex Cloud. In addition to the application run history, the system logs request execution events.
Additional messages are logged using standard language constructs:
Println: Outputs a message to the standard output stream,
println: Outputs a message to the standard error stream,
time.Since: Returns the action duration.
Multiline messages must be separated by
\r (carriage return) and not by
\n (line feed). When using a line feed, each line is sent as a separate message and displayed separately in the log.
For more information about string formatting, see the relevant section of the documentation. Learn about the
println built-in functions here and about the
time package and its functionality here.
When handling each function call, the system logs
REPORT system messages:
START RequestID: <request ID> Version: <function version ID> END RequestID: <request ID> REPORT RequestID: <request ID> Duration: 236.606 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 22 MB Queuing Duration: 0.027 ms Function Init Duration: 225.298 ms
All lines contain the ID of the request (
RequestID), which is generated automatically when the function is invoked.
REPORT line provides a report on the function execution. It contains additional information about the resources consumed:
Duration: The time spent invoking the function. It includes the
Function Init Durationparameters.
Billed Duration: The time you're billed for in accordance with the pricing policy.
Memory Size: The amount of memory specified when creating the version, MB.
Max Memory Used: The amount of memory used at the start of the request.
Queuing Duration: The time spent by the function call request in the internal queue. If it increases, this may mean there aren't enough function instances. The maximum number of instances depends on the quotas.
Function Init Duration: The time spent initializing the runtime and loading the function code.