Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently returns some basic erlang vm statistics in the prometheus text format. This is the first step towards RFC #93. Basic auth support is present out of the box. The user can edit the ['opscode-erchef']['stats_auth_enable'] flag to change this. The actual password is stored in opscode_erchef.stats_password in chef veil. A default password is generated if the user does not specify one before running chef-server-ctl reconfigure. The end-point is accessible at /_stats. You can use ?format=json or ?format=text to access the available metric in json or prometheus formats. The stats returned are documented at #1385. ``` # TYPE erlang_vm_memory_atom_bytes_total gauge # HELP erlang_vm_memory_atom_bytes_total The total amount of memory currently allocated for atoms. This memory is part of the memory presented as system memory. erlang_vm_memory_atom_bytes_total{usage="used"} 1455697 erlang_vm_memory_atom_bytes_total{usage="free"} 12848 # TYPE erlang_vm_memory_bytes_total gauge # HELP erlang_vm_memory_bytes_total The total amount of memory currently allocated. This is the same as the sum of the memory size for processes and system. erlang_vm_memory_bytes_total{kind="system"} 45984768 erlang_vm_memory_bytes_total{kind="processes"} 35098912 # TYPE erlang_vm_dets_tables gauge # HELP erlang_vm_dets_tables Erlang VM DETS Tables count erlang_vm_dets_tables 0 # TYPE erlang_vm_ets_tables gauge # HELP erlang_vm_ets_tables Erlang VM ETS Tables count erlang_vm_ets_tables 64 # TYPE erlang_vm_memory_processes_bytes_total gauge # HELP erlang_vm_memory_processes_bytes_total The total amount of memory currently allocated for the Erlang processes. erlang_vm_memory_processes_bytes_total{usage="used"} 35091312 erlang_vm_memory_processes_bytes_total{usage="free"} 7600 # TYPE erlang_vm_memory_system_bytes_total gauge # HELP erlang_vm_memory_system_bytes_total The total amount of memory currently allocated for the emulator that is not directly related to any Erlang process. Memory presented as processes is not included in this memory. erlang_vm_memory_system_bytes_total{usage="atom"} 1468545 erlang_vm_memory_system_bytes_total{usage="binary"} 803360 erlang_vm_memory_system_bytes_total{usage="code"} 33479913 erlang_vm_memory_system_bytes_total{usage="ets"} 2372400 erlang_vm_memory_system_bytes_total{usage="other"} 7860550 # TYPE erlang_vm_statistics_context_switches counter # HELP erlang_vm_statistics_context_switches Total number of context switches since the system started erlang_vm_statistics_context_switches 29549971 # TYPE erlang_vm_statistics_garbage_collection_number_of_gcs counter # HELP erlang_vm_statistics_garbage_collection_number_of_gcs Garbage collection: number of GCs erlang_vm_statistics_garbage_collection_number_of_gcs 1632986 # TYPE erlang_vm_statistics_garbage_collection_words_reclaimed counter # HELP erlang_vm_statistics_garbage_collection_words_reclaimed Garbage collection: words reclaimed erlang_vm_statistics_garbage_collection_words_reclaimed 12664754817 # TYPE erlang_vm_statistics_garbage_collection_bytes_reclaimed counter # HELP erlang_vm_statistics_garbage_collection_bytes_reclaimed Garbage collection: bytes reclaimed erlang_vm_statistics_garbage_collection_bytes_reclaimed 101318038536 # TYPE erlang_vm_statistics_bytes_received_total counter # HELP erlang_vm_statistics_bytes_received_total Total number of bytes received through ports erlang_vm_statistics_bytes_received_total 795724439 # TYPE erlang_vm_statistics_bytes_output_total counter # HELP erlang_vm_statistics_bytes_output_total Total number of bytes output to ports erlang_vm_statistics_bytes_output_total 604157373 # TYPE erlang_vm_statistics_reductions_total counter # HELP erlang_vm_statistics_reductions_total Total reductions erlang_vm_statistics_reductions_total 4946085703 # TYPE erlang_vm_statistics_run_queues_length_total gauge # HELP erlang_vm_statistics_run_queues_length_total Total length of the run-queues erlang_vm_statistics_run_queues_length_total 0 # TYPE erlang_vm_statistics_runtime_milliseconds counter # HELP erlang_vm_statistics_runtime_milliseconds The sum of the runtime for all threads in the Erlang runtime system. Can be greater than wall clock time erlang_vm_statistics_runtime_milliseconds 573750 # TYPE erlang_vm_statistics_wallclock_time_milliseconds counter # HELP erlang_vm_statistics_wallclock_time_milliseconds Information about wall clock. Same as erlang_vm_statistics_runtime_milliseconds except that real time is measured erlang_vm_statistics_wallclock_time_milliseconds 5495986 # TYPE erlang_vm_ets_limit gauge # HELP erlang_vm_ets_limit The maximum number of ETS tables allowed. erlang_vm_ets_limit 2053 # TYPE erlang_vm_logical_processors gauge # HELP erlang_vm_logical_processors The detected number of logical processors configured in the system. erlang_vm_logical_processors 4 # TYPE erlang_vm_logical_processors_available gauge # HELP erlang_vm_logical_processors_available The detected number of logical processors available to the Erlang runtime system. erlang_vm_logical_processors_available 4 # TYPE erlang_vm_logical_processors_online gauge # HELP erlang_vm_logical_processors_online The detected number of logical processors online on the system. erlang_vm_logical_processors_online 4 # TYPE erlang_vm_port_count gauge # HELP erlang_vm_port_count The number of ports currently existing at the local node. erlang_vm_port_count 61 # TYPE erlang_vm_port_limit gauge # HELP erlang_vm_port_limit The maximum number of simultaneously existing ports at the local node. erlang_vm_port_limit 65536 # TYPE erlang_vm_process_count gauge # HELP erlang_vm_process_count The number of processes currently existing at the local node. erlang_vm_process_count 395 # TYPE erlang_vm_process_limit gauge # HELP erlang_vm_process_limit The maximum number of simultaneously existing processes at the local node. erlang_vm_process_limit 262144 # TYPE erlang_vm_schedulers gauge # HELP erlang_vm_schedulers The number of scheduler threads used by the emulator. erlang_vm_schedulers 4 # TYPE erlang_vm_schedulers_online gauge # HELP erlang_vm_schedulers_online The number of schedulers online. erlang_vm_schedulers_online 4 # TYPE erlang_vm_smp_support untyped # HELP erlang_vm_smp_support 1 if the emulator has been compiled with SMP support, otherwise 0. erlang_vm_smp_support 1 # TYPE erlang_vm_threads untyped # HELP erlang_vm_threads 1 if the emulator has been compiled with thread support, otherwise 0. erlang_vm_threads 1 # TYPE erlang_vm_thread_pool_size gauge # HELP erlang_vm_thread_pool_size The number of async threads in the async thread pool used for asynchronous driver calls. erlang_vm_thread_pool_size 10 # TYPE erlang_vm_time_correction untyped # HELP erlang_vm_time_correction 1 if time correction is enabled, otherwise 0. erlang_vm_time_correction 1 # TYPE erchef_pooler_members_in_use gauge # HELP erchef_pooler_members_in_use Number of pool members currently being used. erchef_pooler_members_in_use{pool_name="sqerl"} 0 erchef_pooler_members_in_use{pool_name="oc_chef_authz_http"} 0 erchef_pooler_members_in_use{pool_name="chef_index_http"} 0 erchef_pooler_members_in_use{pool_name="chef_depsolver"} 0 # TYPE erchef_pooler_members_free gauge # HELP erchef_pooler_members_free Number of pool members currently available. erchef_pooler_members_free{pool_name="sqerl"} 20 erchef_pooler_members_free{pool_name="oc_chef_authz_http"} 25 erchef_pooler_members_free{pool_name="chef_index_http"} 25 erchef_pooler_members_free{pool_name="chef_depsolver"} 5 # TYPE erchef_pooler_members_max gauge # HELP erchef_pooler_members_max Max number of pool members allowed in the pool. erchef_pooler_members_max{pool_name="sqerl"} 20 erchef_pooler_members_max{pool_name="oc_chef_authz_http"} 100 erchef_pooler_members_max{pool_name="chef_index_http"} 100 erchef_pooler_members_max{pool_name="chef_depsolver"} 5 # TYPE erchef_pooler_queued_requestors gauge # HELP erchef_pooler_queued_requestors Number of requestors blocking to take a pool member. erchef_pooler_queued_requestors{pool_name="sqerl"} 0 erchef_pooler_queued_requestors{pool_name="oc_chef_authz_http"} 0 erchef_pooler_queued_requestors{pool_name="chef_index_http"} 0 erchef_pooler_queued_requestors{pool_name="chef_depsolver"} 0 # TYPE erchef_pooler_queued_requestors_max gauge # HELP erchef_pooler_queued_requestors_max Max number of requestors allowed to block on taking pool member. erchef_pooler_queued_requestors_max{pool_name="sqerl"} 20 erchef_pooler_queued_requestors_max{pool_name="oc_chef_authz_http"} 50 erchef_pooler_queued_requestors_max{pool_name="chef_index_http"} 50 erchef_pooler_queued_requestors_max{pool_name="chef_depsolver"} 50 # TYPE pg_stat_seq_scan counter # HELP pg_stat_seq_scan Number of sequential scans initiated pg_stat_seq_scan 5047095 # TYPE pg_stat_seq_tup_read counter # HELP pg_stat_seq_tup_read Number of live rows fetched by sequential scans pg_stat_seq_tup_read 415028001 # TYPE pg_stat_idx_scan counter # HELP pg_stat_idx_scan Number of index scans initiated pg_stat_idx_scan 23751732 # TYPE pg_stat_tup_fetch counter # HELP pg_stat_tup_fetch Number of live rows fetched by index scans pg_stat_tup_fetch 25953870 # TYPE pg_stat_n_tup_ins counter # HELP pg_stat_n_tup_ins Number of rows inserted pg_stat_n_tup_ins 52452 # TYPE pg_stat_n_tup_upd counter # HELP pg_stat_n_tup_upd Number of rows updated pg_stat_n_tup_upd 73461 # TYPE pg_stat_n_tup_del counter # HELP pg_stat_n_tup_del Number of rows deleted pg_stat_n_tup_del 31020 # TYPE pg_stat_n_live_tup gauge # HELP pg_stat_n_live_tup Estimated number of live rows pg_stat_n_live_tup 92355 # TYPE pg_stat_n_dead_tup gauge # HELP pg_stat_n_dead_tup Estimated number of dead rows pg_stat_n_dead_tup 29046 # TYPE pg_stat_heap_blocks_read counter # HELP pg_stat_heap_blocks_read Number of disk blocks read pg_stat_heap_blocks_read 69231 # TYPE pg_stat_heap_blocks_hit counter # HELP pg_stat_heap_blocks_hit Number of buffer hits pg_stat_heap_blocks_hit 38834925 # TYPE pg_stat_idx_blks_read counter # HELP pg_stat_idx_blks_read Number of disk blocks read from all indexes pg_stat_idx_blks_read 49632 # TYPE pg_stat_idx_blks_hit counter # HELP pg_stat_idx_blks_hit Number of buffer hits in all indexes pg_stat_idx_blks_hit 35615613 # TYPE pg_stat_toast_blks_read counter # HELP pg_stat_toast_blks_read Number of disk blocks read from TOAST tables pg_stat_toast_blks_read 1410 # TYPE pg_stat_toast_blks_hit counter # HELP pg_stat_toast_blks_hit Number of buffer hits in TOAST tables pg_stat_toast_blks_hit 2397 # TYPE pg_stat_tidx_blks_read counter # HELP pg_stat_tidx_blks_read Number of disk blocks read from TOAST tables pg_stat_tidx_blks_read 1410 # TYPE pg_stat_tidx_blks_hit counter # HELP pg_stat_tidx_blks_hit Number of buffer hits in TOAST table indexes pg_stat_tidx_blks_hit 3948 ``` Same stats in JSON format: ``` [ { "metrics" : [ { "value" : "1" } ], "type" : "UNTYPED", "name" : "erlang_vm_time_correction", "help" : "1 if time correction is enabled, otherwise 0." }, { "metrics" : [ { "value" : "10" } ], "type" : "GAUGE", "help" : "The number of async threads in the async thread pool used for asynchronous driver calls.", "name" : "erlang_vm_thread_pool_size" }, { "type" : "UNTYPED", "metrics" : [ { "value" : "1" } ], "help" : "1 if the emulator has been compiled with thread support, otherwise 0.", "name" : "erlang_vm_threads" }, { "help" : "1 if the emulator has been compiled with SMP support, otherwise 0.", "name" : "erlang_vm_smp_support", "type" : "UNTYPED", "metrics" : [ { "value" : "1" } ] }, { "help" : "The number of schedulers online.", "name" : "erlang_vm_schedulers_online", "metrics" : [ { "value" : "4" } ], "type" : "GAUGE" }, { "type" : "GAUGE", "metrics" : [ { "value" : "4" } ], "name" : "erlang_vm_schedulers", "help" : "The number of scheduler threads used by the emulator." }, { "name" : "erlang_vm_process_limit", "help" : "The maximum number of simultaneously existing processes at the local node.", "type" : "GAUGE", "metrics" : [ { "value" : "262144" } ] }, { "metrics" : [ { "value" : "395" } ], "type" : "GAUGE", "help" : "The number of processes currently existing at the local node.", "name" : "erlang_vm_process_count" }, { "metrics" : [ { "value" : "65536" } ], "type" : "GAUGE", "name" : "erlang_vm_port_limit", "help" : "The maximum number of simultaneously existing ports at the local node." }, { "type" : "GAUGE", "metrics" : [ { "value" : "60" } ], "name" : "erlang_vm_port_count", "help" : "The number of ports currently existing at the local node." }, { "metrics" : [ { "value" : "4" } ], "type" : "GAUGE", "help" : "The detected number of logical processors online on the system.", "name" : "erlang_vm_logical_processors_online" }, { "type" : "GAUGE", "metrics" : [ { "value" : "4" } ], "help" : "The detected number of logical processors available to the Erlang runtime system.", "name" : "erlang_vm_logical_processors_available" }, { "help" : "The detected number of logical processors configured in the system.", "name" : "erlang_vm_logical_processors", "type" : "GAUGE", "metrics" : [ { "value" : "4" } ] }, { "metrics" : [ { "value" : "2053" } ], "type" : "GAUGE", "name" : "erlang_vm_ets_limit", "help" : "The maximum number of ETS tables allowed." }, { "metrics" : [ { "value" : "21716981" } ], "type" : "COUNTER", "help" : "Information about wall clock. Same as erlang_vm_statistics_runtime_milliseconds except that real time is measured", "name" : "erlang_vm_statistics_wallclock_time_milliseconds" }, { "type" : "COUNTER", "metrics" : [ { "value" : "2089510" } ], "name" : "erlang_vm_statistics_runtime_milliseconds", "help" : "The sum of the runtime for all threads in the Erlang runtime system. Can be greater than wall clock time" }, { "type" : "GAUGE", "metrics" : [ { "value" : "0" } ], "help" : "Total length of the run-queues", "name" : "erlang_vm_statistics_run_queues_length_total" }, { "type" : "COUNTER", "metrics" : [ { "value" : "16208617229" } ], "name" : "erlang_vm_statistics_reductions_total", "help" : "Total reductions" }, { "name" : "erlang_vm_statistics_bytes_output_total", "help" : "Total number of bytes output to ports", "metrics" : [ { "value" : "2374560576" } ], "type" : "COUNTER" }, { "metrics" : [ { "value" : "2375163718" } ], "type" : "COUNTER", "help" : "Total number of bytes received through ports", "name" : "erlang_vm_statistics_bytes_received_total" }, { "metrics" : [ { "value" : "359118308568" } ], "type" : "COUNTER", "help" : "Garbage collection: bytes reclaimed", "name" : "erlang_vm_statistics_garbage_collection_bytes_reclaimed" }, { "help" : "Garbage collection: words reclaimed", "name" : "erlang_vm_statistics_garbage_collection_words_reclaimed", "type" : "COUNTER", "metrics" : [ { "value" : "44889788571" } ] }, { "help" : "Garbage collection: number of GCs", "name" : "erlang_vm_statistics_garbage_collection_number_of_gcs", "type" : "COUNTER", "metrics" : [ { "value" : "5263551" } ] }, { "name" : "erlang_vm_statistics_context_switches", "help" : "Total number of context switches since the system started", "type" : "COUNTER", "metrics" : [ { "value" : "109981973" } ] }, { "help" : "The total amount of memory currently allocated for the emulator that is not directly related to any Erlang process. Memory presented as processes is not included in this memory.", "name" : "erlang_vm_memory_system_bytes_total", "type" : "GAUGE", "metrics" : [ { "value" : "1468545", "labels" : { "usage" : "atom" } }, { "labels" : { "usage" : "binary" }, "value" : "942728" }, { "value" : "33503265", "labels" : { "usage" : "code" } }, { "value" : "2496320", "labels" : { "usage" : "ets" } }, { "value" : "8025046", "labels" : { "usage" : "other" } } ] }, { "help" : "The total amount of memory currently allocated for the Erlang processes.", "name" : "erlang_vm_memory_processes_bytes_total", "type" : "GAUGE", "metrics" : [ { "value" : "24208976", "labels" : { "usage" : "used" } }, { "labels" : { "usage" : "free" }, "value" : "21304" } ] }, { "metrics" : [ { "value" : "66" } ], "type" : "GAUGE", "help" : "Erlang VM ETS Tables count", "name" : "erlang_vm_ets_tables" }, { "name" : "erlang_vm_dets_tables", "help" : "Erlang VM DETS Tables count", "type" : "GAUGE", "metrics" : [ { "value" : "0" } ] }, { "metrics" : [ { "labels" : { "kind" : "system" }, "value" : "46435904" }, { "value" : "24230280", "labels" : { "kind" : "processes" } } ], "type" : "GAUGE", "help" : "The total amount of memory currently allocated. This is the same as the sum of the memory size for processes and system.", "name" : "erlang_vm_memory_bytes_total" }, { "name" : "erlang_vm_memory_atom_bytes_total", "help" : "The total amount of memory currently allocated for atoms. This memory is part of the memory presented as system memory.", "type" : "GAUGE", "metrics" : [ { "labels" : { "usage" : "used" }, "value" : "1455537" }, { "value" : "13008", "labels" : { "usage" : "free" } } ] }, { "help" : "Max number of requestors allowed to block on taking pool member.", "name" : "erchef_pooler_queued_requestors_max", "type" : "GAUGE", "metrics" : [ { "value" : "20", "labels" : { "pool_name" : "sqerl" } }, { "value" : "50", "labels" : { "pool_name" : "oc_chef_authz_http" } }, { "labels" : { "pool_name" : "chef_index_http" }, "value" : "50" }, { "value" : "50", "labels" : { "pool_name" : "chef_depsolver" } } ] }, { "metrics" : [ { "value" : "0", "labels" : { "pool_name" : "sqerl" } }, { "value" : "0", "labels" : { "pool_name" : "oc_chef_authz_http" } }, { "labels" : { "pool_name" : "chef_index_http" }, "value" : "0" }, { "value" : "0", "labels" : { "pool_name" : "chef_depsolver" } } ], "type" : "GAUGE", "help" : "Number of requestors blocking to take a pool member.", "name" : "erchef_pooler_queued_requestors" }, { "name" : "erchef_pooler_members_max", "help" : "Max number of pool members allowed in the pool.", "type" : "GAUGE", "metrics" : [ { "labels" : { "pool_name" : "sqerl" }, "value" : "20" }, { "value" : "100", "labels" : { "pool_name" : "oc_chef_authz_http" } }, { "labels" : { "pool_name" : "chef_index_http" }, "value" : "100" }, { "labels" : { "pool_name" : "chef_depsolver" }, "value" : "5" } ] }, { "name" : "erchef_pooler_members_free", "help" : "Number of pool members currently available.", "type" : "GAUGE", "metrics" : [ { "value" : "20", "labels" : { "pool_name" : "sqerl" } }, { "value" : "25", "labels" : { "pool_name" : "oc_chef_authz_http" } }, { "value" : "25", "labels" : { "pool_name" : "chef_index_http" } }, { "labels" : { "pool_name" : "chef_depsolver" }, "value" : "5" } ] }, { "metrics" : [ { "value" : "0", "labels" : { "pool_name" : "sqerl" } }, { "value" : "0", "labels" : { "pool_name" : "oc_chef_authz_http" } }, { "value" : "0", "labels" : { "pool_name" : "chef_index_http" } }, { "value" : "0", "labels" : { "pool_name" : "chef_depsolver" } } ], "type" : "GAUGE", "name" : "erchef_pooler_members_in_use", "help" : "Number of pool members currently being used." }, { "name" : "pg_stat_tidx_blks_hit", "help" : "Number of buffer hits in TOAST table indexes", "type" : "COUNTER", "metrics" : [ { "value" : "6486" } ] }, { "help" : "Number of disk blocks read from TOAST tables", "name" : "pg_stat_tidx_blks_read", "type" : "COUNTER", "metrics" : [ { "value" : "1410" } ] }, { "help" : "Number of buffer hits in TOAST tables", "name" : "pg_stat_toast_blks_hit", "metrics" : [ { "value" : "3666" } ], "type" : "COUNTER" }, { "help" : "Number of disk blocks read from TOAST tables", "name" : "pg_stat_toast_blks_read", "type" : "COUNTER", "metrics" : [ { "value" : "1410" } ] }, { "name" : "pg_stat_idx_blks_hit", "help" : "Number of buffer hits in all indexes", "type" : "COUNTER", "metrics" : [ { "value" : "72120936" } ] }, { "metrics" : [ { "value" : "49632" } ], "type" : "COUNTER", "name" : "pg_stat_idx_blks_read", "help" : "Number of disk blocks read from all indexes" }, { "metrics" : [ { "value" : "85697544" } ], "type" : "COUNTER", "name" : "pg_stat_heap_blocks_hit", "help" : "Number of buffer hits" }, { "help" : "Number of disk blocks read", "name" : "pg_stat_heap_blocks_read", "type" : "COUNTER", "metrics" : [ { "value" : "69513" } ] }, { "metrics" : [ { "value" : "29610" } ], "type" : "GAUGE", "help" : "Estimated number of dead rows", "name" : "pg_stat_n_dead_tup" }, { "type" : "GAUGE", "metrics" : [ { "value" : "92355" } ], "help" : "Estimated number of live rows", "name" : "pg_stat_n_live_tup" }, { "type" : "COUNTER", "metrics" : [ { "value" : "31020" } ], "name" : "pg_stat_n_tup_del", "help" : "Number of rows deleted" }, { "help" : "Number of rows updated", "name" : "pg_stat_n_tup_upd", "metrics" : [ { "value" : "87702" } ], "type" : "COUNTER" }, { "metrics" : [ { "value" : "52452" } ], "type" : "COUNTER", "help" : "Number of rows inserted", "name" : "pg_stat_n_tup_ins" }, { "help" : "Number of live rows fetched by index scans", "name" : "pg_stat_tup_fetch", "type" : "COUNTER", "metrics" : [ { "value" : "44669364" } ] }, { "type" : "COUNTER", "metrics" : [ { "value" : "48594381" } ], "name" : "pg_stat_idx_scan", "help" : "Number of index scans initiated" }, { "name" : "pg_stat_seq_tup_read", "help" : "Number of live rows fetched by sequential scans", "type" : "COUNTER", "metrics" : [ { "value" : "1167619731" } ] }, { "help" : "Number of sequential scans initiated", "name" : "pg_stat_seq_scan", "metrics" : [ { "value" : "9793719" } ], "type" : "COUNTER" } ] ``` Signed-off-by: Kartik Null Cating-Subramanian <[email protected]>
- Loading branch information