|
3 | 3 | The interrupts plugin gathers metrics about IRQs from `/proc/interrupts` and `/proc/softirqs`. |
4 | 4 |
|
5 | 5 | ### Configuration |
6 | | -``` |
| 6 | +```toml |
7 | 7 | [[inputs.interrupts]] |
8 | | - # To report cpus as tags instead of fields use cpu_as_tags |
9 | | - # cpu_as_tags = false |
10 | | - # |
| 8 | + ## When set to true, cpu metrics are tagged with the cpu. Otherwise cpu is |
| 9 | + ## stored as a field. |
| 10 | + ## |
| 11 | + ## The default is false for backwards compatibility, and will be changed to |
| 12 | + ## true in a future version. It is recommended to set to true on new |
| 13 | + ## deployments. |
| 14 | + # cpu_as_tag = false |
| 15 | + |
11 | 16 | ## To filter which IRQs to collect, make use of tagpass / tagdrop, i.e. |
12 | 17 | # [inputs.interrupts.tagdrop] |
13 | | - # irq = [ "NET_RX", "TASKLET" ] |
| 18 | + # irq = [ "NET_RX", "TASKLET" ] |
14 | 19 | ``` |
15 | 20 |
|
16 | | -### Measurements |
17 | | -There are two measurements reported by this plugin. |
18 | | -- `interrupts` gathers metrics from the `/proc/interrupts` file |
19 | | -- `soft_interrupts` gathers metrics from the `/proc/softirqs` file |
| 21 | +### Metrics |
| 22 | + |
| 23 | +There are two styles depending on the value of `cpu_as_tag`. |
| 24 | + |
| 25 | +With `cpu_as_tag = false`: |
| 26 | + |
| 27 | +- interrupts |
| 28 | + - tags: |
| 29 | + - irq (IRQ name) |
| 30 | + - type |
| 31 | + - device (name of the device that is located at the IRQ) |
| 32 | + - cpu |
| 33 | + - fields: |
| 34 | + - cpu (int, number of interrupts per cpu) |
| 35 | + - total (int, total number of interrupts) |
20 | 36 |
|
21 | | -### Fields |
22 | | -For cpu_as_tags=false (default): |
23 | | -- CPUx: the amount of interrupts for the IRQ handled by the CPU |
24 | | -- Total: sum of interrupts for the IRS for all CPUs |
25 | | -For cpu_as_tags=true (): |
26 | | -- Count: the amount of interrupts for the IRQ handled by CPU described in CPU tag |
| 37 | +- soft_interrupts |
| 38 | + - tags: |
| 39 | + - irq (IRQ name) |
| 40 | + - type |
| 41 | + - device (name of the device that is located at the IRQ) |
| 42 | + - cpu |
| 43 | + - fields: |
| 44 | + - cpu (int, number of interrupts per cpu) |
| 45 | + - total (int, total number of interrupts) |
27 | 46 |
|
28 | | -### Tags |
29 | | -- irq: the IRQ |
30 | | -- type: the type of interrupt |
31 | | -- device: the name of the device that is located at that IRQ |
32 | | -- cpu: the CPU (when cpus_as_tags=true) |
| 47 | +With `cpu_as_tag = true`: |
| 48 | + |
| 49 | +- interrupts |
| 50 | + - tags: |
| 51 | + - irq (IRQ name) |
| 52 | + - type |
| 53 | + - device (name of the device that is located at the IRQ) |
| 54 | + - cpu |
| 55 | + - fields: |
| 56 | + - count (int, number of interrupts) |
| 57 | + |
| 58 | +- soft_interrupts |
| 59 | + - tags: |
| 60 | + - irq (IRQ name) |
| 61 | + - type |
| 62 | + - device (name of the device that is located at the IRQ) |
| 63 | + - cpu |
| 64 | + - fields: |
| 65 | + - count (int, number of interrupts) |
33 | 66 |
|
34 | 67 | ### Example Output |
| 68 | + |
| 69 | +With `cpu_as_tag = false`: |
| 70 | +``` |
| 71 | +interrupts,irq=0,type=IO-APIC,device=2-edge\ timer,cpu=cpu0 count=23i 1489346531000000000 |
| 72 | +interrupts,irq=1,type=IO-APIC,device=1-edge\ i8042,cpu=cpu0 count=9i 1489346531000000000 |
| 73 | +interrupts,irq=30,type=PCI-MSI,device=65537-edge\ virtio1-input.0,cpu=cpu1 count=1i 1489346531000000000 |
| 74 | +soft_interrupts,irq=NET_RX,cpu=cpu0 count=280879i 1489346531000000000 |
35 | 75 | ``` |
36 | | -./telegraf --config ~/interrupts_config.conf --test |
37 | | -For cpus_as_tags=false (default): |
38 | | -* Plugin: inputs.interrupts, Collection 1 |
39 | | -> interrupts,irq=0,type=IO-APIC,device=2-edge\ timer,host=hostname,cpu=cpu0 count=23i 1489346531000000000 |
40 | | -> interrupts,irq=1,host=hostname,type=IO-APIC,device=1-edge\ i8042,cpu=cpu0 count=9i 1489346531000000000 |
41 | | -> interrupts,irq=30,type=PCI-MSI,device=65537-edge\ virtio1-input.0,host=hostname,cpu=cpu1 count=1i 1489346531000000000 |
42 | | -> soft_interrupts,irq=NET_RX,host=hostname,cpu=cpu0 count=280879i 1489346531000000000 |
43 | | -
|
44 | | -For cpus_as_tags=true: |
45 | | -> interrupts,cpu=cpu6,host=hostname,irq=PIW,type=Posted-interrupt\ wakeup\ event count=0i 1543539773000000000 |
46 | | -> interrupts,cpu=cpu7,host=hostname,irq=PIW,type=Posted-interrupt\ wakeup\ event count=0i 1543539773000000000 |
47 | | -> soft_interrupts,cpu=cpu0,host=hostname,irq=HI count=246441i 1543539773000000000 |
48 | | -> soft_interrupts,cpu=cpu1,host=hostname,irq=HI count=159154i 1543539773000000000 |
49 | 76 |
|
| 77 | +With `cpu_as_tag = true`: |
| 78 | +``` |
| 79 | +interrupts,cpu=cpu6,irq=PIW,type=Posted-interrupt\ wakeup\ event count=0i 1543539773000000000 |
| 80 | +interrupts,cpu=cpu7,irq=PIW,type=Posted-interrupt\ wakeup\ event count=0i 1543539773000000000 |
| 81 | +soft_interrupts,cpu=cpu0,irq=HI count=246441i 1543539773000000000 |
| 82 | +soft_interrupts,cpu=cpu1,irq=HI count=159154i 1543539773000000000 |
50 | 83 | ``` |
0 commit comments