metrics

package
v0.0.0-...-8b28c38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMetricsConfigWatcher

func GetMetricsConfigWatcher() *watcher.ConfigMapWatcher

Returns ConfigMapWatcher for metrics configuration configmap

func InitKubeMetrics

func InitKubeMetrics(clusterCache clustercache.ClusterCache, metricsConfig *MetricsConfig, opts *KubeMetricsOpts)

InitKubeMetrics initializes kubernetes metric emission using the provided options.

func InitKubecostTelemetry

func InitKubecostTelemetry(config *MetricsConfig)

InitKubecostTelemetry registers kubecost application telemetry.

func ResponseMetricMiddleware

func ResponseMetricMiddleware(handler http.Handler) http.Handler

ResponseMetricMiddleware dispatches metric events for handles request and responses.

func UpdateMetricsConfigFromConfigmap

func UpdateMetricsConfigFromConfigmap(data map[string]string) error

Updates metric config file from configmap

Types

type DeploymentMatchLabelsMetric

type DeploymentMatchLabelsMetric struct {
	// contains filtered or unexported fields
}

DeploymentMatchLabelsMetric is a prometheus.Metric used to encode deployment match labels

func (DeploymentMatchLabelsMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (DeploymentMatchLabelsMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type HttpHandlerMetricEvent

type HttpHandlerMetricEvent struct {
	Handler      string
	Code         int
	Method       string
	ResponseTime time.Duration
	ResponseSize uint64
}

HttpHandlerMetricEvent contains http handler response metrics.

type KubeDeploymentCollector

type KubeDeploymentCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubeDeploymentCollector is a prometheus collector that generates

func (KubeDeploymentCollector) Collect

func (kdc KubeDeploymentCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubeDeploymentCollector) Describe

func (kdc KubeDeploymentCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubeDeploymentReplicasMetric

type KubeDeploymentReplicasMetric struct {
	// contains filtered or unexported fields
}

KubeDeploymentReplicasMetric is a prometheus.Metric used to encode deployment match labels

func (KubeDeploymentReplicasMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeDeploymentReplicasMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeDeploymentStatusAvailableReplicasMetric

type KubeDeploymentStatusAvailableReplicasMetric struct {
	// contains filtered or unexported fields
}

KubeDeploymentStatusAvailableReplicasMetric is a prometheus.Metric used to encode deployment match labels

func (KubeDeploymentStatusAvailableReplicasMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeDeploymentStatusAvailableReplicasMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeJobCollector

type KubeJobCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubeJobCollector is a prometheus collector that generates job sourced metrics.

func (KubeJobCollector) Collect

func (kjc KubeJobCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubeJobCollector) Describe

func (kjc KubeJobCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubeJobStatusFailedMetric

type KubeJobStatusFailedMetric struct {
	// contains filtered or unexported fields
}

KubeJobStatusFailedMetric

func (KubeJobStatusFailedMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeJobStatusFailedMetric) Write

func (kjsf KubeJobStatusFailedMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeMetricsOpts

type KubeMetricsOpts struct {
	EmitKubecostControllerMetrics bool
	EmitNamespaceAnnotations      bool
	EmitPodAnnotations            bool
	EmitKubeStateMetrics          bool
	EmitKubeStateMetricsV1Only    bool
}

KubeMetricsOpts represents our Kubernetes metrics emission options.

func DefaultKubeMetricsOpts

func DefaultKubeMetricsOpts() *KubeMetricsOpts

DefaultKubeMetricsOpts returns KubeMetricsOpts with default values set

type KubeNamespaceCollector

type KubeNamespaceCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubeNamespaceCollector is a prometheus collector that generates namespace sourced metrics

func (KubeNamespaceCollector) Collect

func (nsac KubeNamespaceCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubeNamespaceCollector) Describe

func (nsac KubeNamespaceCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubeNamespaceLabelsMetric

type KubeNamespaceLabelsMetric struct {
	// contains filtered or unexported fields
}

NamespaceAnnotationsMetric is a prometheus.Metric used to encode namespace annotations

func (KubeNamespaceLabelsMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeNamespaceLabelsMetric) Write

func (nam KubeNamespaceLabelsMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeNodeCollector

type KubeNodeCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubeNodeCollector is a prometheus collector that generates node sourced metrics.

func (KubeNodeCollector) Collect

func (nsac KubeNodeCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubeNodeCollector) Describe

func (nsac KubeNodeCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubeNodeLabelsMetric

type KubeNodeLabelsMetric struct {
	// contains filtered or unexported fields
}

KubeNodeLabelsMetric is a prometheus.Metric used to encode a duplicate of the deprecated kube-state-metrics metric kube_node_labels

func (KubeNodeLabelsMetric) Desc

func (nam KubeNodeLabelsMetric) Desc() *prometheus.Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeNodeLabelsMetric) Write

func (nam KubeNodeLabelsMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeNodeStatusAllocatableCPUCoresMetric

type KubeNodeStatusAllocatableCPUCoresMetric struct {
	// contains filtered or unexported fields
}

KubeNodeStatusAllocatableCPUCoresMetric is a prometheus.Metric

func (KubeNodeStatusAllocatableCPUCoresMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeNodeStatusAllocatableCPUCoresMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeNodeStatusAllocatableMemoryBytesMetric

type KubeNodeStatusAllocatableMemoryBytesMetric struct {
	// contains filtered or unexported fields
}

KubeNodeStatusAllocatableMemoryBytesMetric is a prometheus.Metric

func (KubeNodeStatusAllocatableMemoryBytesMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeNodeStatusAllocatableMemoryBytesMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeNodeStatusAllocatableMetric

type KubeNodeStatusAllocatableMetric struct {
	// contains filtered or unexported fields
}

KubeNodeStatusAllocatableMetric is a prometheus.Metric

func (KubeNodeStatusAllocatableMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeNodeStatusAllocatableMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeNodeStatusCapacityCPUCoresMetric

type KubeNodeStatusCapacityCPUCoresMetric struct {
	// contains filtered or unexported fields
}

KubeNodeStatusCapacityCPUCoresMetric is a prometheus.Metric used to encode a duplicate of the deprecated kube-state-metrics metric kube_node_status_capacity_memory_bytes

func (KubeNodeStatusCapacityCPUCoresMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeNodeStatusCapacityCPUCoresMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeNodeStatusCapacityMemoryBytesMetric

type KubeNodeStatusCapacityMemoryBytesMetric struct {
	// contains filtered or unexported fields
}

KubeNodeStatusCapacityMemoryBytesMetric is a prometheus.Metric used to encode a duplicate of the deprecated kube-state-metrics metric kube_node_status_capacity_memory_bytes

func (KubeNodeStatusCapacityMemoryBytesMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeNodeStatusCapacityMemoryBytesMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeNodeStatusCapacityMetric

type KubeNodeStatusCapacityMetric struct {
	// contains filtered or unexported fields
}

KubeNodeStatusCapacityMetric is a prometheus.Metric

func (KubeNodeStatusCapacityMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeNodeStatusCapacityMetric) Write

func (kpcrr KubeNodeStatusCapacityMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubeNodeStatusConditionMetric

type KubeNodeStatusConditionMetric struct {
	// contains filtered or unexported fields
}

KubeNodeStatusConditionMetric

func (KubeNodeStatusConditionMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubeNodeStatusConditionMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePVCCollector

type KubePVCCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubePVCCollector is a prometheus collector that generates pvc sourced metrics

func (KubePVCCollector) Collect

func (kpvc KubePVCCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubePVCCollector) Describe

func (kpvc KubePVCCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubePVCInfoMetric

type KubePVCInfoMetric struct {
	// contains filtered or unexported fields
}

KubePVCInfoMetric is a prometheus.Metric

func (KubePVCInfoMetric) Desc

func (kpvcrr KubePVCInfoMetric) Desc() *prometheus.Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePVCInfoMetric) Write

func (kpvci KubePVCInfoMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePVCResourceRequestsStorageBytesMetric

type KubePVCResourceRequestsStorageBytesMetric struct {
	// contains filtered or unexported fields
}

KubePVCResourceRequestsStorageBytesMetric is a prometheus.Metric

func (KubePVCResourceRequestsStorageBytesMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePVCResourceRequestsStorageBytesMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePVCapacityBytesMetric

type KubePVCapacityBytesMetric struct {
	// contains filtered or unexported fields
}

KubePVCapacityBytesMetric is a prometheus.Metric

func (KubePVCapacityBytesMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePVCapacityBytesMetric) Write

func (kpcrr KubePVCapacityBytesMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePVCollector

type KubePVCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubePVCollector is a prometheus collector that generates PV metrics

func (KubePVCollector) Collect

func (kpvcb KubePVCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubePVCollector) Describe

func (kpvcb KubePVCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubePVStatusPhaseMetric

type KubePVStatusPhaseMetric struct {
	// contains filtered or unexported fields
}

KubePVStatusPhaseMetric is a prometheus.Metric

func (KubePVStatusPhaseMetric) Desc

func (kpcrr KubePVStatusPhaseMetric) Desc() *prometheus.Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePVStatusPhaseMetric) Write

func (kpcrr KubePVStatusPhaseMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodCollector

type KubePodCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubePodMetricCollector is a prometheus collector that emits pod metrics

func (KubePodCollector) Collect

func (kpmc KubePodCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubePodCollector) Describe

func (kpmc KubePodCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubePodContainerResourceLimitsCPUCoresMetric

type KubePodContainerResourceLimitsCPUCoresMetric struct {
	// contains filtered or unexported fields
}

KubePodContainerResourceLimitsCPUCoresMetric is a prometheus.Metric

func (KubePodContainerResourceLimitsCPUCoresMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodContainerResourceLimitsCPUCoresMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodContainerResourceLimitsMemoryBytesMetric

type KubePodContainerResourceLimitsMemoryBytesMetric struct {
	// contains filtered or unexported fields
}

KubePodContainerResourceLimitsMemoryBytesMetric is a prometheus.Metric

func (KubePodContainerResourceLimitsMemoryBytesMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodContainerResourceLimitsMemoryBytesMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodContainerResourceLimitsMetric

type KubePodContainerResourceLimitsMetric struct {
	// contains filtered or unexported fields
}

KubePodContainerResourceLimitsMetric is a prometheus.Metric

func (KubePodContainerResourceLimitsMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodContainerResourceLimitsMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodContainerResourceRequestsMetric

type KubePodContainerResourceRequestsMetric struct {
	// contains filtered or unexported fields
}

KubePodContainerResourceRequestsMetric is a prometheus.Metric

func (KubePodContainerResourceRequestsMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodContainerResourceRequestsMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodContainerStatusRestartsTotalMetric

type KubePodContainerStatusRestartsTotalMetric struct {
	// contains filtered or unexported fields
}

KubePodContainerStatusRestartsTotalMetric is a prometheus.Metric emitting container restarts metrics.

func (KubePodContainerStatusRestartsTotalMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodContainerStatusRestartsTotalMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodContainerStatusRunningMetric

type KubePodContainerStatusRunningMetric struct {
	// contains filtered or unexported fields
}

KubePodLabelsMetric is a prometheus.Metric used to encode a duplicate of the deprecated kube-state-metrics metric kube_pod_labels

func (KubePodContainerStatusRunningMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodContainerStatusRunningMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodContainerStatusTerminatedReasonMetric

type KubePodContainerStatusTerminatedReasonMetric struct {
	// contains filtered or unexported fields
}

KubePodContainerStatusTerminatedReasonMetric is a prometheus.Metric emitting container termination reasons.

func (KubePodContainerStatusTerminatedReasonMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodContainerStatusTerminatedReasonMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodLabelsCollector

type KubePodLabelsCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubePodLabelsCollector is a prometheus collector that emits pod labels only

func (KubePodLabelsCollector) Collect

func (kpmc KubePodLabelsCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubePodLabelsCollector) Describe

func (kpmc KubePodLabelsCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of pod labels only collected by this Collector.

type KubePodLabelsMetric

type KubePodLabelsMetric struct {
	// contains filtered or unexported fields
}

KubePodLabelsMetric is a prometheus.Metric used to encode a duplicate of the deprecated kube-state-metrics metric kube_pod_labels

func (KubePodLabelsMetric) Desc

func (nam KubePodLabelsMetric) Desc() *prometheus.Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodLabelsMetric) Write

func (nam KubePodLabelsMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodOwnerMetric

type KubePodOwnerMetric struct {
	// contains filtered or unexported fields
}

KubePodOwnerMetric is a prometheus.Metric

func (KubePodOwnerMetric) Desc

func (kpo KubePodOwnerMetric) Desc() *prometheus.Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodOwnerMetric) Write

func (kpo KubePodOwnerMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubePodStatusPhaseMetric

type KubePodStatusPhaseMetric struct {
	// contains filtered or unexported fields
}

KubePodStatusPhaseMetric is a prometheus.Metric emitting all phases for a pod

func (KubePodStatusPhaseMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubePodStatusPhaseMetric) Write

func (kpcs KubePodStatusPhaseMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubecostDeploymentCollector

type KubecostDeploymentCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubecostDeploymentCollector is a prometheus collector that generates kubecost specific deployment metrics.

func (KubecostDeploymentCollector) Collect

func (kdc KubecostDeploymentCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubecostDeploymentCollector) Describe

func (kdc KubecostDeploymentCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubecostNamespaceCollector

type KubecostNamespaceCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubecostNamespaceCollector is a prometheus collector that generates namespace sourced metrics

func (KubecostNamespaceCollector) Collect

func (nsac KubecostNamespaceCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubecostNamespaceCollector) Describe

func (nsac KubecostNamespaceCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubecostPVInfoMetric

type KubecostPVInfoMetric struct {
	// contains filtered or unexported fields
}

--------------------------------------------------------------------------

KubecostPVInfoMetric

-------------------------------------------------------------------------- KubecostPVInfoMetric is a prometheus.Metric

func (KubecostPVInfoMetric) Desc

func (kpvim KubecostPVInfoMetric) Desc() *prometheus.Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (KubecostPVInfoMetric) Write

func (kpvim KubecostPVInfoMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type KubecostPodCollector

type KubecostPodCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubecostPodCollector is a prometheus collector that emits pod metrics

func (KubecostPodCollector) Collect

func (kpmc KubecostPodCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubecostPodCollector) Describe

func (kpmc KubecostPodCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubecostServiceCollector

type KubecostServiceCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

KubecostServiceCollector is a prometheus collector that generates service sourced metrics.

func (KubecostServiceCollector) Collect

func (sc KubecostServiceCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubecostServiceCollector) Describe

func (sc KubecostServiceCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type KubecostStatefulsetCollector

type KubecostStatefulsetCollector struct {
	KubeClusterCache clustercache.ClusterCache
	// contains filtered or unexported fields
}

StatefulsetCollector is a prometheus collector that generates StatefulsetMetrics

func (KubecostStatefulsetCollector) Collect

func (sc KubecostStatefulsetCollector) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (KubecostStatefulsetCollector) Describe

func (sc KubecostStatefulsetCollector) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics collected by this Collector.

type MetricsConfig

type MetricsConfig struct {
	DisabledMetrics []string `json:"disabledMetrics"`
}

func GetMetricsConfig

func GetMetricsConfig() (*MetricsConfig, error)

Unmarshals metrics.json to a MetricsConfig struct

func UpdateMetricsConfig

func UpdateMetricsConfig(mc *MetricsConfig) (*MetricsConfig, error)

Writes MetricsConfig struct to json file

func (MetricsConfig) GetDisabledMetricsMap

func (mc MetricsConfig) GetDisabledMetricsMap() map[string]struct{}

Gets map of disabled metrics to empty structs

type NamespaceAnnotationsMetric

type NamespaceAnnotationsMetric struct {
	// contains filtered or unexported fields
}

NamespaceAnnotationsMetric is a prometheus.Metric used to encode namespace annotations

func (NamespaceAnnotationsMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (NamespaceAnnotationsMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type PodAnnotationsMetric

type PodAnnotationsMetric struct {
	// contains filtered or unexported fields
}

PodAnnotationsMetric is a prometheus.Metric used to encode namespace annotations

func (PodAnnotationsMetric) Desc

func (pam PodAnnotationsMetric) Desc() *prometheus.Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (PodAnnotationsMetric) Write

func (pam PodAnnotationsMetric) Write(m *dto.Metric) error

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type ServiceSelectorLabelsMetric

type ServiceSelectorLabelsMetric struct {
	// contains filtered or unexported fields
}

ServiceSelectorLabelsMetric is a prometheus.Metric used to encode service selector labels

func (ServiceSelectorLabelsMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (ServiceSelectorLabelsMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

type StatefulsetMatchLabelsMetric

type StatefulsetMatchLabelsMetric struct {
	// contains filtered or unexported fields
}

StatefulsetMetric is a prometheus.Metric used to encode statefulset match labels

func (StatefulsetMatchLabelsMetric) Desc

Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric.

func (StatefulsetMatchLabelsMetric) Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL