Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Traffic Monitor logs not consistent #5373

Closed

Description

@smalenfant

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

Activity

  1. tcfdev commented on Dec 14, 2020

    @tcfdev
    Collaborator

    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.

  2. tcfdev commented on Jan 20, 2021

    @tcfdev
    Collaborator

    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.

  3. added this to the 6.0.1 milestone on Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Traffic Monitorrelated to Traffic Monitorbugsomething isn't working as intended

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions