Skip to content

Instantly share code, notes, and snippets.

@david-martin
Created September 14, 2020 15:29
Show Gist options
  • Save david-martin/2742e815850827d1c86cf26f643886d0 to your computer and use it in GitHub Desktop.
Save david-martin/2742e815850827d1c86cf26f643886d0 to your computer and use it in GitHub Desktop.
oc -n openshift-monitoring exec prometheus-k8s-0 -c prometheus -- curl -g 'http://localhost:9090/api/v1/query?' --data-urlencode 'query=count by (__name__, job) ({__name__=~".+",job!=""})' | jq '.data.result | group_by(.metric.job) | [.[]|{(.[0].metric.job):[.[].metric.__name__]|sort}]' > /tmp/metrics.json
{
"prometheus-k8s": [
"count:up1",
"go_gc_duration_seconds",
"go_gc_duration_seconds_count",
"go_gc_duration_seconds_sum",
"go_goroutines",
"go_info",
"go_memstats_alloc_bytes",
"go_memstats_alloc_bytes_total",
"go_memstats_buck_hash_sys_bytes",
"go_memstats_frees_total",
"go_memstats_gc_cpu_fraction",
"go_memstats_gc_sys_bytes",
"go_memstats_heap_alloc_bytes",
"go_memstats_heap_idle_bytes",
"go_memstats_heap_inuse_bytes",
"go_memstats_heap_objects",
"go_memstats_heap_released_bytes",
"go_memstats_heap_sys_bytes",
"go_memstats_last_gc_time_seconds",
"go_memstats_lookups_total",
"go_memstats_mallocs_total",
"go_memstats_mcache_inuse_bytes",
"go_memstats_mcache_sys_bytes",
"go_memstats_mspan_inuse_bytes",
"go_memstats_mspan_sys_bytes",
"go_memstats_next_gc_bytes",
"go_memstats_other_sys_bytes",
"go_memstats_stack_inuse_bytes",
"go_memstats_stack_sys_bytes",
"go_memstats_sys_bytes",
"go_threads",
"net_conntrack_dialer_conn_attempted_total",
"net_conntrack_dialer_conn_closed_total",
"net_conntrack_dialer_conn_established_total",
"net_conntrack_dialer_conn_failed_total",
"net_conntrack_listener_conn_accepted_total",
"net_conntrack_listener_conn_closed_total",
"process_cpu_seconds_total",
"process_max_fds",
"process_open_fds",
"process_resident_memory_bytes",
"process_start_time_seconds",
"process_virtual_memory_bytes",
"process_virtual_memory_max_bytes",
"prometheus_api_remote_read_queries",
"prometheus_build_info",
"prometheus_config_last_reload_success_timestamp_seconds",
"prometheus_config_last_reload_successful",
"prometheus_engine_queries",
"prometheus_engine_queries_concurrent_max",
"prometheus_engine_query_duration_seconds",
"prometheus_engine_query_duration_seconds_count",
"prometheus_engine_query_duration_seconds_sum",
"prometheus_http_request_duration_seconds_bucket",
"prometheus_http_request_duration_seconds_count",
"prometheus_http_request_duration_seconds_sum",
"prometheus_http_requests_total",
"prometheus_http_response_size_bytes_bucket",
"prometheus_http_response_size_bytes_count",
"prometheus_http_response_size_bytes_sum",
"prometheus_notifications_alertmanagers_discovered",
"prometheus_notifications_dropped_total",
"prometheus_notifications_errors_total",
"prometheus_notifications_latency_seconds",
"prometheus_notifications_latency_seconds_count",
"prometheus_notifications_latency_seconds_sum",
"prometheus_notifications_queue_capacity",
"prometheus_notifications_queue_length",
"prometheus_notifications_sent_total",
"prometheus_remote_storage_highest_timestamp_in_seconds",
"prometheus_remote_storage_samples_in_total",
"prometheus_remote_storage_string_interner_zero_reference_releases_total",
"prometheus_rule_evaluation_duration_seconds",
"prometheus_rule_evaluation_duration_seconds_count",
"prometheus_rule_evaluation_duration_seconds_sum",
"prometheus_rule_evaluation_failures_total",
"prometheus_rule_evaluations_total",
"prometheus_rule_group_duration_seconds",
"prometheus_rule_group_duration_seconds_count",
"prometheus_rule_group_duration_seconds_sum",
"prometheus_rule_group_interval_seconds",
"prometheus_rule_group_iterations_missed_total",
"prometheus_rule_group_iterations_total",
"prometheus_rule_group_last_duration_seconds",
"prometheus_rule_group_last_evaluation_timestamp_seconds",
"prometheus_rule_group_rules",
"prometheus_sd_consul_rpc_duration_seconds",
"prometheus_sd_consul_rpc_duration_seconds_count",
"prometheus_sd_consul_rpc_duration_seconds_sum",
"prometheus_sd_consul_rpc_failures_total",
"prometheus_sd_discovered_targets",
"prometheus_sd_dns_lookup_failures_total",
"prometheus_sd_dns_lookups_total",
"prometheus_sd_failed_configs",
"prometheus_sd_file_read_errors_total",
"prometheus_sd_file_scan_duration_seconds",
"prometheus_sd_file_scan_duration_seconds_count",
"prometheus_sd_file_scan_duration_seconds_sum",
"prometheus_sd_kubernetes_events_total",
"prometheus_sd_kubernetes_http_request_duration_seconds_count",
"prometheus_sd_kubernetes_http_request_duration_seconds_sum",
"prometheus_sd_kubernetes_http_request_total",
"prometheus_sd_kubernetes_workqueue_depth",
"prometheus_sd_kubernetes_workqueue_items_total",
"prometheus_sd_kubernetes_workqueue_latency_seconds_count",
"prometheus_sd_kubernetes_workqueue_latency_seconds_sum",
"prometheus_sd_kubernetes_workqueue_longest_running_processor_seconds",
"prometheus_sd_kubernetes_workqueue_unfinished_work_seconds",
"prometheus_sd_kubernetes_workqueue_work_duration_seconds_count",
"prometheus_sd_kubernetes_workqueue_work_duration_seconds_sum",
"prometheus_sd_received_updates_total",
"prometheus_sd_updates_total",
"prometheus_target_interval_length_seconds",
"prometheus_target_interval_length_seconds_count",
"prometheus_target_interval_length_seconds_sum",
"prometheus_target_scrape_pool_reloads_failed_total",
"prometheus_target_scrape_pool_reloads_total",
"prometheus_target_scrape_pool_sync_total",
"prometheus_target_scrape_pools_failed_total",
"prometheus_target_scrape_pools_total",
"prometheus_target_scrapes_cache_flush_forced_total",
"prometheus_target_scrapes_exceeded_sample_limit_total",
"prometheus_target_scrapes_sample_duplicate_timestamp_total",
"prometheus_target_scrapes_sample_out_of_bounds_total",
"prometheus_target_scrapes_sample_out_of_order_total",
"prometheus_target_sync_length_seconds",
"prometheus_target_sync_length_seconds_count",
"prometheus_target_sync_length_seconds_sum",
"prometheus_template_text_expansion_failures_total",
"prometheus_template_text_expansions_total",
"prometheus_treecache_watcher_goroutines",
"prometheus_treecache_zookeeper_failures_total",
"prometheus_tsdb_blocks_loaded",
"prometheus_tsdb_checkpoint_creations_failed_total",
"prometheus_tsdb_checkpoint_creations_total",
"prometheus_tsdb_checkpoint_deletions_failed_total",
"prometheus_tsdb_checkpoint_deletions_total",
"prometheus_tsdb_compaction_chunk_range_seconds_bucket",
"prometheus_tsdb_compaction_chunk_range_seconds_count",
"prometheus_tsdb_compaction_chunk_range_seconds_sum",
"prometheus_tsdb_compaction_chunk_samples_bucket",
"prometheus_tsdb_compaction_chunk_samples_count",
"prometheus_tsdb_compaction_chunk_samples_sum",
"prometheus_tsdb_compaction_chunk_size_bytes_bucket",
"prometheus_tsdb_compaction_chunk_size_bytes_count",
"prometheus_tsdb_compaction_chunk_size_bytes_sum",
"prometheus_tsdb_compaction_duration_seconds_bucket",
"prometheus_tsdb_compaction_duration_seconds_count",
"prometheus_tsdb_compaction_duration_seconds_sum",
"prometheus_tsdb_compaction_populating_block",
"prometheus_tsdb_compactions_failed_total",
"prometheus_tsdb_compactions_total",
"prometheus_tsdb_compactions_triggered_total",
"prometheus_tsdb_head_active_appenders",
"prometheus_tsdb_head_chunks",
"prometheus_tsdb_head_chunks_created_total",
"prometheus_tsdb_head_chunks_removed_total",
"prometheus_tsdb_head_gc_duration_seconds_count",
"prometheus_tsdb_head_gc_duration_seconds_sum",
"prometheus_tsdb_head_max_time",
"prometheus_tsdb_head_max_time_seconds",
"prometheus_tsdb_head_min_time",
"prometheus_tsdb_head_min_time_seconds",
"prometheus_tsdb_head_samples_appended_total",
"prometheus_tsdb_head_series",
"prometheus_tsdb_head_series_created_total",
"prometheus_tsdb_head_series_not_found_total",
"prometheus_tsdb_head_series_removed_total",
"prometheus_tsdb_head_truncations_failed_total",
"prometheus_tsdb_head_truncations_total",
"prometheus_tsdb_lowest_timestamp",
"prometheus_tsdb_lowest_timestamp_seconds",
"prometheus_tsdb_reloads_failures_total",
"prometheus_tsdb_reloads_total",
"prometheus_tsdb_retention_limit_bytes",
"prometheus_tsdb_size_retentions_total",
"prometheus_tsdb_storage_blocks_bytes",
"prometheus_tsdb_symbol_table_size_bytes",
"prometheus_tsdb_time_retentions_total",
"prometheus_tsdb_tombstone_cleanup_seconds_bucket",
"prometheus_tsdb_tombstone_cleanup_seconds_count",
"prometheus_tsdb_tombstone_cleanup_seconds_sum",
"prometheus_tsdb_vertical_compactions_total",
"prometheus_tsdb_wal_completed_pages_total",
"prometheus_tsdb_wal_corruptions_total",
"prometheus_tsdb_wal_fsync_duration_seconds",
"prometheus_tsdb_wal_fsync_duration_seconds_count",
"prometheus_tsdb_wal_fsync_duration_seconds_sum",
"prometheus_tsdb_wal_page_flushes_total",
"prometheus_tsdb_wal_segment_current",
"prometheus_tsdb_wal_truncate_duration_seconds_count",
"prometheus_tsdb_wal_truncate_duration_seconds_sum",
"prometheus_tsdb_wal_truncations_failed_total",
"prometheus_tsdb_wal_truncations_total",
"promhttp_metric_handler_requests_in_flight",
"promhttp_metric_handler_requests_total",
"scrape_duration_seconds",
"scrape_samples_post_metric_relabeling",
"scrape_samples_scraped",
"scrape_series_added",
"up"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment