Under COMPUTE ENGINE > HEALTH CHECKS I have a health check called https-healthcheck-443 and it shows LOGS=Enabled.
The health check is working OK with LB, because when I stop one of my two backend http servers and I look at LB’s backend service, I see it shows 1 of 2 are Healthy as expected. And when I start the stopped server, I then see 2 of 2 are healthy.
The problem is, I don’t see any health check results in the LOGS EXPLORER with this query:
logName=“projects/project-prod/logs/compute.googleapis.com%2Fhealthchecks”
I have this same exact setup in another project called project-test and healthcheck logging returns results as expected with this query:
logName=“projects/project-test/logs/compute.googleapis.com%2Fhealthchecks”
If test works but prod doesn’t, most likely causes are :-
Health check logging isn’t actually enabled → Check with gcloud and update it.
IAM restrictions on Logging API → Ensure you have logging.viewer and compute.admin roles.
Log routing is different in production → Check gcloud logging sinks list.
Logging API isn’t enabled → Run gcloud services enable logging.googleapis.com.
Thank you for the suggestions! I have tried each of the four suggestions and I’m posting results here. Unfortunately, I still can’t query the LB healthchecks in logs.
2. IAM restrictions on Logging API → Ensure you have logging.viewer and compute.admin roles.
I added compute.admin role to my ID in my prod project and it did not help.
I did notice that in the TEST project I have a role of owner, so I added owner role to prod project and that did not help.
3. Log routing is different in production → Check gcloud logging sinks list.
I am not sure what to check here, but both prod and test look the same.
Is more sink data I need to collect?
I’m starting to think it has something to do with this…
When I am in TEST project and I go to LOGS EXPLORER and then in the ALL LOG NAMES pulldown I enter “compute”, I see these two items appear under COMPUTE ENGINE:
healthchecks
shielded_vm_intgrity
But when I am in prod, I do not see those two items, all I see is shielded_vm_intgrity.
healthchecks, the one I need is missing.