mirror of https://github.com/hashicorp/consul
Track calls blocked by ACLs using metrics
parent
0285617a02
commit
d9a23bb2fa
|
@ -10,6 +10,7 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
metrics "github.com/armon/go-metrics"
|
||||||
"github.com/hashicorp/consul/acl"
|
"github.com/hashicorp/consul/acl"
|
||||||
"github.com/hashicorp/consul/agent/structs"
|
"github.com/hashicorp/consul/agent/structs"
|
||||||
"github.com/hashicorp/consul/agent/token"
|
"github.com/hashicorp/consul/agent/token"
|
||||||
|
@ -842,6 +843,7 @@ func (l *State) deleteService(id string) error {
|
||||||
// todo(fs): some backoff strategy might be a better solution
|
// todo(fs): some backoff strategy might be a better solution
|
||||||
l.services[id].InSync = true
|
l.services[id].InSync = true
|
||||||
l.logger.Printf("[WARN] agent: Service %q deregistration blocked by ACLs", id)
|
l.logger.Printf("[WARN] agent: Service %q deregistration blocked by ACLs", id)
|
||||||
|
metrics.IncrCounter([]string{"consul", "acl", "blocked", "service", "deregistration"}, 1)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -879,6 +881,7 @@ func (l *State) deleteCheck(id types.CheckID) error {
|
||||||
// todo(fs): some backoff strategy might be a better solution
|
// todo(fs): some backoff strategy might be a better solution
|
||||||
l.checks[id].InSync = true
|
l.checks[id].InSync = true
|
||||||
l.logger.Printf("[WARN] agent: Check %q deregistration blocked by ACLs", id)
|
l.logger.Printf("[WARN] agent: Check %q deregistration blocked by ACLs", id)
|
||||||
|
metrics.IncrCounter([]string{"consul", "acl", "blocked", "check", "deregistration"}, 1)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -949,6 +952,7 @@ func (l *State) syncService(id string) error {
|
||||||
l.checks[check.CheckID].InSync = true
|
l.checks[check.CheckID].InSync = true
|
||||||
}
|
}
|
||||||
l.logger.Printf("[WARN] agent: Service %q registration blocked by ACLs", id)
|
l.logger.Printf("[WARN] agent: Service %q registration blocked by ACLs", id)
|
||||||
|
metrics.IncrCounter([]string{"consul", "acl", "blocked", "service", "registration"}, 1)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -994,6 +998,7 @@ func (l *State) syncCheck(id types.CheckID) error {
|
||||||
// todo(fs): some backoff strategy might be a better solution
|
// todo(fs): some backoff strategy might be a better solution
|
||||||
l.checks[id].InSync = true
|
l.checks[id].InSync = true
|
||||||
l.logger.Printf("[WARN] agent: Check %q registration blocked by ACLs", id)
|
l.logger.Printf("[WARN] agent: Check %q registration blocked by ACLs", id)
|
||||||
|
metrics.IncrCounter([]string{"consul", "acl", "blocked", "service", "registration"}, 1)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1025,6 +1030,7 @@ func (l *State) syncNodeInfo() error {
|
||||||
// todo(fs): some backoff strategy might be a better solution
|
// todo(fs): some backoff strategy might be a better solution
|
||||||
l.nodeInfoInSync = true
|
l.nodeInfoInSync = true
|
||||||
l.logger.Printf("[WARN] agent: Node info update blocked by ACLs")
|
l.logger.Printf("[WARN] agent: Node info update blocked by ACLs")
|
||||||
|
metrics.IncrCounter([]string{"consul", "acl", "blocked", "node", "registration"}, 1)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue