Quarkus千分尺中的非200个响应代码没有HTTP客户端指标
我有以下Quarkus REST客户端代码(基于此doc https://quarkus.io/guides/guides/rest/rest -client )
@RegisterRestClient(baseUri = "https://pesho3.free.beeceptor.com")
interface TokenService {
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON)
@ClientHeaderParam(
name = "Authorization",
value = ["Basic asdasd"]
)
fun getToken(
@FormParam("grant_type") grantType: String = "client_credentials",
@FormParam("scope") scope: String = "IIG-HIP-NP/Read"
): JSONObject
}
当我调用我的getToken()方法并获取http 200时,我会在localhost中自动生成的指标:8080/q/量表(如此doc https://quarkus.io/guides/guides/micrometer#review-autopitiort-generatory-generatory-generatory-generatory-generational-generated-Metrics )
EG
http_client_requests_seconds_count{clientName="pesho3.free.beeceptor.com",method="POST",outcome="SUCCESS",status="200",uri="root",} 2.0
http_client_requests_seconds_sum{clientName="pesho3.free.beeceptor.com",method="POST",outcome="SUCCESS",status="200",uri="root",} 1.116203
我没有得到有200条代码的任何指标。我如何揭露它们?
I have the following Quarkus Rest client code (based on this doc https://quarkus.io/guides/rest-client)
@RegisterRestClient(baseUri = "https://pesho3.free.beeceptor.com")
interface TokenService {
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON)
@ClientHeaderParam(
name = "Authorization",
value = ["Basic asdasd"]
)
fun getToken(
@FormParam("grant_type") grantType: String = "client_credentials",
@FormParam("scope") scope: String = "IIG-HIP-NP/Read"
): JSONObject
}
When I call my getToken() method and get http 200 I get automatically generated metrics in localhost:8080/q/metrics (as stated in this doc https://quarkus.io/guides/micrometer#review-automatically-generated-metrics)
e.g
http_client_requests_seconds_count{clientName="pesho3.free.beeceptor.com",method="POST",outcome="SUCCESS",status="200",uri="root",} 2.0
http_client_requests_seconds_sum{clientName="pesho3.free.beeceptor.com",method="POST",outcome="SUCCESS",status="200",uri="root",} 1.116203
I don't get any metrics for non 200 codes.. How can I expose them ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案。它的此属性(Quarkus doc中未提及)
答案是在此文档中:
I found the solution.. Its this property (not mentioned in Quarkus doc)
The answer was in this doc: