Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Why do some alerts give you option to view logs for that alert while others do not?

 Why do some alerts created from log based metrics allow you to click on the alert and then "View Logs",   see screenshot below of such and example:

Screenshot 2024-10-30 at 09.21.04.png

 

While some alerts don't allow you to view the logs  and then you end up having to find the log based metric used in the alert and need to lookup that log based metric and under log based metrics need to click on "View Logs".

 

See screenshot where there is no option for "View Logs"?

Screenshot 2024-10-30 at 09.19.35.png

I've never understood why is this. Most of my alerts created from log based metrics are created in the same way.

0 2 278
2 REPLIES 2

Hi @timogoosen,

Welcome to Google Cloud Community!

The way you configure the alert can play a role as to why ‘view logs’ is not visible on the option. To Configure notifications for log-based metrics, kindly follow steps provided on this document where explains that:

An alerting policy describes a set of conditions that you want to monitor. When you create an alerting policy, you must also specify its conditions: what is monitored and when to send notifications. Notifications include information about the incident, and they include buttons that let you view relevant logs and incident details:

notification.png

If you plan to create an alerting policy to monitor a log-based metric, then ensure sure that you understand the limitations of this approach. In particular, review Troubleshoot: Metric is missing logs data.

Other references: 

Log-based metrics overview

Can't see log entries 

Projects and metrics scopes

I hope the above information is helpful.

Thanks I looked at everything you posted. 
I can't seem to find the step when setting up notification to include an option to click and "view logs" for a given alert based on a log based metric.

How would you do it from an existing (log based metric) alert by clicking edit on the alert policy?

 

Thanks for your help and my apologies for my late reply.