Get execution ID for Google Cloud Functions triggered from PubSub event
问题 For Google Cloud Functions triggered from HTTP, it is possible to retrieve the execution id by inspecting the headers of the HTTP request ( "Function-Execution-Id" ) : package p import ( "fmt" "net/http" ) func F(w http.ResponseWriter, r *http.Request) { executionID := r.Header.Get("Function-Execution-Id") fmt.Println(executionID) } However, for GCF triggered by PubSub events, I can't find how to retrieve this execution ID : package p import ( "context" ) type PubSubMessage struct { Data [