| 1 | <!--startmeta |
| 2 | custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/tc.plugin/README.md" |
| 3 | meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/tc.plugin/metadata.yaml" |
| 4 | sidebar_label: "tc QoS classes" |
| 5 | learn_status: "Published" |
| 6 | learn_rel_path: "Collecting Metrics/Collectors/Networking" |
| 7 | message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" |
| 8 | endmeta--> |
| 9 | |
| 10 | # tc QoS classes |
| 11 | |
| 12 | |
| 13 | <img src="https://netdata.cloud/img/netdata.png" width="150"/> |
| 14 | |
| 15 | |
| 16 | Plugin: tc.plugin |
| 17 | Module: tc.plugin |
| 18 | |
| 19 | <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> |
| 20 | |
| 21 | ## Overview |
| 22 | |
| 23 | 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. |
| 24 | |
| 25 | The plugin uses `tc` command to collect information about Traffic control. |
| 26 | |
| 27 | This collector is only supported on the following platforms: |
| 28 | |
| 29 | - Linux |
| 30 | |
| 31 | This collector supports collecting metrics from multiple instances of this integration, including remote instances. |
| 32 | |
| 33 | 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`. |
| 34 | |
| 35 | ### Default Behavior |
| 36 | |
| 37 | #### Auto-Detection |
| 38 | |
| 39 | This integration doesn't support auto-detection. |
| 40 | |
| 41 | #### Limits |
| 42 | |
| 43 | The default configuration for this integration does not impose any limits on data collection. |
| 44 | |
| 45 | #### Performance Impact |
| 46 | |
| 47 | The default configuration for this integration is not expected to impose a significant performance impact on the system. |
| 48 | |
| 49 | ## Setup |
| 50 | |
| 51 | |
| 52 | ### Prerequisites |
| 53 | |
| 54 | #### Create `tc-qos-helper.conf` |
| 55 | |
| 56 | In order to view tc classes, you need to create the file `/etc/netdata/tc-qos-helper.conf` with content: |
| 57 | |
| 58 | ```text |
| 59 | tc_show="class" |
| 60 | ``` |
| 61 | |
| 62 | |
| 63 | |
| 64 | ### Configuration |
| 65 | |
| 66 | #### Options |
| 67 | |
| 68 | |
| 69 | |
| 70 | <details open><summary>Config option</summary> |
| 71 | |
| 72 | |
| 73 | |
| 74 | | Option | Description | Default | Required | |
| 75 | |:-----|:------------|:--------|:---------:| |
| 76 | | script to run to get tc values | Path to script `tc-qos-helper.sh` | usr/libexec/netdata/plugins.d/tc-qos-helper.s | no | |
| 77 | | enable show all classes and qdiscs for all interfaces | yes/no flag to control what data is presented. | yes | no | |
| 78 | |
| 79 | |
| 80 | </details> |
| 81 | |
| 82 | |
| 83 | |
| 84 | #### via File |
| 85 | |
| 86 | The configuration file name for this integration is `netdata.conf`. |
| 87 | Configuration for this specific integration is located in the `[plugin:tc]` section within that file. |
| 88 | |
| 89 | The file format is a modified INI syntax. The general structure is: |
| 90 | |
| 91 | ```ini |
| 92 | [section1] |
| 93 | option1 = some value |
| 94 | option2 = some other value |
| 95 | |
| 96 | [section2] |
| 97 | option3 = some third value |
| 98 | ``` |
| 99 | You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-configuration-files) script from the |
| 100 | Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory). |
| 101 | |
| 102 | ```bash |
| 103 | cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata |
| 104 | sudo ./edit-config netdata.conf |
| 105 | ``` |
| 106 | |
| 107 | ##### Examples |
| 108 | |
| 109 | ###### Basic |
| 110 | |
| 111 | A basic example configuration using classes defined in `/etc/iproute2/tc_cls`. |
| 112 | |
| 113 | An example of class IDs mapped to names in that file can be: |
| 114 | |
| 115 | ```text |
| 116 | 2:1 Standard |
| 117 | 2:8 LowPriorityData |
| 118 | 2:10 HighThroughputData |
| 119 | 2:16 OAM |
| 120 | 2:18 LowLatencyData |
| 121 | 2:24 BroadcastVideo |
| 122 | 2:26 MultimediaStreaming |
| 123 | 2:32 RealTimeInteractive |
| 124 | 2:34 MultimediaConferencing |
| 125 | 2:40 Signalling |
| 126 | 2:46 Telephony |
| 127 | 2:48 NetworkControl |
| 128 | ``` |
| 129 | |
| 130 | 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). |
| 131 | |
| 132 | |
| 133 | ```yaml |
| 134 | [plugin:tc] |
| 135 | script to run to get tc values = /usr/libexec/netdata/plugins.d/tc-qos-helper.sh |
| 136 | enable show all classes and qdiscs for all interfaces = yes |
| 137 | |
| 138 | ``` |
| 139 | |
| 140 | |
| 141 | ## Alerts |
| 142 | |
| 143 | There are no alerts configured by default for this integration. |
| 144 | |
| 145 | |
| 146 | ## Metrics |
| 147 | |
| 148 | Metrics grouped by *scope*. |
| 149 | |
| 150 | The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. |
| 151 | |
| 152 | |
| 153 | |
| 154 | ### Per network device direction |
| 155 | |
| 156 | Metrics related to QoS network device directions. Each direction (in/out) produces its own set of the following metrics. |
| 157 | |
| 158 | Labels: |
| 159 | |
| 160 | | Label | Description | |
| 161 | |:-----------|:----------------| |
| 162 | | device | The network interface. | |
| 163 | | device_name | The network interface name | |
| 164 | | group | The device family | |
| 165 | |
| 166 | Metrics: |
| 167 | |
| 168 | | Metric | Dimensions | Unit | |
| 169 | |:------|:----------|:----| |
| 170 | | tc.qos | a dimension per class | kilobits/s | |
| 171 | | tc.qos_packets | a dimension per class | packets/s | |
| 172 | | tc.qos_dropped | a dimension per class | packets/s | |
| 173 | | tc.qos_tokens | a dimension per class | tokens | |
| 174 | | tc.qos_ctokens | a dimension per class | ctokens | |
| 175 | |
| 176 |