Google Certified Professional Data Engineer

Sign Up Free or Log In to participate!

How to find more detailed log for the gcp functions

When I am doing the lab5.6, it took me a long time to figure out the typo error which cause the function crush

I tried to read the function log, but the following is what I get, not very informative. Wondering if we can get a crush stack log for me to find out the bug easier.

{

insertId: "000000-e410caa4-0287-4e3f-b80d-c215e06a5430"

labels: {

execution_id: "pbc4oxnzl1ji"

}

logName: "projects/sturdy-hangar-276710/logs/cloudfunctions.googleapis.com%2Fcloud-functions"

receiveTimestamp: "2020-07-04T07:01:52.837476035Z"

resource: {

labels: {

function_name: "gen_thumbnail"

project_id: "sturdy-hangar-276710"

region: "us-central1"

}

type: "cloud_function"

}

severity: "DEBUG"

textPayload: "Function execution took 91 ms, finished with status: ‘crash’"

timestamp: "2020-07-04T07:01:51.834276757Z"

trace: "projects/sturdy-hangar-276710/traces/1bbc73e71f5057d38ecb65be525b233b"

}

1 Answers

Hi Ron

If I was writing a Cloud Function for production use, I would probably include the Stackdriver Error Reporting client libraries to give me more information if things went wrong (see https://cloud.google.com/functions/docs/monitoring/error-reporting).

But this is just a demo function for a lab 🙂

Cheers

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?