stackdriver

Is it possible to trigger notification (e.g.- for HTTP 500) from Stackdriver log/monitoring?

隐身守侯 提交于 2019-12-11 17:35:28
问题 I have set up Stackdriver logging agents on Google Compute Engine VMs, and collecting logs from apache and some other sources. Is it possible to trigger a notification when a http 500 log is produced? If parsing textPayload for notification is not an option, can it be done by modifying the fluentid configs to send in a specific label when it uploads a matching log? 回答1: I think that a logging metric is your best bet. https://cloud.google.com/logging/docs/logs-based-metrics/charts-and-alerts

Use Stackdriver Debug with Google Cloud Functions

允我心安 提交于 2019-12-11 17:04:24
问题 There is a similar question regarding Debugging Firebase Cloud Functions using Stackdriver. The answer there, however, doesn't seem to help at all with getting Stackdriver Debug to work with my normal Cloud Function (not Firebase). I've tried sourcing the code from Github and a Cloud Source Repository - but that doesn't seem to work. Both times I get in the side bar: This project does not include any running applications. The documentation about debugging Cloud Functions seems to say nothing

StackDriver alert when there's no data

元气小坏坏 提交于 2019-12-11 16:46:08
问题 I've set up an alerting policy in StackDriver on the "instance/uptime" metrics. To alert when it's less 1 for 1 minute. Then I deleted the instance, and had no alerts. Is it so because at the following time window the data isn't 0 rather none, so no alerts are sent? 回答1: I reproduced your situation If the instance is deleted, there's no alerts being generated, this is expected behavior since the resource (VM) doesn't exist anymore. Uptime alerts are generated when only VM instances are up and

Using google cloud trace API

孤人 提交于 2019-12-11 12:22:07
问题 I am attempting to use the grpc client for the Stackdriver/google cloud trace definition at https://github.com/googleapis/googleapis/blob/master/google/devtools/cloudtrace/v1/trace.proto I am sending the protobuf for the traces { traces { project_id: "brightcove-rna-master" trace_id: "A096D4956A424EEB98AE7863505B1E1F" spans { span_id: 1 kind: RPC_CLIENT name: "/bigtableAapiGrpcstaging_aggregated/queryDataSetInternal/buildScan" start_time { seconds: 1459230665 nanos: 705000000 } end_time {

Tagging proper GCE Instance name in Stackdriver logging

非 Y 不嫁゛ 提交于 2019-12-11 05:49:00
问题 I am using Google Compute Engine Instance running on Debian for running a service written in Node.js. For logging purpose, I am using Stackdriver logging. The logs are getting generated, however, The log entries are not getting filtered under proper GCE Instance name. Here's how the resource flags are in a log entry resource: { labels: { instance_id: "6000000000000000000" //A numeric id project_id: "my-project" zone: "" } type: "gce_instance" } The instance id is getting generated as a

What is the difference between _A0 & _S0 log files when storing Google App Engine Standard logs in GCS

霸气de小男生 提交于 2019-12-11 04:57:06
问题 I have turned on the switch to send the logs of a GAE Standard app to a GCS bucket. I see there as expected a folder for each day. For every hour of every days I see a very big json file with the extension _S0.json. For some hours I also see a much smaller file with the extension _A0:.json. For instance: 01:00:00_01:59:59_S0.json & 01:00:00_01:59:59_A0:4679580000.json What is the difference, I am trying to post process the files and need to know. 回答1: Logs exported to GCS are sharded, the _A0

perform arithmetic on stack driver metrics

无人久伴 提交于 2019-12-10 22:52:28
问题 These aren't custom metrics I'm trying to add just the existing GCP metrics. How do I add 2 metrics together in a Stack driver time series? I have two different metrics and I want to sum them so I see a single line- also I'd like to be able to alert on this summed metric too. Is this possible? Again I'm not shipping metrics to stack driver I'd doing this with existing metrics already there. 来源: https://stackoverflow.com/questions/49304742/perform-arithmetic-on-stack-driver-metrics

Logging with Google Apps script

纵饮孤独 提交于 2019-12-10 22:38:17
问题 I have two questions regarding logging with apps script: 1/ I have two .gs files (in the same project). One (F1) is calling the other (F2) via urlfetch (POST request). The Logger.log works just fine in F1, but doesn't in F2 (maybe it works too, but I just can't retrieve the logs). Do you know if it's normal or where can I find the logs of F2 ? (If you're wondering, it's made this way so we can call the same function multiple times in parallel). 2/ My scripts are linked to a Google Cloud

Google IOT per device heartbeat alert using Stackdriver

依然范特西╮ 提交于 2019-12-10 21:25:01
问题 I'd like to alert on the lack of a heartbeat (or 0 bytes received) from any one of large number of Google IOT core devices. I can't seem to do this in Stackdriver. It instead appears to let me alert on the entire device registry which does not give me what I'm looking for (How would I know that a particular device is disconnected?) So how does one go about doing this? 回答1: I have no idea why this question was downvoted as 'too broad'. The truth is Google IOT doesn't have per device alerting,

Google Cloud Trace 192.168.1.1

久未见 提交于 2019-12-10 20:24:52
问题 In the Trace page of Google Cloud Console I can see address 192.168.1.1 which takes a lot of time to execute. What is this address? From where? Is it from internal cloud's infrastructure? Or is it mine local address (if it possible)? 回答1: After talk with Google Cloud Support appears that 192.168.1.1 is exactly machine IP address on which Google Cloud Function is launched. But the interesting thing is that this address only appears if console.* things are in the code. So, for example I'm using