cloudflare / cloudflare/cloudflare-gcp
Enhance Cloud Function to send logs to Stackdriver
- 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.:

Please let me know of your thoughts on this, and maybe we can help with the implementation.
Contributor guide
Assessment
This issue has not been assessed yet.