improve access to controller info
This commit is contained in:
parent
6a032bfaa2
commit
6cd18ff1fd
3 changed files with 17 additions and 25 deletions
|
|
@ -115,10 +115,7 @@ func (a *APIController) handleWorkflowJobEvent(w http.ResponseWriter, r *http.Re
|
|||
signature := r.Header.Get("X-Hub-Signature-256")
|
||||
hookType := r.Header.Get("X-Github-Hook-Installation-Target-Type")
|
||||
|
||||
controllerInfo, err := a.r.GetControllerInfo(r.Context())
|
||||
if err != nil {
|
||||
log.Printf("failed to get controller info for metics labels: %q", err)
|
||||
}
|
||||
controllerInfo := a.r.GetControllerInfo(r.Context())
|
||||
|
||||
if err := a.r.DispatchWorkflowJob(hookType, signature, body); err != nil {
|
||||
if errors.Is(err, gErrors.ErrNotFound) {
|
||||
|
|
|
|||
|
|
@ -37,11 +37,7 @@ func (c *GarmCollector) Describe(ch chan<- *prometheus.Desc) {
|
|||
}
|
||||
|
||||
func (c *GarmCollector) Collect(ch chan<- prometheus.Metric) {
|
||||
controllerInfo, err := c.runner.GetControllerInfo(auth.GetAdminContext())
|
||||
if err != nil {
|
||||
log.Printf("error on fetching controllerInfo: %s", err)
|
||||
// continue anyway
|
||||
}
|
||||
controllerInfo := c.runner.GetControllerInfo(auth.GetAdminContext())
|
||||
|
||||
c.CollectInstanceMetric(ch, controllerInfo.Hostname, controllerInfo.ControllerID.String())
|
||||
c.CollectHealthMetric(ch, controllerInfo.Hostname, controllerInfo.ControllerID.String())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue