Latency percentile

I want to know what is the best configuration for creating metric to get 95 th percentile for an application hosted in GCE in multiple regions.All the instances are in MIG and having http loadbalancer configured.

0 1 79
1 REPLY 1

Hi @Arkya 

Welcome to Google Cloud Community!

You can use Monitoring Query Language (MQL) or Prometheus Query Language (PromQL) to query the metrics that you need. Below are sample queries for your reference:

MQL:

fetch gce_instance
| metric 'compute.googleapis.com/instance/cpu/usage_time'
| filter (resource.zone == 'us-central1-a')
| align rate(1m)
| every 1m
| group_by [], [value_usage_time_percentile: percentile(value.usage_time, 95)]

PromQL:

quantile(0.95,sum by (le)(rate(compute_googleapis_com:instance_cpu_usage_time{monitored_resource="gce_instance",zone="us-central1-a"}[${__interval}])))

Here you can find more information about MQL and PromQL.

I hope this information is helpful.

If you need further assistance, you can always file a case with our support team.