InfluxDB server monitoring

On this page

InfluxDB can display statistical and diagnostic information about each node.This information can be very useful for troubleshooting and performance monitoring.

SHOW STATS

To see node statistics, execute the command SHOW STATS.For details on this command, see SHOW STATS in the InfluxQL specification.

The statistics returned by SHOW STATS are stored in memory only, and are reset to zero when the node is restarted.

SHOW DIAGNOSTICS

To see node diagnostic information, execute the command SHOW DIAGNOSTICS.This returns information such as build information, uptime, hostname, server configuration, memory usage, and Go runtime diagnostics.For details on this command, see SHOW DIAGNOSTICS in the InfluxQL specification.

Internal monitoring

InfluxDB also writes statistical and diagnostic information to database named _internal, which records metrics on the internal runtime and service performance.The _internal database can be queried and manipulated like any other InfluxDB database.Check out the monitor service README and the internal monitoring blog post for more detail.

Useful performance metrics commands

Below are a collection of commands to find useful performance metrics about your InfluxDB instance.

To find the number of points per second being written to the instance. Must have the monitor service enabled:

  1. $ influx -execute 'select derivative(pointReq, 1s) from "write" where time > now() - 5m' -database '_internal' -precision 'rfc3339'

To find the number of writes separated by database since the beginnning of the log file:

  1. grep 'POST' /var/log/influxdb/influxd.log | awk '{ print $10 }' | sort | uniq -c

Or, for systemd systems logging to journald:

  1. journalctl -u influxdb.service | awk '/POST/ { print $10 }' | sort | uniq -c

InfluxDB /metrics HTTP endpoint

Note: There are no outstanding PRs for improvements to the /metrics endpoint, but we’ll add them to the CHANGELOG as they occur.

The InfluxDB /metrics endpoint is configured to produce the default Go metrics in Prometheus metrics format.

Example using InfluxDB `/metrics’ endpoint

Below is an example of the output generated using the /metrics endpoint. Note that HELP is available to explain the Go statistics.

  1. # HELP go_gc_duration_seconds A summary of the GC invocation durations.
  2. # TYPE go_gc_duration_seconds summary
  3. go_gc_duration_seconds{quantile="0"} 6.4134e-05
  4. go_gc_duration_seconds{quantile="0.25"} 8.8391e-05
  5. go_gc_duration_seconds{quantile="0.5"} 0.000131335
  6. go_gc_duration_seconds{quantile="0.75"} 0.000169204
  7. go_gc_duration_seconds{quantile="1"} 0.000544705
  8. go_gc_duration_seconds_sum 0.004619405
  9. go_gc_duration_seconds_count 27
  10. # HELP go_goroutines Number of goroutines that currently exist.
  11. # TYPE go_goroutines gauge
  12. go_goroutines 29
  13. # HELP go_info Information about the Go environment.
  14. # TYPE go_info gauge
  15. go_info{version="go1.10"} 1
  16. # HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.
  17. # TYPE go_memstats_alloc_bytes gauge
  18. go_memstats_alloc_bytes 1.581062048e+09
  19. # HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.
  20. # TYPE go_memstats_alloc_bytes_total counter
  21. go_memstats_alloc_bytes_total 2.808293616e+09
  22. # HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.
  23. # TYPE go_memstats_buck_hash_sys_bytes gauge
  24. go_memstats_buck_hash_sys_bytes 1.494326e+06
  25. # HELP go_memstats_frees_total Total number of frees.
  26. # TYPE go_memstats_frees_total counter
  27. go_memstats_frees_total 1.1279913e+07
  28. # HELP go_memstats_gc_cpu_fraction The fraction of this program's available CPU time used by the GC since the program started.
  29. # TYPE go_memstats_gc_cpu_fraction gauge
  30. go_memstats_gc_cpu_fraction -0.00014404354379774563
  31. # HELP go_memstats_gc_sys_bytes Number of bytes used for garbage collection system metadata.
  32. # TYPE go_memstats_gc_sys_bytes gauge
  33. go_memstats_gc_sys_bytes 6.0936192e+07
  34. # HELP go_memstats_heap_alloc_bytes Number of heap bytes allocated and still in use.
  35. # TYPE go_memstats_heap_alloc_bytes gauge
  36. go_memstats_heap_alloc_bytes 1.581062048e+09
  37. # HELP go_memstats_heap_idle_bytes Number of heap bytes waiting to be used.
  38. # TYPE go_memstats_heap_idle_bytes gauge
  39. go_memstats_heap_idle_bytes 3.8551552e+07
  40. # HELP go_memstats_heap_inuse_bytes Number of heap bytes that are in use.
  41. # TYPE go_memstats_heap_inuse_bytes gauge
  42. go_memstats_heap_inuse_bytes 1.590673408e+09
  43. # HELP go_memstats_heap_objects Number of allocated objects.
  44. # TYPE go_memstats_heap_objects gauge
  45. go_memstats_heap_objects 1.6924595e+07
  46. # HELP go_memstats_heap_released_bytes Number of heap bytes released to OS.
  47. # TYPE go_memstats_heap_released_bytes gauge
  48. go_memstats_heap_released_bytes 0
  49. # HELP go_memstats_heap_sys_bytes Number of heap bytes obtained from system.
  50. # TYPE go_memstats_heap_sys_bytes gauge
  51. go_memstats_heap_sys_bytes 1.62922496e+09
  52. # HELP go_memstats_last_gc_time_seconds Number of seconds since 1970 of last garbage collection.
  53. # TYPE go_memstats_last_gc_time_seconds gauge
  54. go_memstats_last_gc_time_seconds 1.520291233297057e+09
  55. # HELP go_memstats_lookups_total Total number of pointer lookups.
  56. # TYPE go_memstats_lookups_total counter
  57. go_memstats_lookups_total 397
  58. # HELP go_memstats_mallocs_total Total number of mallocs.
  59. # TYPE go_memstats_mallocs_total counter
  60. go_memstats_mallocs_total 2.8204508e+07
  61. # HELP go_memstats_mcache_inuse_bytes Number of bytes in use by mcache structures.
  62. # TYPE go_memstats_mcache_inuse_bytes gauge
  63. go_memstats_mcache_inuse_bytes 13888
  64. # HELP go_memstats_mcache_sys_bytes Number of bytes used for mcache structures obtained from system.
  65. # TYPE go_memstats_mcache_sys_bytes gauge
  66. go_memstats_mcache_sys_bytes 16384
  67. # HELP go_memstats_mspan_inuse_bytes Number of bytes in use by mspan structures.
  68. # TYPE go_memstats_mspan_inuse_bytes gauge
  69. go_memstats_mspan_inuse_bytes 1.4781696e+07
  70. # HELP go_memstats_mspan_sys_bytes Number of bytes used for mspan structures obtained from system.
  71. # TYPE go_memstats_mspan_sys_bytes gauge
  72. go_memstats_mspan_sys_bytes 1.4893056e+07
  73. # HELP go_memstats_next_gc_bytes Number of heap bytes when next garbage collection will take place.
  74. # TYPE go_memstats_next_gc_bytes gauge
  75. go_memstats_next_gc_bytes 2.38107752e+09
  76. # HELP go_memstats_other_sys_bytes Number of bytes used for other system allocations.
  77. # TYPE go_memstats_other_sys_bytes gauge
  78. go_memstats_other_sys_bytes 4.366786e+06
  79. # HELP go_memstats_stack_inuse_bytes Number of bytes in use by the stack allocator.
  80. # TYPE go_memstats_stack_inuse_bytes gauge
  81. go_memstats_stack_inuse_bytes 983040
  82. # HELP go_memstats_stack_sys_bytes Number of bytes obtained from system for stack allocator.
  83. # TYPE go_memstats_stack_sys_bytes gauge
  84. go_memstats_stack_sys_bytes 983040
  85. # HELP go_memstats_sys_bytes Number of bytes obtained from system.
  86. # TYPE go_memstats_sys_bytes gauge
  87. go_memstats_sys_bytes 1.711914744e+09
  88. # HELP go_threads Number of OS threads created.
  89. # TYPE go_threads gauge
  90. go_threads 16