0

I am using Google Cloud CDN with my HTTPS Load Balancer, with Cloud Run as my backend service. It's all working fine, and assets are being served from the CDN. I can verify the cache hits via a cUrl command, and seeing the "Age" header increase in time.

But - these hits (Google Cloud CDN) aren't producing any logs.

If I look at the monitoring tab for my URL map on my CDN, I get the following message in the section where the graph should be:

"Traffic flow will display here once the backend service receives traffic"

My CDN has been up for a whole week already.

When I follow this article: https://cloud.google.com/cdn/docs/logging When I got my Log View page to build a query, the following resource is not available to select from:

"Cloud HTTP Load Balancer > All forwarding rules"

When I follow this article: https://cloud.google.com/load-balancing/docs/https/https-logging-monitoring

I cannot see the checkbox

"Enable logging"

enter image description here

I can also see on my "Backend service details" screen that logging is switched off (bottom of screenshot), but when I Edit it there is no option for me to switch it on ....

enter image description here

My conclusion is that there are no CDN logs being generated, and that something is not set up correctly. But I don't know where else to look, as CDN logging is supposed to happen automatically.

What else can I do?

This is the documentation I followed to set up a serverless neg hooked up to a load balancer and CDN.

https://cloud.google.com/load-balancing/docs/negs/setting-up-serverless-negs

Joerg
  • 3,553
  • 4
  • 32
  • 41
  • Logging is not enabled by default on backend services: see https://cloud.google.com/load-balancing/docs/https/https-logging-monitoring#enabling_logging_on_an_existing_backend_service for how to enable them. Are you checking the Backend Service section of the console? – elithrar Aug 02 '20 at 15:36
  • Yes - I can see that in the documentation, but there is no where in the frontend where I can see to turn on logging. I'll attach the screenshots ... – Joerg Aug 02 '20 at 15:43
  • I've updated the title of the post to better reflect that this is very specifically to do with "serverless negs". Because when I try to set a Backend Type in the dropdown (which is blank - I set up the serverless neg via the CLI), for example "Internet Network Endpoint", I can see the logging options appear, but I can't select/find my serverless neg in the next selection box. So perhaps CDN logging isn't available for serverless negs? Even though the CDN itself seems to function when I use cUrl ... – Joerg Aug 02 '20 at 16:06

1 Answers1

1

Because serverless negs as a backend to HTTP(S) Load Balancing is actually still in Beta, the Console isn't fully functional for this setup.

So to enable logging for this configuration, you'll need to use the gcloud CLI to enable logging.

gcloud compute backend-services update BACKEND_SERVICE \
    --global \
    --enable-logging \
    --logging-sample-rate=VALUE

The Edit Backend Service Details page still doesn't look right, in terms of the dropdown for Backend Type being blank.

But on the View Backend Service Details page, I can now see that logging has been *enabled.

I got the command from this page: https://cloud.google.com/load-balancing/docs/https/https-logging-monitoring

Joerg
  • 3,553
  • 4
  • 32
  • 41