Prometheus中如何查询所有的度量名称(metrics names)?

2 篇文章 0 订阅

Prometheus自带了Promql查询语言,可以查询丰富的数据内容。

笔者近期才开始接触Promql,相当于是这方面的菜鸟中的菜鸟,很想知道Prometheus采集的时序序列数据中,有哪些度量名称(即Metrics Names)?

经过实验,发现可以使用如下 url链接?

http://prometheusIP/api/v1/label/__name__/values

 上述网址中的prometheusIP替换为您具体的Prometheus部署安装的系统IP和端口号即可,可以直接在web浏览器中访问,也可以在系统终端中使用curl命令进行访问。例如Node Exporter所获得的Metrics Names会反馈如下:

{"status":"success","data":["ALERTS","ALERTS_FOR_STATE","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","node_arp_entries","node_boot_time_seconds","node_context_switches_total","node_cooling_device_cur_state","node_cooling_device_max_state","node_cpu_guest_seconds_total","node_cpu_seconds_total","node_disk_discard_time_seconds_total","node_disk_discarded_sectors_total","node_disk_discards_completed_total","node_disk_discards_merged_total","node_disk_io_now","node_disk_io_time_seconds_total","node_disk_io_time_weighted_seconds_total","node_disk_read_bytes_total","node_disk_read_time_seconds_total","node_disk_reads_completed_total","node_disk_reads_merged_total","node_disk_write_time_seconds_total","node_disk_writes_completed_total","node_disk_writes_merged_total","node_disk_written_bytes_total","node_entropy_available_bits","node_entropy_pool_size_bits","node_exporter_build_info","node_filefd_allocated","node_filefd_maximum","node_filesystem_avail_bytes","node_filesystem_device_error","node_filesystem_files","node_filesystem_files_free","node_filesystem_free_bytes","node_filesystem_readonly","node_filesystem_size_bytes","node_forks_total","node_intr_total","node_load1","node_load15","node_load5","node_memory_Active_anon_bytes","node_memory_Active_bytes","node_memory_Active_file_bytes","node_memory_AnonHugePages_bytes","node_memory_AnonPages_bytes","node_memory_Bounce_bytes","node_memory_Buffers_bytes","node_memory_Cached_bytes","node_memory_CommitLimit_bytes","node_memory_Committed_AS_bytes","node_memory_DirectMap1G_bytes","node_memory_DirectMap2M_bytes","node_memory_DirectMap4k_bytes","node_memory_Dirty_bytes","node_memory_FileHugePages_bytes","node_memory_FilePmdMapped_bytes","node_memory_HardwareCorrupted_bytes","node_memory_HugePages_Free","node_memory_HugePages_Rsvd","node_memory_HugePages_Surp","node_memory_HugePages_Total","node_memory_Hugepagesize_bytes","node_memory_Hugetlb_bytes","node_memory_Inactive_anon_bytes","node_memory_Inactive_bytes","node_memory_Inactive_file_bytes","node_memory_KReclaimable_bytes","node_memory_KernelStack_bytes","node_memory_Mapped_bytes","node_memory_MemAvailable_bytes","node_memory_MemFree_bytes","node_memory_MemTotal_bytes","node_memory_Mlocked_bytes","node_memory_NFS_Unstable_bytes","node_memory_PageTables_bytes","node_memory_Percpu_bytes","node_memory_SReclaimable_bytes","node_memory_SUnreclaim_bytes","node_memory_ShmemHugePages_bytes","node_memory_ShmemPmdMapped_bytes","node_memory_Shmem_bytes","node_memory_Slab_bytes","node_memory_SwapCached_bytes","node_memory_SwapFree_bytes","node_memory_SwapTotal_bytes","node_memory_Unevictable_bytes","node_memory_VmallocChunk_bytes","node_memory_VmallocTotal_bytes","node_memory_VmallocUsed_bytes","node_memory_WritebackTmp_bytes","node_memory_Writeback_bytes","node_netstat_Icmp6_InErrors","node_netstat_Icmp6_InMsgs","node_netstat_Icmp6_OutMsgs","node_netstat_Icmp_InErrors","node_netstat_Icmp_InMsgs","node_netstat_Icmp_OutMsgs","node_netstat_Ip6_InOctets","node_netstat_Ip6_OutOctets","node_netstat_IpExt_InOctets","node_netstat_IpExt_OutOctets","node_netstat_Ip_Forwarding","node_netstat_TcpExt_ListenDrops","node_netstat_TcpExt_ListenOverflows","node_netstat_TcpExt_SyncookiesFailed","node_netstat_TcpExt_SyncookiesRecv","node_netstat_TcpExt_SyncookiesSent","node_netstat_TcpExt_TCPSynRetrans","node_netstat_Tcp_ActiveOpens","node_netstat_Tcp_CurrEstab","node_netstat_Tcp_InErrs","node_netstat_Tcp_InSegs","node_netstat_Tcp_OutRsts","node_netstat_Tcp_OutSegs","node_netstat_Tcp_PassiveOpens","node_netstat_Tcp_RetransSegs","node_netstat_Udp6_InDatagrams","node_netstat_Udp6_InErrors","node_netstat_Udp6_NoPorts","node_netstat_Udp6_OutDatagrams","node_netstat_Udp6_RcvbufErrors","node_netstat_Udp6_SndbufErrors","node_netstat_UdpLite6_InErrors","node_netstat_UdpLite_InErrors","node_netstat_Udp_InDatagrams","node_netstat_Udp_InErrors","node_netstat_Udp_NoPorts","node_netstat_Udp_OutDatagrams","node_netstat_Udp_RcvbufErrors","node_netstat_Udp_SndbufErrors","node_network_address_assign_type","node_network_carrier","node_network_carrier_changes_total","node_network_carrier_down_changes_total","node_network_carrier_up_changes_total","node_network_device_id","node_network_dormant","node_network_flags","node_network_iface_id","node_network_iface_link","node_network_iface_link_mode","node_network_info","node_network_mtu_bytes","node_network_name_assign_type","node_network_net_dev_group","node_network_protocol_type","node_network_receive_bytes_total","node_network_receive_compressed_total","node_network_receive_drop_total","node_network_receive_errs_total","node_network_receive_fifo_total","node_network_receive_frame_total","node_network_receive_multicast_total","node_network_receive_packets_total","node_network_speed_bytes","node_network_transmit_bytes_total","node_network_transmit_carrier_total","node_network_transmit_colls_total","node_network_transmit_compressed_total","node_network_transmit_drop_total","node_network_transmit_errs_total","node_network_transmit_fifo_total","node_network_transmit_packets_total","node_network_transmit_queue_length","node_network_up","node_procs_blocked","node_procs_running","node_schedstat_running_seconds_total","node_schedstat_timeslices_total","node_schedstat_waiting_seconds_total","node_scrape_collector_duration_seconds","node_scrape_collector_success","node_sockstat_FRAG6_inuse","node_sockstat_FRAG6_memory","node_sockstat_FRAG_inuse","node_sockstat_FRAG_memory","node_sockstat_RAW6_inuse","node_sockstat_RAW_inuse","node_sockstat_TCP6_inuse","node_sockstat_TCP_alloc","node_sockstat_TCP_inuse","node_sockstat_TCP_mem","node_sockstat_TCP_mem_bytes","node_sockstat_TCP_orphan","node_sockstat_TCP_tw","node_sockstat_UDP6_inuse","node_sockstat_UDPLITE6_inuse","node_sockstat_UDPLITE_inuse","node_sockstat_UDP_inuse","node_sockstat_UDP_mem","node_sockstat_UDP_mem_bytes","node_sockstat_sockets_used","node_softnet_dropped_total","node_softnet_processed_total","node_softnet_times_squeezed_total","node_textfile_scrape_error","node_time_seconds","node_timex_estimated_error_seconds","node_timex_frequency_adjustment_ratio","node_timex_loop_time_constant","node_timex_maxerror_seconds","node_timex_offset_seconds","node_timex_pps_calibration_total","node_timex_pps_error_total","node_timex_pps_frequency_hertz","node_timex_pps_jitter_seconds","node_timex_pps_jitter_total","node_timex_pps_shift_seconds","node_timex_pps_stability_exceeded_total","node_timex_pps_stability_hertz","node_timex_status","node_timex_sync_status","node_timex_tai_offset_seconds","node_timex_tick_seconds","node_udp_queues","node_uname_info","node_vmstat_oom_kill","node_vmstat_pgfault","node_vmstat_pgmajfault","node_vmstat_pgpgin","node_vmstat_pgpgout","node_vmstat_pswpin","node_vmstat_pswpout","node_xfs_allocation_btree_compares_total","node_xfs_allocation_btree_lookups_total","node_xfs_allocation_btree_records_deleted_total","node_xfs_allocation_btree_records_inserted_total","node_xfs_block_map_btree_compares_total","node_xfs_block_map_btree_lookups_total","node_xfs_block_map_btree_records_deleted_total","node_xfs_block_map_btree_records_inserted_total","node_xfs_block_mapping_extent_list_compares_total","node_xfs_block_mapping_extent_list_deletions_total","node_xfs_block_mapping_extent_list_insertions_total","node_xfs_block_mapping_extent_list_lookups_total","node_xfs_block_mapping_reads_total","node_xfs_block_mapping_unmaps_total","node_xfs_block_mapping_writes_total","node_xfs_directory_operation_create_total","node_xfs_directory_operation_getdents_total","node_xfs_directory_operation_lookup_total","node_xfs_directory_operation_remove_total","node_xfs_extent_allocation_blocks_allocated_total","node_xfs_extent_allocation_blocks_freed_total","node_xfs_extent_allocation_extents_allocated_total","node_xfs_extent_allocation_extents_freed_total","node_xfs_inode_operation_attempts_total","node_xfs_inode_operation_attribute_changes_total","node_xfs_inode_operation_duplicates_total","node_xfs_inode_operation_found_total","node_xfs_inode_operation_missed_total","node_xfs_inode_operation_reclaims_total","node_xfs_inode_operation_recycled_total","node_xfs_read_calls_total","node_xfs_vnode_active_total","node_xfs_vnode_allocate_total","node_xfs_vnode_get_total","node_xfs_vnode_hold_total","node_xfs_vnode_reclaim_total","node_xfs_vnode_release_total","node_xfs_vnode_remove_total","node_xfs_write_calls_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","promhttp_metric_handler_errors_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"]}

 

 

  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值