tokers commented on a change in pull request #627:
URL:
https://github.com/apache/apisix-ingress-controller/pull/627#discussion_r687649832
##########
File path: pkg/ingress/apisix_tls.go
##########
@@ -146,7 +146,7 @@ func (c *apisixTlsController) sync(ctx context.Context, ev
*types.Event) error {
c.controller.recordStatus(tls, _resourceSyncAborted, err,
metav1.ConditionFalse)
return err
}
-
+ c.controller.metricsCollector.IncrSyncSuccess("ssl")
Review comment:
I saw the same logic was put inside `handleSyncErr` while here you put
it in another place, we'd better keep them consistent.
##########
File path: pkg/apisix/cluster.go
##########
@@ -157,6 +160,7 @@ func (c *cluster) syncCache(ctx context.Context) {
zap.String("cost_time",
time.Since(now).String()),
zap.String("cluster", c.name),
)
+ c.metricsCollector.IncrSyncSuccess("cache")
Review comment:
We don't need this as the counter was increased in `syncOnce`.
##########
File path: pkg/apisix/cluster.go
##########
@@ -279,6 +283,7 @@ func (c *cluster) syncCacheOnce(ctx context.Context) (bool,
error) {
)
}
}
+ c.metricsCollector.IncrSyncSuccess("cache")
Review comment:
We may use another counter to record the cache synchronization, as below
you use this counter to record the resource sync.
##########
File path: pkg/metrics/prometheus.go
##########
@@ -37,20 +38,33 @@ type Collector interface {
RecordAPISIXLatency(time.Duration)
// IncrAPISIXRequest increases the number of requests to apisix.
IncrAPISIXRequest(string)
+ // increases the number of cluster health check operations with the
controller
+ // name label
+ IncrCheckClusterHealth(string)
+ // IncrSyncSuccess increases the number of sync operations with the
resource
+ // type label
+ IncrSyncSuccess(string)
Review comment:
It's not a good name, we may use `IncrSyncOperation`, and add another
label like `success` to mark whether the sync operation is successful or not.
Then we also can increase the failure counts.
##########
File path: pkg/ingress/endpointslice.go
##########
@@ -109,6 +109,7 @@ func (c *endpointSliceController) sync(ctx context.Context,
ev *types.Event) err
func (c *endpointSliceController) handleSyncErr(obj interface{}, err error) {
if err == nil {
c.workqueue.Forget(obj)
+ c.controller.metricsCollector.IncrSyncSuccess("endpoint")
Review comment:
use term "endpointSlices".
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]