跳到主要内容

Prometheus 指标

本页列出 OxiDNS 暴露的 Prometheus endpoint 和指标。只采集当前部署启用的子系统,缺少某项指标不一定表示故障。

Prometheus 指标

GET /api/metrics

当 API 启用时会注册该接口。该接口是唯一的 Prometheus 文本入口;插件不会额外暴露独立的 stats/metrics HTTP 接口。

当前导出的指标包括:

  • query_total
  • query_error_total
  • query_inflight
  • query_latency_count
  • query_latency_sum_ms
  • cache_lookup_total
  • cache_hit_total
  • cache_miss_total
  • cache_expired_total
  • cache_insert_total
  • cache_skip_total
  • cache_lazy_refresh_total
  • cache_entry_count
  • forward_query_total
  • forward_success_total
  • forward_error_total
  • forward_timeout_total
  • forward_latency_count
  • forward_latency_sum_ms
  • forward_incomplete_alias_selected_total
  • forward_upstream_query_total
  • forward_upstream_success_total
  • forward_upstream_error_total
  • forward_upstream_timeout_total
  • forward_upstream_latency_count
  • forward_upstream_latency_sum_ms
  • fallback_primary_total
  • fallback_primary_error_total
  • fallback_secondary_total
  • blackhole_block_total
  • hosts_hit_total
  • hosts_miss_total
  • ratelimit_allowed_total
  • ratelimit_rejected_total
  • ip_selector_probe_total
  • ip_selector_probe_latency_count
  • ip_selector_probe_latency_sum_ms
  • ip_selector_selected_total
  • ip_selector_dropped_probe_total
  • ip_selector_cache_entries
  • network_resolver_cache_hit_total
  • network_resolver_cache_miss_total
  • network_resolver_error_total
  • network_resolver_refresh_total
  • network_resolver_refresh_latency_ms_total
  • network_upstream_pool_refresh_total
  • network_upstream_pool_refresh_latency_ms_total
  • server_request_total
  • server_completed_total
  • server_controlled_total
  • server_failed_total
  • server_inflight
  • server_latency_count
  • server_latency_sum_ms
  • ipset_entries_total
  • ipset_dropped_total
  • ipset_write_total
  • ipset_write_error_total
  • nftset_entries_total
  • nftset_dropped_total
  • nftset_write_total
  • nftset_write_error_total
  • ros_address_list_observe_total
  • ros_address_list_dropped_total
  • ros_address_list_sync_error_total
  • ros_address_list_sync_timeout_total
  • ros_address_list_pending_observations / ros_address_list_managed_entries
  • ros_address_list_write_success_total / ros_address_list_write_error_total
  • ros_address_list_last_write_success_timestamp_seconds
  • ros_address_list_coalesced_total
  • ros_address_list_reconnect_total / ros_address_list_connect_attempt_total / ros_address_list_backoff_total
  • ros_address_list_reconcile_error_total / ros_address_list_last_reconcile_success_timestamp_seconds
  • ros_address_list_degraded / ros_address_list_cleanup_error_total
  • ros_route_observe_total / ros_route_dropped_total
  • ros_route_sync_error_total / ros_route_sync_timeout_total
  • ros_route_write_success_total / ros_route_write_error_total
  • ros_route_pending_observations / ros_route_managed_entries
  • ros_route_coalesced_total / ros_route_delete_deferred_total
  • ros_route_reconnect_total / ros_route_connect_attempt_total / ros_route_backoff_total
  • ros_route_connection_check_error_total / ros_route_reconcile_error_total
  • ros_route_last_write_success_timestamp_seconds / ros_route_last_reconcile_success_timestamp_seconds
  • ros_route_degraded / ros_route_cleanup_error_total
  • reverse_lookup_ptr_hit_total
  • reverse_lookup_ptr_miss_total
  • reverse_lookup_cache_insert_total
  • reverse_lookup_cache_entries
  • download_success_total
  • download_failure_total
  • download_timeout_total
  • http_request_dispatch_total
  • http_request_error_total
  • http_request_dropped_total
  • script_run_total
  • script_success_total
  • script_error_total
  • script_timeout_total
  • reload_trigger_total
  • reload_error_total
  • reload_provider_reload_total
  • reload_provider_reload_error_total
  • cron_job_run_total
  • cron_job_skipped_total
  • cron_executor_error_total

这些指标带有低基数插件级标签,例如 plugin_tagnamekindreasonresultprotocolserver_* 额外带有 protocoludp/tcp/dot/quic/doh)标签。forward_upstream_* 带有 upstream 标签,其取值为上游 tag(未配置时为解析后的地址);由于上游集合在启动时固定且数量有限,属于低基数维度。域名、客户端 IP 等高基数字段不会进入通用指标层;需要逐条查询明细时请使用 query_recorder