You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/08 04:41:30 UTC
[GitHub] [apisix-ingress-controller] Sindweller commented on a change in pull request #670: feat: expose more prometheus metrics
Sindweller commented on a change in pull request #670:
URL: https://github.com/apache/apisix-ingress-controller/pull/670#discussion_r704027192
##########
File path: pkg/apisix/cluster.go
##########
@@ -535,12 +547,14 @@ func (c *cluster) listResource(ctx context.Context, url string) (*listResponse,
return &list, nil
}
-func (c *cluster) createResource(ctx context.Context, url string, body io.Reader) (*createResponse, error) {
+func (c *cluster) createResource(ctx context.Context, url, resource string, body io.Reader) (*createResponse, error) {
req, err := http.NewRequestWithContext(ctx, http.MethodPut, url, body)
if err != nil {
return nil, err
}
+ start := time.Now()
resp, err := c.do(req)
+ c.metricsCollector.RecordAPISIXLatency(time.Now().Sub(start))
if err != nil {
return nil, err
Review comment:
- name: `request_error_total`(apisixRequestErrors) & `request_error_ratio`
- type: counter & guage
- calculation: ` apisixRequestErrorRadio := c.metricsCollector.apisixRequestErrors / c.metricsCollector.apisixRequests`
- labels: resource
the metric should be like this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org