-
Notifications
You must be signed in to change notification settings - Fork 0
/
collect-es-metrics.sh
executable file
·13 lines (7 loc) · 5.33 KB
/
collect-es-metrics.sh
1
2
3
4
5
6
7
METRICS="es_circuitbreaker_estimated_bytes es_circuitbreaker_limit_bytes es_circuitbreaker_overhead_ratio es_circuitbreaker_tripped_count es_cluster_datanodes_number es_cluster_inflight_fetch_number es_cluster_is_timedout_bool es_cluster_nodes_number es_cluster_pending_tasks_number es_cluster_routing_allocation_disk_threshold_enabled es_cluster_routing_allocation_disk_watermark_flood_stage_pct es_cluster_routing_allocation_disk_watermark_high_pct es_cluster_routing_allocation_disk_watermark_low_pct es_cluster_shards_active_percent es_cluster_shards_number es_cluster_status es_cluster_task_max_waiting_time_seconds es_fs_io_total_operations es_fs_io_total_read_bytes es_fs_io_total_read_operations es_fs_io_total_write_bytes es_fs_io_total_write_operations es_fs_least_usage_free_bytes es_fs_least_usage_total_bytes es_fs_most_usage_free_bytes es_fs_most_usage_total_bytes es_fs_path_available_bytes es_fs_path_free_bytes es_fs_path_total_bytes es_fs_total_available_bytes es_fs_total_free_bytes es_fs_total_total_bytes es_http_open_server_number es_http_open_total_count es_indices_completion_size_bytes es_indices_doc_deleted_number es_indices_doc_number es_indices_fielddata_evictions_count es_indices_fielddata_memory_size_bytes es_indices_flush_total_count es_indices_flush_total_time_seconds es_indices_get_count es_indices_get_current_number es_indices_get_exists_count es_indices_get_exists_time_seconds es_indices_get_missing_count es_indices_get_missing_time_seconds es_indices_get_time_seconds es_indices_indexing_delete_count es_indices_indexing_delete_current_number es_indices_get_exists_count es_indices_get_exists_time_seconds es_indices_get_missing_count es_indices_get_missing_time_seconds es_indices_get_time_seconds es_indices_indexing_delete_count es_indices_indexing_delete_current_number es_indices_indexing_delete_time_seconds es_indices_indexing_index_count es_indices_indexing_index_current_number es_indices_indexing_index_failed_count es_indices_indexing_index_time_seconds es_indices_indexing_is_throttled_bool es_indices_indexing_noop_update_count es_indices_indexing_throttle_time_seconds es_indices_merges_current_docs_number es_indices_merges_current_number es_indices_merges_current_size_bytes es_indices_merges_total_auto_throttle_bytes es_indices_merges_total_docs_count es_indices_merges_total_number es_indices_merges_total_size_bytes es_indices_merges_total_stopped_time_seconds es_indices_merges_total_throttled_time_seconds es_indices_merges_total_time_seconds es_indices_querycache_cache_count es_indices_querycache_cache_size_bytes es_indices_querycache_evictions_count es_indices_querycache_hit_count es_indices_querycache_memory_size_bytes es_indices_querycache_miss_number es_indices_querycache_total_number es_indices_recovery_current_number es_indices_recovery_throttle_time_seconds es_indices_refresh_listeners_number es_indices_refresh_total_count es_indices_refresh_total_time_seconds es_indices_requestcache_evictions_count es_indices_requestcache_hit_count es_indices_requestcache_memory_size_bytes es_indices_requestcache_miss_count es_indices_search_fetch_count es_indices_search_fetch_current_number es_indices_search_fetch_time_seconds es_indices_search_open_contexts_number es_indices_search_query_count es_indices_search_query_current_number es_indices_search_query_time_seconds es_indices_search_scroll_count es_indices_search_scroll_current_number es_indices_search_scroll_time_seconds es_indices_segments_memory_bytes es_indices_segments_number es_indices_store_size_bytes es_indices_suggest_count es_indices_suggest_current_number es_indices_suggest_time_seconds es_ingest_total_count es_ingest_total_current es_ingest_total_failed_count es_ingest_total_time_seconds es_jvm_bufferpool_number es_jvm_bufferpool_total_capacity_bytes es_jvm_bufferpool_used_bytes es_jvm_classes_loaded_number es_jvm_classes_total_loaded_number es_jvm_classes_unloaded_number es_jvm_gc_collection_count es_jvm_gc_collection_time_seconds es_jvm_mem_heap_committed_bytes es_jvm_mem_heap_max_bytes es_jvm_mem_heap_used_bytes es_jvm_mem_heap_used_percent es_jvm_mem_nonheap_committed_bytes es_jvm_mem_nonheap_used_bytes es_jvm_mem_pool_max_bytes es_jvm_mem_pool_peak_max_bytes es_jvm_mem_pool_peak_used_bytes es_jvm_mem_pool_used_bytes es_jvm_threads_number es_jvm_threads_peak_number es_jvm_uptime_seconds es_metrics_generate_time_seconds_count es_metrics_generate_time_seconds_sum es_node_role_bool es_os_cpu_percent es_os_load_average_fifteen_minutes es_os_load_average_five_minutes es_os_load_average_one_minute es_os_mem_free_bytes es_os_mem_free_percent es_os_mem_total_bytes es_os_mem_used_bytes es_os_mem_used_percent es_os_swap_free_bytes es_os_swap_total_bytes es_os_swap_used_bytes es_process_cpu_percent es_process_cpu_time_seconds es_process_file_descriptors_max_number es_process_file_descriptors_open_number es_process_mem_total_virtual_bytes es_script_cache_evictions_count es_script_compilations_count es_threadpool_tasks_number es_threadpool_threads_count es_threadpool_threads_number es_transport_rx_bytes_count es_transport_rx_packets_count es_transport_server_open_number es_transport_tx_bytes_count es_transport_tx_packets_count"
OUTDIR=metrics/es
PERIOD=${PERIOD:-6h}
mkdir -p $OUTDIR
for METRIC in $METRICS; do
oc exec -c prometheus -n openshift-monitoring prometheus-k8s-0 -- curl --data-urlencode "query=$METRIC[$PERIOD]" http://localhost:9090/api/v1/query > $OUTDIR/$METRIC
done