-
Notifications
You must be signed in to change notification settings - Fork 0
/
collect-etcd-metrics.sh
executable file
·7 lines (7 loc) · 5.07 KB
/
collect-etcd-metrics.sh
1
2
3
4
5
6
7
METRICS="etcd_cluster_version etcd_debugging_auth_revision etcd_debugging_disk_backend_commit_rebalance_duration_seconds_bucket etcd_debugging_disk_backend_commit_rebalance_duration_seconds_count etcd_debugging_disk_backend_commit_rebalance_duration_seconds_sum etcd_debugging_disk_backend_commit_spill_duration_seconds_bucket etcd_debugging_disk_backend_commit_spill_duration_seconds_count etcd_debugging_disk_backend_commit_spill_duration_seconds_sum etcd_debugging_disk_backend_commit_write_duration_seconds_bucket etcd_debugging_disk_backend_commit_write_duration_seconds_count etcd_debugging_disk_backend_commit_write_duration_seconds_sum etcd_debugging_lease_granted_total etcd_debugging_lease_renewed_total etcd_debugging_lease_revoked_total etcd_debugging_lease_ttl_total_bucket etcd_debugging_lease_ttl_total_count etcd_debugging_lease_ttl_total_sum etcd_debugging_mvcc_compact_revision etcd_debugging_mvcc_current_revision etcd_debugging_mvcc_db_compaction_keys_total etcd_debugging_mvcc_db_compaction_pause_duration_milliseconds_bucket etcd_debugging_mvcc_db_compaction_pause_duration_milliseconds_count etcd_debugging_mvcc_db_compaction_pause_duration_milliseconds_sum etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_bucket etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_count etcd_debugging_mvcc_db_compaction_total_duration_milliseconds_sum etcd_debugging_mvcc_db_total_size_in_bytes etcd_debugging_mvcc_delete_total etcd_debugging_mvcc_events_total etcd_debugging_mvcc_index_compaction_pause_duration_milliseconds_bucket etcd_debugging_mvcc_index_compaction_pause_duration_milliseconds_count etcd_debugging_mvcc_index_compaction_pause_duration_milliseconds_sum etcd_debugging_mvcc_keys_total etcd_debugging_mvcc_pending_events_total etcd_debugging_mvcc_put_total etcd_debugging_mvcc_range_total etcd_debugging_mvcc_slow_watcher_total etcd_debugging_mvcc_total_put_size_in_bytes etcd_debugging_mvcc_txn_total etcd_debugging_mvcc_watch_stream_total etcd_debugging_mvcc_watcher_total etcd_debugging_server_lease_expired_total etcd_debugging_snap_save_marshalling_duration_seconds_bucket etcd_debugging_snap_save_marshalling_duration_seconds_count etcd_debugging_snap_save_marshalling_duration_seconds_sum etcd_debugging_snap_save_total_duration_seconds_bucket etcd_debugging_snap_save_total_duration_seconds_count etcd_debugging_snap_save_total_duration_seconds_sum etcd_debugging_store_expires_total etcd_debugging_store_reads_total etcd_debugging_store_watch_requests_total etcd_debugging_store_watchers etcd_debugging_store_writes_total etcd_disk_backend_commit_duration_seconds_bucket etcd_disk_backend_commit_duration_seconds_count etcd_disk_backend_commit_duration_seconds_sum etcd_disk_backend_defrag_duration_seconds_bucket etcd_disk_backend_defrag_duration_seconds_count etcd_disk_backend_defrag_duration_seconds_sum etcd_disk_backend_snapshot_duration_seconds_bucket etcd_disk_backend_snapshot_duration_seconds_count etcd_disk_backend_snapshot_duration_seconds_sum etcd_disk_wal_fsync_duration_seconds_bucket etcd_disk_wal_fsync_duration_seconds_count etcd_disk_wal_fsync_duration_seconds_sum etcd_disk_wal_write_bytes_total etcd_grpc_proxy_cache_hits_total etcd_grpc_proxy_cache_keys_total etcd_grpc_proxy_cache_misses_total etcd_grpc_proxy_events_coalescing_total etcd_grpc_proxy_watchers_coalescing_total etcd_mvcc_db_open_read_transactions etcd_mvcc_db_total_size_in_bytes etcd_mvcc_db_total_size_in_use_in_bytes etcd_mvcc_delete_total etcd_mvcc_hash_duration_seconds_bucket etcd_mvcc_hash_duration_seconds_count etcd_mvcc_hash_duration_seconds_sum etcd_mvcc_hash_rev_duration_seconds_bucket etcd_mvcc_hash_rev_duration_seconds_count etcd_mvcc_hash_rev_duration_seconds_sum etcd_mvcc_put_total etcd_mvcc_range_total etcd_mvcc_txn_total etcd_network_client_grpc_received_bytes_total etcd_network_client_grpc_sent_bytes_total etcd_object_counts etcd_server_client_requests_total etcd_server_go_version etcd_server_has_leader etcd_server_health_failures etcd_server_health_success etcd_server_heartbeat_send_failures_total etcd_server_id etcd_server_is_leader etcd_server_is_learner etcd_server_leader_changes_seen_total etcd_server_learner_promote_successes etcd_server_proposals_applied_total etcd_server_proposals_committed_total etcd_server_proposals_failed_total etcd_server_proposals_pending etcd_server_quota_backend_bytes etcd_server_read_indexes_failed_total etcd_server_slow_apply_total etcd_server_slow_read_indexes_total etcd_server_snapshot_apply_in_progress_total etcd_server_version etcd_snap_db_fsync_duration_seconds_bucket etcd_snap_db_fsync_duration_seconds_count etcd_snap_db_fsync_duration_seconds_sum etcd_snap_db_save_total_duration_seconds_bucket etcd_snap_db_save_total_duration_seconds_count etcd_snap_db_save_total_duration_seconds_sum etcd_snap_fsync_duration_seconds_bucket etcd_snap_fsync_duration_seconds_count etcd_snap_fsync_duration_seconds_sum"
OUTDIR=metrics/etcd
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