prometheus指标采样api接口的响应时间是主动推数据吗?
一般情况是服务器暴露一个exporter,prometheus会定时来采集数据。
像api的响应时间这种和cpu,内存这种硬指标不太一样,api有各种各样的,是在一个api处理完成时计算出时间,然后主动推送到prometheus里面吗?
prometheus指标采样api接口的响应时间是主动推数据吗?
一般情况是服务器暴露一个exporter,prometheus会定时来采集数据。
像api的响应时间这种和cpu,内存这种硬指标不太一样,api有各种各样的,是在一个api处理完成时计算出时间,然后主动推送到prometheus里面吗?
响应时间一般也是用 exporter ,用 histogram 类型,定时拉取。prometheus exporter 会在将数据提供给服务器之前,先做一个归总。
想主动推送的话,需要服务侧开 pushgateway ,然后向 pushgateway 推送数据,prometheus 再从 pushgateway 收集数据。
可能的话,一般都不会使用 pushgateway,而是使用拉取的方式。