Skip to content

Instantly share code, notes, and snippets.

@vinoaj
Last active March 14, 2019 22:57
Show Gist options
  • Save vinoaj/4fe72ce14b6d84365d31c1c595ff0243 to your computer and use it in GitHub Desktop.
Save vinoaj/4fe72ce14b6d84365d31c1c595ff0243 to your computer and use it in GitHub Desktop.
SELECT
labels.execution_id
, timestamp
, CAST(REGEXP_EXTRACT(textPayload, r"\d+") AS INT64) as runtime
FROM `<dataset_id>.logging.cloudfunctions_googleapis_com_cloud_functions_*`
WHERE _TABLE_SUFFIX BETWEEN '20190101' AND '20190315'
AND resource.labels.function_name = "<function_name>"
AND REGEXP_CONTAINS(textPayload, r"^Function execution took \d+ ms.*")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment