1

we are using HTTPS and TCP Load balancers in the Google Cloud Platform (GCP) and we want to monitor them (e.g. with Stackdriver).

For us, one main criteria seems to be the amount of healthy backend services (which also is an inidicator shown in the GCP Console as green or orange/red).

But unfortunately there is no such metric as backend_service.count.

Is there any other metric or way which could be used for that kind of monitoring? Is it overall a good idea to monitor and alert based on the backend count? (maybe we miss something)

Dave M
  • 4,514
  • 22
  • 31
  • 30

3 Answers3

0

Please have a look the documentation HTTP(S) Load Balancing Logging and Monitoring:

You can enable, disable, and view logs for an HTTP(S) Load Balancing backend service.

Note: If the backend service is created after the General Availability release of Logging for HTTP(S) Load Balancing, logging is disabled for a backend service. If you enabled logging during the alpha release or beta release, logging continues to be enabled for the backend service.

You enable or disable logging for each backend service. You can configure whether to log all requests or a randomly sampled fraction.

To enable logging on a new backend service you can use Console UI or gcloud command:

gcloud compute backend-services create BACKEND_SERVICE \
 --global \
 --enable-logging \
 --logging-sample-rate=VALUE \
 ... other values

for an existing backend service:

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

To enable monitoring you should follow the documentation:

You can configure export of logs-based metrics for external HTTP(S) load balancer resource logs (resource.type=http_load_balancer). The metrics created are based on the "Google Cloud HTTP Load Balancing Rule (Logs-based Metrics)" resource (l7_lb_rule), which is available under Cloud Monitoring dashboards instead of under the https_lb_rule resource.


Furthermore, please have a look at the documentation Monitoring Network Load Balancing:

Network Load Balancing exports key metrics to Monitoring.

Monitoring metrics can be used for the following purposes:

  • Evaluate a load balancer's configuration, usage, and performance
  • Troubleshoot problems
  • Improve resource utilization and user experience

You can create custom dashboards, set up alerts, and query metrics through Monitoring.

More information and step by step instructions you can find at the documentation section Defining Monitoring alerts and Metrics.

Serhii Rohoza
  • 1,424
  • 2
  • 5
  • 15
0

I think what you’re looking for is not from the load-balancer itself, instead you may use Stackdriver Groups.

You may use in different ways the groups in SD, for example if you have an instance group, you may use tags in the nodes part of the instance group and create a group with all the resources in your project that contain the tag that you defined in your instance template.

Also, you may specify the membership criteria with multiple options, for example you may use multiple criterias in order to group the number of nodes and also the region where they are or any other option in the Create Group form.

In the SD monitoring console you will be able to see the existing nodes that match the criteria(s) being part of the group and a graphic with the Running Resources.

womble
  • 96,255
  • 29
  • 175
  • 230
Adad O.
  • 11
  • 2
0

Here are easy steps to Create Monitoring Env on GCP.

Before Proceeding this install Stackdriver 1.Create a Google Cloud Platform Project (App Engine specifically)

2.Creating Resources to Monitor

3.Enable Stackdriver Monitoring

4.Utilize the standard Guestbook Python Application source available at official GCP GitHub site or (Setup Google Cloud Platform Project Source Repository)

5.Deploy the code

6.See how we can get Debug snapshots of the running application

7.Look at Logging and Application Call Traces

8.Add logpoints to current running application

Google Cloud Platform Service Monitoring ->https://rominirani.com/gcp-stackdriver-tutorial-debug-snapshots-traces-logging-and-logpoints-1ba49e4780e6

->https://cloud.google.com/service-monitoring/

->https://cloud.google.com/blog/products/gcp/stackdriver-debugger-add-application-logs-on-the-fly-with-no-restarts

->https://codelabs.developers.google.com/codelabs/cloud-monitoring-codelab/index.html?index=..%2F..index#0

Aiden
  • 177
  • 2