github.com/waldiirawan/apm-agent-go/v2@v2.2.2/docs/metrics.asciidoc (about) 1 [[metrics]] 2 == Metrics 3 4 The Go agent periodically gathers and reports metrics. Control how 5 often metrics are reported with the <<config-metrics-interval>> configuration, 6 and disable metrics with <<config-disable-metrics>>. 7 8 [float] 9 [[metrics-system]] 10 === System metrics 11 12 The Go agent reports basic system-level and process-level CPU and memory metrics. 13 For more system metrics, consider installing {metricbeat-ref}/index.html[Metricbeat] 14 on your hosts. 15 16 As of Elastic Stack version 6.6, these metrics will be visualized in the APM app. 17 18 In some cases data from multiple nodes will be combined. As of Elastic Stack version 7.5, 19 you will be able to set a unique name for each node to avoid this problem. 20 Otherwise, data will be aggregated separately based on container ID or host name. 21 22 *`system.cpu.total.norm.pct`*:: 23 + 24 -- 25 type: scaled_float 26 27 format: percent 28 29 The percentage of CPU time in states other than Idle and IOWait, normalised by the number of cores. 30 -- 31 32 33 *`system.process.cpu.total.norm.pct`*:: 34 + 35 -- 36 type: scaled_float 37 38 format: percent 39 40 The percentage of CPU time spent by the process since the last event. 41 This value is normalized by the number of CPU cores and it ranges from 0 to 100%. 42 -- 43 44 45 *`system.memory.total`*:: 46 + 47 -- 48 type: long 49 50 format: bytes 51 52 Total memory. 53 -- 54 55 56 *`system.memory.actual.free`*:: 57 + 58 -- 59 type: long 60 61 format: bytes 62 63 The actual memory in bytes. It is calculated based on the OS. 64 On Linux it consists of the free memory plus caches and buffers. 65 On OSX it is a sum of free memory and the inactive memory. 66 On Windows, this value does not include memory consumed by system caches and buffers. 67 -- 68 69 70 *`system.process.memory.size`*:: 71 + 72 -- 73 type: long 74 75 format: bytes 76 77 The total virtual memory the process has. 78 -- 79 80 [float] 81 [[metrics-golang]] 82 === Go runtime metrics 83 84 The Go agent reports various Go runtime metrics. 85 86 NOTE: As of now, there are no built-in visualizations for these metrics, 87 so you will need to create custom Kibana dashboards for them. 88 89 *`golang.goroutines`*:: 90 + 91 -- 92 type: long 93 94 The number of goroutines that currently exist. 95 -- 96 97 98 *`golang.heap.allocations.mallocs`*:: 99 + 100 -- 101 type: long 102 103 The number of mallocs. 104 -- 105 106 107 *`golang.heap.allocations.frees`*:: 108 + 109 -- 110 type: long 111 112 The number of frees. 113 -- 114 115 116 *`golang.heap.allocations.objects`*:: 117 + 118 -- 119 type: long 120 121 The total number of allocated objects. 122 -- 123 124 125 *`golang.heap.allocations.total`*:: 126 + 127 -- 128 type: long 129 130 format: bytes 131 132 Bytes allocated (even if freed) throughout the lifetime. 133 -- 134 135 136 *`golang.heap.allocations.allocated`*:: 137 + 138 -- 139 type: long 140 141 format: bytes 142 143 Bytes allocated and not yet freed (same as Alloc from https://golang.org/pkg/runtime/#MemStats[runtime.MemStats]). 144 -- 145 146 147 *`golang.heap.allocations.idle`*:: 148 + 149 -- 150 type: long 151 152 format: bytes 153 154 Bytes in idle spans. 155 -- 156 157 158 *`golang.heap.allocations.active`*:: 159 + 160 -- 161 type: long 162 163 format: bytes 164 165 Bytes in non-idle spans. 166 -- 167 168 169 *`golang.heap.system.total`*:: 170 + 171 -- 172 type: long 173 174 format: bytes 175 176 Total bytes obtained from system (sum of XxxSys from https://golang.org/pkg/runtime/#MemStats[runtime.MemStats]). 177 -- 178 179 180 *`golang.heap.system.obtained`*:: 181 + 182 -- 183 type: long 184 185 format: bytes 186 187 Via HeapSys from https://golang.org/pkg/runtime/#MemStats[runtime.MemStats], bytes obtained from system. 188 heap_sys = heap_idle + heap_inuse. 189 -- 190 191 192 *`golang.heap.system.stack`*:: 193 + 194 -- 195 type: long 196 197 format: bytes 198 199 Bytes of stack memory obtained from the OS. 200 -- 201 202 203 *`golang.heap.system.released`*:: 204 + 205 -- 206 type: long 207 208 format: bytes 209 210 Bytes released to the OS. 211 -- 212 213 214 *`golang.heap.gc.total_pause.ns`*:: 215 + 216 -- 217 type: long 218 219 The total garbage collection duration in nanoseconds. 220 -- 221 222 223 *`golang.heap.gc.total_count`*:: 224 + 225 -- 226 type: long 227 228 The total number of garbage collections. 229 -- 230 231 232 *`golang.heap.gc.next_gc_limit`*:: 233 + 234 -- 235 type: long 236 237 format: bytes 238 239 Target heap size of the next garbage collection cycle. 240 -- 241 242 243 *`golang.heap.gc.cpu_fraction`*:: 244 + 245 -- 246 type: float 247 248 Fraction of CPU time used by garbage collection. 249 -- 250 251 [float] 252 [[metrics-application]] 253 === Application Metrics 254 255 *`transaction.duration`*:: 256 + 257 -- 258 type: simple timer 259 260 This timer tracks the duration of transactions and allows for the creation of graphs displaying a weighted average. 261 262 Fields: 263 264 * `sum.us`: The sum of all transaction durations in microseconds since the last report (the delta) 265 * `count`: The count of all transactions since the last report (the delta) 266 267 You can filter and group by these dimensions: 268 269 * `transaction.name`: The name of the transaction 270 * `transaction.type`: The type of the transaction, for example `request` 271 272 -- 273 274 *`transaction.breakdown.count`*:: 275 + 276 -- 277 type: long 278 279 format: count (delta) 280 281 The number of transactions for which breakdown metrics (`span.self_time`) have been created. 282 As the Go agent tracks the breakdown for both sampled and non-sampled transactions, this 283 metric is equivalent to `transaction.duration.count` 284 285 You can filter and group by these dimensions: 286 287 * `transaction.name`: The name of the transaction 288 * `transaction.type`: The type of the transaction, for example `request` 289 290 -- 291 292 *`span.self_time`*:: 293 + 294 -- 295 type: simple timer 296 297 This timer tracks the span self-times and is the basis of the transaction breakdown visualization. 298 299 Fields: 300 301 * `sum.us`: The sum of all span self-times in microseconds since the last report (the delta) 302 * `count`: The count of all span self-times since the last report (the delta) 303 304 You can filter and group by these dimensions: 305 306 * `transaction.name`: The name of the transaction 307 * `transaction.type`: The type of the transaction, for example `request` 308 * `span.type`: The type of the span, for example `app`, `template` or `db` 309 * `span.subtype`: The sub-type of the span, for example `mysql` (optional) 310 311 --