|
| 1 | + |
| 2 | + |
| 3 | +# Module prometheus_vm_msacc_collector # |
| 4 | +* [Description](#description) |
| 5 | + |
| 6 | +Collects microstate accounting metrics using |
| 7 | +[ |
| 8 | +erlang:statistics(microstate_accounting) |
| 9 | +](http://erlang.org/doc/man/erlang.md#statistics_microstate_accounting). |
| 10 | + |
| 11 | +__Behaviours:__ [`prometheus_collector`](prometheus_collector.md). |
| 12 | + |
| 13 | +<a name="description"></a> |
| 14 | + |
| 15 | +## Description ## |
| 16 | + |
| 17 | +In order for values to increase, microstate |
| 18 | +accounting must be enabled. This is done by |
| 19 | +calling `erlang:system_flag(microstate_accounting, true).` |
| 20 | + |
| 21 | + |
| 22 | +### <a name="Exported_metrics">Exported metrics</a> ### |
| 23 | + |
| 24 | +Some metrics are not available by default. They require a VM |
| 25 | +configured with `./configure --with-microstate-accounting=extra`. |
| 26 | + |
| 27 | +* `erlang_vm_msacc_aux_seconds_total`<br /> |
| 28 | +Type: counter.<br /> |
| 29 | +Total time in seconds spent handling auxiliary jobs. |
| 30 | + |
| 31 | +* `erlang_vm_msacc_check_io_seconds_total`<br /> |
| 32 | +Type: counter.<br /> |
| 33 | +Total time in seconds spent checking for new I/O events. |
| 34 | + |
| 35 | +* `erlang_vm_msacc_emulator_seconds_total`<br /> |
| 36 | +Type: counter.<br /> |
| 37 | +Total time in seconds spent executing Erlang processes. |
| 38 | + |
| 39 | +* `erlang_vm_msacc_gc_seconds_total`<br /> |
| 40 | +Type: counter.<br /> |
| 41 | +Total time in seconds spent doing garbage collection. |
| 42 | +When extra states are enabled this is the time spent |
| 43 | +doing non-fullsweep garbage collections. |
| 44 | + |
| 45 | +* `erlang_vm_msacc_other_seconds_total`<br /> |
| 46 | +Type: counter.<br /> |
| 47 | +Total time in seconds spent doing unaccounted things. |
| 48 | + |
| 49 | +* `erlang_vm_msacc_port_seconds_total`<br /> |
| 50 | +Type: counter.<br /> |
| 51 | +Total time in seconds spent executing ports. |
| 52 | + |
| 53 | +* `erlang_vm_msacc_sleep_seconds_total`<br /> |
| 54 | +Type: counter.<br /> |
| 55 | +Total time in seconds spent sleeping. |
| 56 | + |
| 57 | +* `erlang_vm_msacc_alloc_seconds_total`<br /> |
| 58 | +Type: counter.<br /> |
| 59 | +Total time in seconds spent managing memory. |
| 60 | +Without extra states this time is spread out over all other states. |
| 61 | + |
| 62 | +* `erlang_vm_msacc_bif_seconds_total`<br /> |
| 63 | +Type: counter.<br /> |
| 64 | +Total time in seconds spent in BIFs. |
| 65 | +Without extra states this time is part of the 'emulator' state. |
| 66 | + |
| 67 | +* `erlang_vm_msacc_busy_wait_seconds_total`<br /> |
| 68 | +Type: counter.<br /> |
| 69 | +Total time in seconds spent busy waiting. |
| 70 | +Without extra states this time is part of the 'other' state. |
| 71 | + |
| 72 | +* `erlang_vm_msacc_ets_seconds_total`<br /> |
| 73 | +Type: counter.<br /> |
| 74 | +Total time in seconds spent executing ETS BIFs. |
| 75 | +Without extra states this time is part of the 'emulator' state. |
| 76 | + |
| 77 | +* `erlang_vm_msacc_gc_full_seconds_total`<br /> |
| 78 | +Type: counter.<br /> |
| 79 | +Total time in seconds spent doing fullsweep garbage collection. |
| 80 | +Without extra states this time is part of the 'gc' state. |
| 81 | + |
| 82 | +* `erlang_vm_msacc_nif_seconds_total`<br /> |
| 83 | +Type: counter.<br /> |
| 84 | +Total time in seconds spent in NIFs. |
| 85 | +Without extra states this time is part of the 'emulator' state. |
| 86 | + |
| 87 | +* `erlang_vm_msacc_send_seconds_total`<br /> |
| 88 | +Type: counter.<br /> |
| 89 | +Total time in seconds spent sending messages (processes only). |
| 90 | +Without extra states this time is part of the 'emulator' state. |
| 91 | + |
| 92 | +* `erlang_vm_msacc_timers_seconds_total`<br /> |
| 93 | +Type: counter.<br /> |
| 94 | +Total time in seconds spent managing timers. |
| 95 | +Without extra states this time is part of the 'other' state. |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +### <a name="Configuration">Configuration</a> ### |
| 100 | + |
| 101 | +Metrics exported by this collector can be configured via |
| 102 | +`vm_msacc_collector_metrics` key of `prometheus` app environment. |
| 103 | + |
| 104 | +Options are the same as MSAcc_Thread_State return type from |
| 105 | +[ |
| 106 | +erlang:statistics(microstate_accounting) |
| 107 | +](http://erlang.org/doc/man/erlang.md#statistics_microstate_accounting) with `_seconds_total` as the suffix: |
| 108 | + |
| 109 | +* `aux_seconds_total` for `erlang_vm_msacc_aux_seconds_total`. |
| 110 | + |
| 111 | +* `check_io_seconds_total` for `erlang_vm_msacc_check_io_seconds_total`. |
| 112 | + |
| 113 | +* `emulator_seconds_total` for `erlang_vm_msacc_emulator_seconds_total`. |
| 114 | + |
| 115 | +* `gc_seconds_total` for `erlang_vm_msacc_gc_seconds_total`. |
| 116 | + |
| 117 | +* `other_seconds_total` for `erlang_vm_msacc_other_seconds_total`. |
| 118 | + |
| 119 | +* `port_seconds_total` for `erlang_vm_msacc_port_seconds_total`. |
| 120 | + |
| 121 | +* `sleep_seconds_total` for `erlang_vm_msacc_sleep_seconds_total`. |
| 122 | + |
| 123 | +* `alloc_seconds_total` for `erlang_vm_msacc_alloc_seconds_total`. |
| 124 | + |
| 125 | +* `bif_seconds_total` for `erlang_vm_msacc_bif_seconds_total`. |
| 126 | + |
| 127 | +* `busy_wait_seconds_total` for `erlang_vm_msacc_busy_wait_seconds_total`. |
| 128 | + |
| 129 | +* `ets_seconds_total` for `erlang_vm_msacc_ets_seconds_total`. |
| 130 | + |
| 131 | +* `gc_full_seconds_total` for `erlang_vm_msacc_gc_full_seconds_total`. |
| 132 | + |
| 133 | +* `nif_seconds_total` for `erlang_vm_msacc_nif_seconds_total`. |
| 134 | + |
| 135 | +* `send_seconds_total` for `erlang_vm_msacc_send_seconds_total`. |
| 136 | + |
| 137 | +* `timers_seconds_total` for `erlang_vm_msacc_timers_seconds_total`. |
| 138 | + |
| 139 | + |
| 140 | +By default all metrics are enabled as far as Prometheus is concerned, |
| 141 | +although some metrics could not be enabled by the VM itself. |
0 commit comments