Traffic Stats is a program written in Go that is used to acquire and store statistics about CDNs controlled by Traffic Control. Traffic Stats mines metrics from the Traffic Monitor APIs and stores the data in InfluxDB or Kafka. Data is typically stored in InfluxDB on a short-term basis (30 days or less), and Kafka data is available for consumption based on retention period. The data from InfluxDB is then used to drive graphs created by Grafana - which are linked to from Traffic Portal - as well as provide data exposed through the Traffic Ops API. Traffic Stats performs two functions:
Summarizes all of the statistics once a day (around midnight UTC) and creates a daily report containing the Max Gbps Served and the Total Bytes Served.
Statistics are stored in three different databases:
deliveryservice_stats: Stores data for Delivery Services. The measurements stored by
daily_stats: Stores summary data for daily activities. The statistics that are currently summarized are:
Daily stats are stored by CDN.
When Kafka is enabled, Cache and Delivery Service statistics are sent through JSON format with optional TLS authentication.
Traffic Stats does not influence overall CDN operation, but is required with InfluxDB enabled in order to display charts in Traffic Portal.