One or more points were written more frequently than the maximum sampling period configured for the metric

你。 提交于 2021-02-19 08:53:05

问题


Background

I have a website deployed in multiple machines. I want to create a Google Custom Metric that specifies the throughput of it - how many calls were served.

The idea was to create a custom metric that collects information about served requests and 1 time per minute to update the information into a custom metric. So, for each machine, this code can happen a maximum of 1-time per minute. But this process is happening on each machine on my cluster.

Running the code locally is working perfectly.

The problem

I'm getting this error: Grpc.Core.RpcException: Status(StatusCode=InvalidArgument, Detail="One or more TimeSeries could not be written: One or more points were written more frequently than the maximum sampling period configured for the metric. {Metric: custom.googleapis.com/web/2xx, Timestamps: {Youngest Existing: '2019/09/28-23:58:59.000', New: '2019/09/28-23:59:02.000'}}: timeSeries[0]; One or more points were written more frequently than the maximum sampling period configured for the metric. {Metric: custom.googleapis.com/web/4xx, Timestamps: {Youngest Existing: '2019/09/28-23:58:59.000', New: '2019/09/28-23:59:02.000'}}: timeSeries1")

Then, I was reading in the custom metric limitations that:

Rate at which data can be written to a single time series = one point per minute

I was thinking that Google Cloud Custom Metric will handle the concurrencies issues for me.

According to their limitations, the only option for me to implement realtime monitoring is to put another application that will collect information from all machines and will update it into a custom metric. It sounds to me like too much work for a real use case.

What I'm missing?


回答1:


Now that you add the machine name on the metric and you get the machines metrics.

To SUM these metrics go to Stackdriver > Metric Explorer, and group your metrics by project-id or label for example, and then SUM the metrics.

https://cloud.google.com/monitoring/charts/metrics-selector#alignment

You can save the chart in a custom dashboard.



来源:https://stackoverflow.com/questions/58153208/one-or-more-points-were-written-more-frequently-than-the-maximum-sampling-period

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!