google-cloud-stackdriver

Can the “initialData” property be used to write App Script parameters to a Stackdriver message?

风流意气都作罢 提交于 2021-02-10 03:31:05
问题 Summary Google suggests that App Script parameters (among other data) can be written to Stackdriver using a JSON object with a "initialData" property. But it doesn't seem to work. Issue Example This Google page contains an example function that illustrates the different ways information can be written to Stackdriver. An extract from their own code is below: var parameters = { isValid: true, content: 'some string', timestamp: new Date() }; console.log({message: 'Function Input', initialData:

Can the “initialData” property be used to write App Script parameters to a Stackdriver message?

淺唱寂寞╮ 提交于 2021-02-10 03:27:23
问题 Summary Google suggests that App Script parameters (among other data) can be written to Stackdriver using a JSON object with a "initialData" property. But it doesn't seem to work. Issue Example This Google page contains an example function that illustrates the different ways information can be written to Stackdriver. An extract from their own code is below: var parameters = { isValid: true, content: 'some string', timestamp: new Date() }; console.log({message: 'Function Input', initialData:

How to log Stackdriver log messages correlated by trace id using stdout Go 1.11

邮差的信 提交于 2021-02-06 11:57:10
问题 I'm using Google App Engine Standard Environment with the Go 1.11 runtime. The documentation for Go 1.11 says "Write your application logs using stdout for output and stderr for errors". The migration from Go 1.9 guide also suggests not calling the Google Cloud Logging library directly but instead logging via stdout. https://cloud.google.com/appengine/docs/standard/go111/writing-application-logs With this in mind, I've written a small HTTP Service (code below) to experiment logging to

How to log Stackdriver log messages correlated by trace id using stdout Go 1.11

≡放荡痞女 提交于 2021-02-06 11:56:08
问题 I'm using Google App Engine Standard Environment with the Go 1.11 runtime. The documentation for Go 1.11 says "Write your application logs using stdout for output and stderr for errors". The migration from Go 1.9 guide also suggests not calling the Google Cloud Logging library directly but instead logging via stdout. https://cloud.google.com/appengine/docs/standard/go111/writing-application-logs With this in mind, I've written a small HTTP Service (code below) to experiment logging to

GCE RAM and CPU usage in BigQuery

别等时光非礼了梦想. 提交于 2021-01-29 06:07:57
问题 Is there a way to export Google Compute Engine instances logs into BigQuery which will allow you to query the exported logs to get CPU and RAM usage for a selected period using the instance label? I reviewed already the Default Logging Agent logs doc which shows what Stackdriver Logging collects but RAM and CPU usage isn't mentioned. I also found this Viewing Activity Logs and Exporting with the Logs Viewer but none of them are relevant to my need. Thanks in advance 回答1: Stackdriver has some

GCP stackdriver logging logs format changed in bucket from folder per container to stdout\stderr

こ雲淡風輕ζ 提交于 2021-01-28 09:16:13
问题 i have a question, similar as describe here: GKE kubernetes container stdout logs format changed in old version of stackdriver i had 1 sink with filter like this: resource.type=container, resource.namespace_id=[NAMESPACE_NAME] resource.pod_id=[POD_NAME] and logs was stored in bucket pretty well, like this: logName=projects/[PROJECT-NAME]/logs/[CONTAINER-NAME] ...so i had folders whith logs for each container. But now i updated my stackdriver logging+monitoring to last version and now i have 2

Export custom collectd PostgreSQL metrics to GCP Stackdriver Monitoring

江枫思渺然 提交于 2021-01-27 17:48:44
问题 Background I'm trying to export PostgreSQL replication delay by adding a custom <Query> statement to my PostgreSQL config (original config from Stackdriver PostgreSQL Plugin) in stackdriver-agents collectd configuration directory. /opt/stackdriver/collectd/etc/postgresql.conf : # This is the monitoring configuration for PostgreSQL. # Make sure the statistics collector is enabled in your PostgreSQL configuration. # NOTE: This configuration needs to be hand-edited in order to work. # Look for

Using Nlog to write structured logs to Google Stackdriver

有些话、适合烂在心里 提交于 2021-01-27 15:04:26
问题 I'm using the Google.Cloud.Logging.NLog target to write logs to Stackdriver. I'd like to use Nlog & Stackdriver structured logging capabilities by sending a JSON payload as per the Stackdriver documentation: Logs are coming through but I don't seem to be populating the jsonPayload property in the logs, which will mean that I'm not sending a JSON payload. Do I need to configure a JsonLayout for every type of log message stated below? Target code GoogleStackdriverTarget googleTarget = new

Plain console.warn() shows up in logs with serverity “ERROR”

大城市里の小女人 提交于 2021-01-27 07:03:39
问题 When I log something with console.warn() it seems to appear in the Stackdriver logs with severity "ERROR". The Stackdriver Error Reporting does not show these errors, so it seems there they are not considered errors. This makes it impossible to filter the logs to only show me errors. Reading the Stackdriver logging docs I get the impression that I'm not supposed to use the plain javascript console functions but instead use Bunyan. Is that correct? I didn't read anywhere that I shouldn't. 回答1:

Plain console.warn() shows up in logs with serverity “ERROR”

孤人 提交于 2021-01-27 07:00:40
问题 When I log something with console.warn() it seems to appear in the Stackdriver logs with severity "ERROR". The Stackdriver Error Reporting does not show these errors, so it seems there they are not considered errors. This makes it impossible to filter the logs to only show me errors. Reading the Stackdriver logging docs I get the impression that I'm not supposed to use the plain javascript console functions but instead use Bunyan. Is that correct? I didn't read anywhere that I shouldn't. 回答1: