cloudflare / cloudflare/cloudflare-gcp

Enhance Cloud Function to send logs to Stackdriver

Open
#24 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
88
Forks
51
PR merge metrics
No merged PRs in 30d

Description

Currently the Cloud Function that is created writes the logs directly to BigQuery. This is very useful for being able to analyse the logs and visualise them using Data Studio.

One enhancement that could be made to the function would be to provide the ability (e.g. via an environment variable for example) to push the logs to Stackdriver as well, using the [Stackdriver NodeJS SDK](https://github.com/googleapis/nodejs-logging). This will provide the ability to search for logs in Stackdriver directly, which can be more cost-effective, especially when the log size increases (resulting in BigQuery analysis cost increase). By also setting the [`httpRequest` field](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest), the logs can show up in a more useful manner, e.g.:

Screenshot 2019-10-23 at 11 17 35

Please let me know of your thoughts on this, and maybe we can help with the implementation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.