plugin_name: tc.plugin
modules:
  - meta:
      plugin_name: tc.plugin
      module_name: tc.plugin
      monitored_instance:
        name: tc QoS classes
        link: "https://wiki.linuxfoundation.org/networking/iproute2"
        categories:
          - data-collection.linux-systems.network-metrics
        icon_filename: "netdata.png"
      related_resources:
        integrations:
          list: []
      info_provided_to_referring_integrations:
        description: ""
      keywords: []
      most_popular: false
    overview:
      data_collection:
        metrics_description: "Examine tc metrics to gain insights into Linux traffic control operations. Study packet flow rates, queue lengths, and drop rates to optimize network traffic flow."
        method_description: "The plugin uses `tc` command to collect information about Traffic control."
      supported_platforms:
        include:
          - Linux
        exclude: []
      multi_instance: true
      additional_permissions:
        description: "The plugin needs to access command `tc` to get the necessary metrics. To achieve this netdata modifies permission of file `/usr/libexec/netdata/plugins.d/tc-qos-helper.sh`."
      default_behavior:
        auto_detection:
          description: ""
        limits:
          description: ""
        performance_impact:
          description: ""
    setup:
      prerequisites:
        list:
          - title: Create `tc-qos-helper.conf`
            description: |
              In order to view tc classes, you need to create the file `/etc/netdata/tc-qos-helper.conf` with content:

              ```conf
              tc_show="class"
              ```
      configuration:
        file:
          name: "netdata.conf"
          section_name: "[plugin:tc]"
          description: "The main configuration file."
        options:
          description: ""
          folding:
            title: "Config option"
            enabled: true
          list:
            - name: script to run to get tc values
              description: Path to script `tc-qos-helper.sh`
              default_value: "usr/libexec/netdata/plugins.d/tc-qos-helper.s"
              required: false
            - name: enable show all classes and qdiscs for all interfaces
              description: yes/no flag to control what data is presented.
              default_value: "yes"
              required: false
        examples:
          folding:
            enabled: false
            title: "Config"
          list:
            - name: Basic
              description: |
                A basic example configuration using classes defined in `/etc/iproute2/tc_cls`.

                An example of class IDs mapped to names in that file can be:

                ```conf
                2:1 Standard
                2:8 LowPriorityData
                2:10 HighThroughputData
                2:16 OAM
                2:18 LowLatencyData
                2:24 BroadcastVideo
                2:26 MultimediaStreaming
                2:32 RealTimeInteractive
                2:34 MultimediaConferencing
                2:40 Signalling
                2:46 Telephony
                2:48 NetworkControl
                ```

                You can read more about setting up the tc rules in rc.local in this [GitHub issue](https://github.com/netdata/netdata/issues/4563#issuecomment-455711973).

              config: |
                [plugin:tc]
                  script to run to get tc values = /usr/libexec/netdata/plugins.d/tc-qos-helper.sh
                  enable show all classes and qdiscs for all interfaces = yes
    troubleshooting:
      problems:
        list: []
    alerts: []
    metrics:
      folding:
        title: Metrics
        enabled: false
      description: ""
      availability: []
      scopes:
        - name: network device direction
          description: "Metrics related to QoS network device directions. Each direction (in/out) produces its own set of the following metrics."
          labels:
            - name: device
              description: The network interface.
            - name: device_name
              description: The network interface name
            - name: group
              description: The device family
          metrics:
            - name: tc.qos
              description: Class Usage
              unit: "kilobits/s"
              chart_type: stacked
              dimensions:
                - name: a dimension per class
            - name: tc.qos_packets
              description: Class Packets
              unit: "packets/s"
              chart_type: stacked
              dimensions:
                - name: a dimension per class
            - name: tc.qos_dropped
              description: Class Dropped Packets
              unit: "packets/s"
              chart_type: stacked
              dimensions:
                - name: a dimension per class
            - name: tc.qos_tokens
              description: Class Tokens
              unit: "tokens"
              chart_type: line
              dimensions:
                - name: a dimension per class
            - name: tc.qos_ctokens
              description: Class cTokens
              unit: "ctokens"
              chart_type: line
              dimensions:
                - name: a dimension per class