0

I have an API deployed in GKE, exposed to internet through a Google endpoint.

when I display 'reponses latency' metrics of my API in GCP console: 'API & services' > 'Dashboard' > 'my-clint-eastwood-api' > 'metrics'

And I choose 'latency by response code (median)'. Fo the last hour I have a chart like this:

enter image description here

So a graph with four peaks above 6ms in last hour.

Now, I tried to obtain this same chart/measurement with the 'Metric explorer' in GCP console: 'Monitoring' > 'Metric explorer'.

I select these filters :

Resource Type : 'Produced API'

Metric : 'Request latencies'

Filter : 'service = my-clint-eastwood-api.endpoints.project-western.cloud.goog'

group by : empty field

Aggregator : 'mean'

Minimum alignment period : '1 minute'

The I obtain a chart of values for the last hour : enter image description here

In same period, values are completely different comparing to values displayed in google endpoints metrics : almost all above 10ms there, against 3 peaks above 6 ms seen before.

Questions :

  • why values are so different ?
  • which chart is right, which is wrong ?
  • How can we obtain correct chart displaying a mean of latencies in metrics explorer (in order to create dashboard afterwards) ?
Goli Nikitha
  • 858
  • 3
  • 9
Germs
  • 347
  • 6
  • 8
  • The charts shown from both the methods will be same if the aggregating function used in both the charts is same i.e The chart shown from API in GCP console is using median(Median is the middle value, which equals to the 50th percentile of a sample set) as Aggregation function and the graph from the Metric explorer in GCP console is using mean(Returns the average value of a sample set)as an Aggregation function. As median aggregation is fixed in a graph from API in GCP console try changing the aggregator in Metric explorer to 50th percentile and check if the charts resembles the same – Goli Nikitha Sep 14 '21 at 08:00
  • To get the mean of latencies in metric explorer mean aggregator can be used, as median aggregator is fixed in API - both the charts may differ. – Goli Nikitha Sep 14 '21 at 08:03

0 Answers0