Documentation ¶
Index ¶
- Constants
- Variables
- func PrintSample(sample *model.Sample) string
- type ApiServerMetrics
- type ControllerManagerMetrics
- type KubeletMetrics
- type Metrics
- type MetricsCollection
- type MetricsGrabber
- func (g *MetricsGrabber) Grab(unknownMetrics sets.String) (MetricsCollection, error)
- func (g *MetricsGrabber) GrabFromApiServer(unknownMetrics sets.String) (ApiServerMetrics, error)
- func (g *MetricsGrabber) GrabFromControllerManager(unknownMetrics sets.String) (ControllerManagerMetrics, error)
- func (g *MetricsGrabber) GrabFromKubelet(nodeName string) (KubeletMetrics, error)
- func (g *MetricsGrabber) GrabFromScheduler(unknownMetrics sets.String) (SchedulerMetrics, error)
- type SchedulerMetrics
Constants ¶
View Source
const (
ProxyTimeout = 2 * time.Minute
)
Variables ¶
View Source
var CommonMetrics = map[string][]string{
"get_token_count": {},
"get_token_fail_count": {},
"go_gc_duration_seconds": {"quantile"},
"go_gc_duration_seconds_count": {},
"go_gc_duration_seconds_sum": {},
"go_goroutines": {},
"http_request_duration_microseconds": {"handler", "quantile"},
"http_request_duration_microseconds_count": {"handler"},
"http_request_duration_microseconds_sum": {"handler"},
"http_request_size_bytes": {"handler", "quantile"},
"http_request_size_bytes_count": {"handler"},
"http_request_size_bytes_sum": {"handler"},
"http_requests_total": {"handler", "method", "code"},
"http_response_size_bytes": {"handler", "quantile"},
"http_response_size_bytes_count": {"handler"},
"http_response_size_bytes_sum": {"handler"},
"kubernetes_build_info": {"major", "minor", "gitCommit", "gitTreeState", "gitVersion", "buildDate", "goVersion", "compiler", "platform"},
"process_cpu_seconds_total": {},
"process_max_fds": {},
"process_open_fds": {},
"process_resident_memory_bytes": {},
"process_start_time_seconds": {},
"process_virtual_memory_bytes": {},
"ssh_tunnel_open_count": {},
"ssh_tunnel_open_fail_count": {},
}
View Source
var KnownApiServerMetrics = map[string][]string{
"apiserver_request_count": {"verb", "resource", "client", "contentType", "code"},
"apiserver_request_latencies_bucket": {"verb", "resource", "le"},
"apiserver_request_latencies_count": {"verb", "resource"},
"apiserver_request_latencies_sum": {"verb", "resource"},
"apiserver_request_latencies_summary": {"verb", "resource", "quantile"},
"apiserver_request_latencies_summary_count": {"verb", "resource"},
"apiserver_request_latencies_summary_sum": {"verb", "resource"},
"authenticated_user_requests": {"username"},
"etcd_helper_cache_entry_count": {},
"etcd_helper_cache_hit_count": {},
"etcd_helper_cache_miss_count": {},
"etcd_request_cache_add_latencies_summary": {"quantile"},
"etcd_request_cache_add_latencies_summary_count": {},
"etcd_request_cache_add_latencies_summary_sum": {},
"etcd_request_cache_get_latencies_summary": {"quantile"},
"etcd_request_cache_get_latencies_summary_count": {},
"etcd_request_cache_get_latencies_summary_sum": {},
"etcd_request_latencies_summary": {"operation", "type", "quantile"},
"etcd_request_latencies_summary_count": {"operation", "type"},
"etcd_request_latencies_summary_sum": {"operation", "type"},
"rest_client_request_latency_microseconds": {"url", "verb", "quantile"},
"rest_client_request_latency_microseconds_count": {"url", "verb"},
"rest_client_request_latency_microseconds_sum": {"url", "verb"},
"rest_client_request_status_codes": {"code", "host", "method"},
}
View Source
var KnownControllerManagerMetrics = map[string][]string{
"etcd_helper_cache_entry_count": {},
"etcd_helper_cache_hit_count": {},
"etcd_helper_cache_miss_count": {},
"etcd_request_cache_add_latencies_summary": {"quantile"},
"etcd_request_cache_add_latencies_summary_count": {},
"etcd_request_cache_add_latencies_summary_sum": {},
"etcd_request_cache_get_latencies_summary": {"quantile"},
"etcd_request_cache_get_latencies_summary_count": {},
"etcd_request_cache_get_latencies_summary_sum": {},
"get_token_count": {},
"get_token_fail_count": {},
"rest_client_request_latency_microseconds": {"url", "verb", "quantile"},
"rest_client_request_latency_microseconds_count": {"url", "verb"},
"rest_client_request_latency_microseconds_sum": {"url", "verb"},
"rest_client_request_status_codes": {"method", "code", "host"},
"pv_recycler_controller_rate_limiter_use": {},
"node_controller_rate_limiter_use": {},
"serviceaccount_controller_rate_limiter_use": {},
"route_controller_rate_limiter_use": {},
"resource_quota_controller_rate_limiter_use": {},
"replenishment_controller_rate_limiter_use": {},
"job_controller_rate_limiter_use": {},
"gc_controller_rate_limiter_use": {},
"endpoint_controller_rate_limiter_use": {},
"replication_controller_rate_limiter_use": {},
"replicaset_controller_rate_limiter_use": {},
"deployment_controller_rate_limiter_use": {},
"service_controller_rate_limiter_use": {},
"pv_claim_binder_controller_rate_limiter_use": {},
"namespace_controller_rate_limiter_use": {},
"daemon_controller_rate_limiter_use": {},
}
View Source
var KnownSchedulerMetrics = map[string][]string{
"rest_client_request_latency_microseconds": {"url", "verb", "quantile"},
"rest_client_request_latency_microseconds_count": {"url", "verb"},
"rest_client_request_latency_microseconds_sum": {"url", "verb"},
"rest_client_request_status_codes": {"code", "host", "method"},
"scheduler_binding_latency_microseconds_bucket": {"le"},
"scheduler_binding_latency_microseconds_count": {},
"scheduler_binding_latency_microseconds_sum": {},
"scheduler_e2e_scheduling_latency_microseconds_bucket": {"le"},
"scheduler_e2e_scheduling_latency_microseconds_count": {},
"scheduler_e2e_scheduling_latency_microseconds_sum": {},
"scheduler_scheduling_algorithm_latency_microseconds_bucket": {"le"},
"scheduler_scheduling_algorithm_latency_microseconds_count": {},
"scheduler_scheduling_algorithm_latency_microseconds_sum": {},
}
View Source
var KubeletMetricsLabelsToSkip = sets.NewString(
"kubernetes_namespace",
"image",
"name",
)
View Source
var NecessaryKubeletMetrics = map[string][]string{
"cadvisor_version_info": {"cadvisorRevision", "cadvisorVersion", "dockerVersion", "kernelVersion", "osVersion"},
"container_cpu_system_seconds_total": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_cpu_usage_seconds_total": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name", "cpu"},
"container_cpu_user_seconds_total": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_io_current": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_io_time_seconds_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_io_time_weighted_seconds_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_limit_bytes": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_read_seconds_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_reads_merged_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_reads_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_sector_reads_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_sector_writes_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_usage_bytes": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_write_seconds_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_writes_merged_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_fs_writes_total": {"device", "id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_last_seen": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_memory_cache": {},
"container_memory_rss": {},
"container_memory_failcnt": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_memory_failures_total": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name", "scope", "type"},
"container_memory_usage_bytes": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_memory_working_set_bytes": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_network_receive_bytes_total": {"id", "interface", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_network_receive_errors_total": {"id", "image", "interface", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_network_receive_packets_dropped_total": {"id", "image", "interface", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_network_receive_packets_total": {"id", "image", "interface", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_network_transmit_bytes_total": {"id", "interface", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_network_transmit_errors_total": {"id", "interface", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_network_transmit_packets_dropped_total": {"id", "interface", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_network_transmit_packets_total": {"id", "interface", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_scrape_error": {},
"container_spec_cpu_period": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_spec_cpu_shares": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_spec_memory_limit_bytes": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_spec_memory_swap_limit_bytes": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_start_time_seconds": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name"},
"container_tasks_state": {"id", "image", "kubernetes_container_name", "kubernetes_namespace", "kubernetes_pod_name", "name", "state"},
"kubelet_container_manager_latency_microseconds": {"operation_type", "quantile"},
"kubelet_container_manager_latency_microseconds_count": {"operation_type"},
"kubelet_container_manager_latency_microseconds_sum": {"operation_type"},
"kubelet_containers_per_pod_count": {"quantile"},
"kubelet_containers_per_pod_count_count": {},
"kubelet_containers_per_pod_count_sum": {},
"kubelet_docker_operations": {"operation_type"},
"kubelet_docker_operations_errors": {"operation_type"},
"kubelet_docker_operations_timeout": {"operation_type"},
"kubelet_docker_operations_latency_microseconds": {"operation_type", "quantile"},
"kubelet_docker_operations_latency_microseconds_count": {"operation_type"},
"kubelet_docker_operations_latency_microseconds_sum": {"operation_type"},
"kubelet_generate_pod_status_latency_microseconds": {"quantile"},
"kubelet_generate_pod_status_latency_microseconds_count": {},
"kubelet_generate_pod_status_latency_microseconds_sum": {},
"kubelet_pleg_relist_latency_microseconds": {"quantile"},
"kubelet_pleg_relist_latency_microseconds_sum": {},
"kubelet_pleg_relist_latency_microseconds_count": {},
"kubelet_pleg_relist_interval_microseconds": {"quantile"},
"kubelet_pleg_relist_interval_microseconds_sum": {},
"kubelet_pleg_relist_interval_microseconds_count": {},
"kubelet_pod_start_latency_microseconds": {"quantile"},
"kubelet_pod_start_latency_microseconds_count": {},
"kubelet_pod_start_latency_microseconds_sum": {},
"kubelet_pod_worker_latency_microseconds": {"operation_type", "quantile"},
"kubelet_pod_worker_latency_microseconds_count": {"operation_type"},
"kubelet_pod_worker_latency_microseconds_sum": {"operation_type"},
"kubelet_pod_worker_start_latency_microseconds": {"quantile"},
"kubelet_pod_worker_start_latency_microseconds_count": {},
"kubelet_pod_worker_start_latency_microseconds_sum": {},
"kubelet_running_container_count": {},
"kubelet_running_pod_count": {},
"kubelet_sync_pods_latency_microseconds": {"quantile"},
"kubelet_sync_pods_latency_microseconds_count": {},
"kubelet_sync_pods_latency_microseconds_sum": {},
"machine_cpu_cores": {},
"machine_memory_bytes": {},
"rest_client_request_latency_microseconds": {"quantile", "url", "verb"},
"rest_client_request_latency_microseconds_count": {"url", "verb"},
"rest_client_request_latency_microseconds_sum": {"url", "verb"},
"rest_client_request_status_codes": {"code", "host", "method"},
}
Functions ¶
func PrintSample ¶
Types ¶
type ApiServerMetrics ¶
type ApiServerMetrics Metrics
func NewApiServerMetrics ¶
func NewApiServerMetrics() ApiServerMetrics
func (*ApiServerMetrics) Equal ¶
func (m *ApiServerMetrics) Equal(o ApiServerMetrics) bool
type ControllerManagerMetrics ¶
type ControllerManagerMetrics Metrics
func NewControllerManagerMetrics ¶
func NewControllerManagerMetrics() ControllerManagerMetrics
func (*ControllerManagerMetrics) Equal ¶
func (m *ControllerManagerMetrics) Equal(o ControllerManagerMetrics) bool
type KubeletMetrics ¶
type KubeletMetrics Metrics
func GrabKubeletMetricsWithoutProxy ¶
func GrabKubeletMetricsWithoutProxy(nodeName string) (KubeletMetrics, error)
GrabKubeletMetricsWithoutProxy retrieve metrics from the kubelet on the given node using a simple GET over http. Currently only used in integration tests.
func NewKubeletMetrics ¶
func NewKubeletMetrics() KubeletMetrics
func (*KubeletMetrics) Equal ¶
func (m *KubeletMetrics) Equal(o KubeletMetrics) bool
type Metrics ¶
func NewMetrics ¶
func NewMetrics() Metrics
type MetricsCollection ¶
type MetricsCollection struct { ApiServerMetrics ApiServerMetrics ControllerManagerMetrics ControllerManagerMetrics KubeletMetrics map[string]KubeletMetrics SchedulerMetrics SchedulerMetrics }
type MetricsGrabber ¶
type MetricsGrabber struct {
// contains filtered or unexported fields
}
func NewMetricsGrabber ¶
func (*MetricsGrabber) Grab ¶
func (g *MetricsGrabber) Grab(unknownMetrics sets.String) (MetricsCollection, error)
func (*MetricsGrabber) GrabFromApiServer ¶
func (g *MetricsGrabber) GrabFromApiServer(unknownMetrics sets.String) (ApiServerMetrics, error)
func (*MetricsGrabber) GrabFromControllerManager ¶
func (g *MetricsGrabber) GrabFromControllerManager(unknownMetrics sets.String) (ControllerManagerMetrics, error)
func (*MetricsGrabber) GrabFromKubelet ¶
func (g *MetricsGrabber) GrabFromKubelet(nodeName string) (KubeletMetrics, error)
func (*MetricsGrabber) GrabFromScheduler ¶
func (g *MetricsGrabber) GrabFromScheduler(unknownMetrics sets.String) (SchedulerMetrics, error)
type SchedulerMetrics ¶
type SchedulerMetrics Metrics
func NewSchedulerMetrics ¶
func NewSchedulerMetrics() SchedulerMetrics
func (*SchedulerMetrics) Equal ¶
func (m *SchedulerMetrics) Equal(o SchedulerMetrics) bool
Click to show internal directories.
Click to hide internal directories.