Notification from GCP project

318 views
Skip to first unread message

Dharmendra Kumar

unread,
Nov 10, 2018, 7:39:28 PM11/10/18
to gce-discussion
Hi,

I have searched a lot over the google but can not find any helping post. I am looking for an solution, where i can set an alert on GCP project. If anyone from my team member creates any resource under the GCP project. I should be notified, that this resource has been created in this project.

Thank you in advance. It will be great help. if anyone can suggest on this.

Thanks,
Dharmendra 

Larbi (Google Cloud Support)

unread,
Nov 11, 2018, 4:30:56 PM11/11/18
to gce-discussion
Hello Kumar,

You can use this method to alerted (as example let keep it when someone created an instance).
First, create a Log based metric, to do, you need to go in the stackdriver logging and in advanced filter mode, put the filter below and click on Top "CREAT METRIC" (keep it as counter), when you finish this metric will be listed under "Logs-based metrics"

Filter: protoPayload.methodName="v1.compute.instances.insert"

Second, Go to Stackdriver Monitoring and create an Alert policy, click on "Add condition" then look for the metric name that you created above (normally it should have this format :logging/user/<name of your metric>), finish your setting then click on "Notification" choose which one you prefer to use {email, SMS, Pager Duty}.

Then it's done whenever there is a new instance created you will recive an email or SMS, ...

I hope this will help you. 

Dharmendra Kumar

unread,
Nov 13, 2018, 6:03:15 AM11/13/18
to ala...@google.com, gce-dis...@googlegroups.com
Hello Larbi,

I have followed an setup the same metric and policy but still did not get any email notification. Please let me know if i missed something.
-- 
Thanks & Regards,
Dharmendra Kumar 
Ph.+91.9871843306


--
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/f0d9dca4-517f-42c8-b17f-3298b088de6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Milad (Google Cloud Platform)

unread,
Nov 13, 2018, 5:48:39 PM11/13/18
to gce-discussion
Hello,

1) Is anyone from your team member creates any resource after you setup the policies in Stackdriver monitoring? 

2) Do you confirm that you created the alert condition using  "count" or "delta" in the aligner alerting policy detail?

Please note "count" is the number of /streams/, which means the number of distinct label values seen in the alignment period, not the value of the counter in that stream. "delta" is the absolute number of log entries seen in the alignment period. 'count' will still produce the correct alerting behavior, however 'delta' will be more correct in that the value will reflect the number of times the log entry was seen. 

If the issue is still persist, I recommend you to open a file in Serverfault with all asked information which the question is related to getting help with config.

Mary Koes

unread,
Nov 13, 2018, 6:05:44 PM11/13/18
to msadeg...@google.com, gce-dis...@googlegroups.com
There's a Qwiklab with detailed instructions on this use case, Creating and Alerting on Logs-based Metrics.  You need to register for an account (which is free) in order to view the detailed instructions...

Best,

Mary

Reply all
Reply to author
Forward
0 new messages