0

I created a Health Check in my GCP project for http traffic. I wanted to see the logs in Cloud Logging but I cant see any logs related to the created HealthCheck. I have logging enabled in HealthCheck. Can anyone help me?

JM Gelilio
  • 3,482
  • 1
  • 11
  • 23
ankit
  • 11
  • 2

2 Answers2

0

You can go to Cloud Logging and filter on gcp_health_check resources, like this

enter image description here

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
  • Thank You for your answer. I tried this as well but no luck.. I can logs for other health check there but not for the one i am looking for. – ankit Oct 09 '20 at 08:24
  • How did you create it? – guillaume blaquiere Oct 09 '20 at 09:30
  • I created it via GCP UI. is there any specific details you are asking here? – ankit Oct 09 '20 at 10:19
  • No, simply to test and try to reproduce your case. You can create health check from different services (Managed Instance Group, Load Balancer, Traffic director,...). I understood that you create it under Compute Engine -> Health check menu, right? – guillaume blaquiere Oct 09 '20 at 11:35
  • Yes I created the same way and then used it in some load balancer with BE assign to it. One query here(Might be silly, excuse me for that).. Do health checks produce logs for only when any error comes/health check fails or it will also produce logs even if health check are being passed? I know that Health checks generate a log whenever an endpoint changes state from one state to another but if since i have configured my HC there is no change in state of endpoints(they are in healthy state since they configured). – ankit Oct 14 '20 at 17:42
0

You can view your health check logs under Logs explorer in the GCP console. Check out this documentation for more details.

To see all logs, you can use the following query:

logName="projects/YOUR_PROJECT_ID/logs/compute.googleapis.com%2Fhealthchecks"
Ameya
  • 25
  • 3