Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traffic Monitor logs not consistent #5373

Closed
smalenfant opened this issue Dec 14, 2020 · 2 comments · Fixed by #6292
Closed

Traffic Monitor logs not consistent #5373

smalenfant opened this issue Dec 14, 2020 · 2 comments · Fixed by #6292
Labels
bug something isn't working as intended Traffic Monitor related to Traffic Monitor
Milestone

Comments

@smalenfant
Copy link
Contributor

There is some inconsistencies in the Traffic Monitor logging. Mostly they relate to:

  • delivery service used in the "host" section.
  • type is sometimes "Delivery Service" (unquoted) and sometimes "DELIVERYSERVICE".
  • Delivery Service also showing twice.
1607735204.144 host="wireless-activation", type=Delivery Service, available=true, msg="available caches"
1607735204.144 host="wireless-activation", type=DELIVERYSERVICE, available=true, msg="REPORTED - available"
1607735203.822 host="cdn1cdedge0002", type=EDGE, available=true, msg="Protocol: (IPv4) REPORTED - available (stat)"

Traffic Control components affected ...

  • Traffic Monitor

Current behavior:

In the description

Expected behavior:

Needs reviewed

@smalenfant smalenfant added bug something isn't working as intended Traffic Monitor related to Traffic Monitor labels Dec 14, 2020
@tcfdev
Copy link
Collaborator

tcfdev commented Dec 14, 2020

Looks like both logging events are created in CreateStats(...), once in the beginning of the function under addAvailableData(...) and again at the end of the function within addPerSecStats(...) -> addDSPerSecStats(...). They do look awfully similar, but I don’t know if they have different intentions or it’s more by happenstance.

@tcfdev
Copy link
Collaborator

tcfdev commented Jan 20, 2021

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:

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:

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.

@zrhoffman zrhoffman added this to the 6.0.1 milestone Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended Traffic Monitor related to Traffic Monitor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants