Traffic Stats

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. Data is typically stored in InfluxDB on a short-term basis (30 days or less). 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:

  • Gathers statistics for Edge-tier cache servers and Delivery Services at a configurable interval (10 second default) from the Traffic Monitor APIs and stores the data in InfluxDB
  • 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:

  • cache_stats: Stores data gathered from edge-tier cache servers. The measurements stored by cache_stats are:

    • bandwidth
    • maxKbps
    • client_connections (ats.proxy.process.http.current_client_connections).

Cache Data is stored with tags for hostname, Cache Group, and CDN. Data can be queried using tags.

  • deliveryservice_stats: Stores data for Delivery Services. The measurements stored by deliveryservice_stats are:

    • kbps
    • status_4xx
    • status_5xx
    • tps_2xx
    • tps_3xx
    • tps_4xx
    • tps_5xx
    • tps_total

Delivery Service statistics are stored with tags for Cache Group, CDN, and Delivery Service xml_id.

  • daily_stats: Stores summary data for daily activities. The statistics that are currently summarized are:

    • Max Bandwidth
    • Bytes Served

Daily stats are stored by CDN.

Traffic Stats does not influence overall CDN operation, but is required in order to display charts in Traffic Portal.