写入一个或多个点的次数比为指标配置的最大采样时间更频繁 [英] One or more points were written more frequently than the maximum sampling period configured for the metric
问题描述
我有一个部署在多台计算机上的网站.我想创建一个Google自定义指标来指定其吞吐量-服务了多少呼叫.
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.
该想法是创建一个自定义指标,该指标收集有关已处理请求的信息,每分钟1次,以将信息更新为自定义指标.因此,对于每台机器,此代码每分钟最多可能发生1次.但是,此过程正在群集中的每台计算机上进行.
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.
我收到此错误:Grpc.Core.RpcException:Status(StatusCode = InvalidArgument,Detail =一个或多个TimeSeries无法写:一个或多个要点被更频繁地写比为指标配置的最大采样周期大.{指标:custom.googleapis.com/web/2xx,时间戳:{现存最年轻:'2019/09/28-23:58:59.000',新功能:'2019/09/28-23:59:02.000'}}:timeSeries [0];写一个或多个要点的频率比为指标配置的最大采样周期.{指标:custom.googleapis.com/web/4xx,时间戳记:{现存最年轻:'2019/09/28-23:58:59.000',新功能:'2019/09/28-23:59:02.000'}}:timeSeries 1 )
然后,我正在阅读自定义指标限制:
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
我当时认为Google Cloud Custom Metric将为我处理并发问题.
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.
我缺少什么?
推荐答案
现在,您在度量标准上添加了计算机名称,并获得了计算机度量标准.
Now that you add the machine name on the metric and you get the machines metrics.
要对这些指标求和,请进入Stackdriver> Metric Explorer,然后按项目ID或标签将您的指标分组,然后对这些指标求和.
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.
这篇关于写入一个或多个点的次数比为指标配置的最大采样时间更频繁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!