![](/img/trans.png)
[英]update specific data for an object using POST method in spring boot rest
[英]How to capture metrics Separately for GET,POST and PUT method for given REST Endpoint using spring boot actuators
如何使用彈簧啟動執行器分別捕獲給定REST端點的GET,POST和PUT方法的度量。
防爆
默認情況下,我們得到:-“ gauge.response.customer”:631,我需要
提前致謝
嗯,我不認為您可以像這樣分解端點。 但是,我知道執行器非常靈活,您可以向該端點添加新指標。 看來您主要對計數器感興趣,所以我建議您使用Spring引導所提供的CounterService。
private CounterService counterService;
@Autowired
public MyClassName(CounterService counterService) {
this.counterService = counterService;
}
@RequestMapping(method=RequestMethod.POST)
public String myPostMethod(Object obj) {
counterService.increment("mycontroller.post.method");
//...
return "myPostMethod";
}
@RequestMapping(method=RequestMethod.GET)
public String myGetMethod() {
counterService.increment("mycontroller.get.method");
//...
return "myGetMethod";
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.