如何查看特定控制器端點(diǎn)在一天或 x 時間段內(nèi)收到的點(diǎn)擊次數(shù)。我有一個非?;镜难菔緫?yīng)用程序。我的控制器看起來像這樣。@RestController@RequestMapping("/person")@RequiredArgsConstructorpublic class PersonController { private final PersonService personService; @GetMapping(path = "all") public List<Person> getAllPerson() { return personService.getAllPersons(); } // etc我已經(jīng)配置了 prometheus 并讓它運(yùn)行。正如您所看到的,我有一個顯示總回日志事件的圖表。http://localhost:8080/person/all如果想要顯示 GET命中的 次數(shù),查詢會是什么樣子。
1 回答

FFIVE
TA貢獻(xiàn)1797條經(jīng)驗(yàn) 獲得超6個贊
http_server_requests_seconds_count或http_server_requests_seconds_sum指標(biāo)將包含所需的詳細(xì)信息。
例如,
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管理端點(diǎn),可以在以下位置查看prometheus指標(biāo)http://example.com/{actuator|admin}/prometheus
添加回答
舉報
0/150
提交
取消