You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/01/20 17:49:06 UTC

[GitHub] [trafficcontrol] TaylorCFrey commented on issue #5373: Traffic Monitor logs not consistent

TaylorCFrey commented on issue #5373:
URL: https://github.com/apache/trafficcontrol/issues/5373#issuecomment-763821346


   After doing some further research, I've found that the `health.Event{}` is not quite consistent in the 5 spots it's created. Additionally, there appears to be an assumption that the name/xmlid is the same as the hostname in all declarations. For example, the 2 Delivery Service events are:
   
   ## package ds
   
   stat.go, 116:
   ```go
   return health.Event{
   	Time:        health.Time(time.Now()),
   	Description: desc,
   	Name:        dsName.String(),
   	Hostname:    dsName.String(),
   	Type:        "Delivery Service",
   	Available:   stat.CommonStats.IsAvailable.Value,
   }
   ```
   stat.go, 328:
   ```go
   return health.Event{
   	Time:        health.Time(time.Now()),
   	Description: desc,
   	Name:        dsName.String(),
   	Hostname:    dsName.String(),
   	Type:        "DELIVERYSERVICE",
   	Available:   stat.CommonStats.IsAvailable.Value,
   }
   ```
   
   It would be worthwhile to further investigate the name/hostname. If the hostname information is indeed part of the ingress, then it should be used appropriately. Also, it is my opinion that the `Type` field should be a typedef of sorts to ensure consistency. Something like the type definition example found at: https://programming.guide/go/define-enumeration-string.html. Lastly, even if the consistency were applied and the name addressed for the logs, the same log message would appear twice. It is also worth evaluating both Delivery Service events and assuring they are indeed logging separate logic.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org