亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Prometheus 計算每天對特定 Spring 控制器端點的請求

Prometheus 計算每天對特定 Spring 控制器端點的請求

萬千封印 2024-01-28 15:58:24
如何查看特定控制器端點在一天或 x 時間段內收到的點擊次數。我有一個非?;镜难菔緫贸绦?。我的控制器看起來像這樣。@RestController@RequestMapping("/person")@RequiredArgsConstructorpublic class PersonController {  private final PersonService personService;  @GetMapping(path = "all")  public List<Person> getAllPerson() {    return personService.getAllPersons();  }  // etc我已經配置了 prometheus 并讓它運行。正如您所看到的,我有一個顯示總回日志事件的圖表。http://localhost:8080/person/all如果想要顯示 GET命中的 次數,查詢會是什么樣子。
查看完整描述

1 回答

?
FFIVE

TA貢獻1797條經驗 獲得超6個贊

http_server_requests_seconds_count或http_server_requests_seconds_sum指標將包含所需的詳細信息。


例如,


http_server_requests_seconds_count{application="xyz",exception="None",method="GET",status="200",uri="/admin/info",} 94078.0

http_server_requests_seconds_sum{application="xyz",exception="None",method="GET",status="200",uri="/admin/info",} 96.108260294

提示:如果啟用了prometheus管理端點,可以在以下位置查看prometheus指標http://example.com/{actuator|admin}/prometheus


查看完整回答
反對 回復 2024-01-28
  • 1 回答
  • 0 關注
  • 133 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號