Documentation
¶
Index ¶
- Constants
- func AllErrorsFor(collection QueryErrorCollection) []error
- func DecodeAll[T any](results []*QueryResult, decode ResultDecoder[T]) []*T
- func IsCommError(err error) bool
- func IsErrorCollection(err error) bool
- func IsNoDataError(err error) bool
- func IsNoStoreAPIWarning(warning string) bool
- func IsRetryable(err error) bool
- func NewHelpRetryError(cause error) error
- func WrapError(err error, msg string) error
- type CPUCoresAllocatedResult
- type CPULimitsResult
- type CPURequestsResult
- type CPUUsageAvgResult
- type CPUUsageMaxResult
- type ClusterManagementDurationResult
- type ClusterManagementPricePerHrResult
- type CommError
- type ContainerMetricResult
- type DaemonSetLabelsResult
- type DeploymentLabelsResult
- type ErrorsAndWarningStrings
- type Future
- type GPUInfoResult
- type GPUsAllocatedResult
- type GPUsRequestedResult
- type GPUsUsageAvgResult
- type GPUsUsageMaxResult
- type HelpRetryError
- type IsGPUSharedResult
- type JobLabelsResult
- type LBActiveMinutesResult
- type LBPricePerHrResult
- type LocalStorageActiveMinutesResult
- type LocalStorageBytesResult
- type LocalStorageCostResult
- type LocalStorageUsedAvgResult
- type LocalStorageUsedCostResult
- type LocalStorageUsedMaxResult
- type MetricsQuerier
- type NamespaceAnnotationsResult
- type NamespaceLabelsResult
- type NetInternetGiBResult
- type NetInternetIngressGiBResult
- type NetInternetPricePerGiBResult
- type NetInternetServiceGiBResult
- type NetInternetServiceIngressGiBResult
- type NetNatGatewayGiBResult
- type NetNatGatewayIngressGiBResult
- type NetNatGatewayPricePerGiBResult
- type NetReceiveBytesResult
- type NetRegionGiBResult
- type NetRegionIngressGiBResult
- type NetRegionPricePerGiBResult
- type NetTransferBytesResult
- type NetZoneGiBResult
- type NetZoneIngressGiBResult
- type NetZonePricePerGiBResult
- type NetworkGiBResult
- type NetworkPricePerGiBResult
- type NoDataError
- type NodeActiveMinutesResult
- type NodeCPUCoresAllocatableResult
- type NodeCPUCoresCapacityResult
- type NodeCPUModeTotalResult
- type NodeCPUPricePerHrResult
- type NodeGPUCountResult
- type NodeGPUPricePerHrResult
- type NodeIsSpotResult
- type NodeLabelsResult
- type NodeRAMBytesAllocatableResult
- type NodeRAMBytesCapacityResult
- type NodeRAMPricePerGiBHrResult
- type NodeRAMSystemPercentResult
- type NodeRAMUserPercentResult
- type OpenCostDataSource
- type PVActiveMinutesResult
- type PVBytesResult
- type PVCBytesRequestedResult
- type PVCInfoResult
- type PVInfoResult
- type PVPricePerGiBHourResult
- type PVResult
- type PVUsedAvgResult
- type PVUsedMaxResult
- type PodAnnotationsResult
- type PodLabelsResult
- type PodPVCAllocationResult
- type PodsResult
- type PodsWithReplicaSetOwnerResult
- type QueryError
- type QueryErrorCollection
- type QueryErrorCollector
- func (ec *QueryErrorCollector) AppendError(err *QueryError)
- func (ec *QueryErrorCollector) AppendWarning(warn *QueryWarning)
- func (ec *QueryErrorCollector) As(target interface{}) bool
- func (ec *QueryErrorCollector) Error() string
- func (ec *QueryErrorCollector) Errors() []*QueryError
- func (ec *QueryErrorCollector) IsError() bool
- func (ec *QueryErrorCollector) IsWarning() bool
- func (ec *QueryErrorCollector) Report(query string, warnings []string, requestError error, parseError error)
- func (ec *QueryErrorCollector) ToErrorAndWarningStrings() (errors []string, warnings []string)
- func (ec *QueryErrorCollector) Warnings() []*QueryWarning
- type QueryGroup
- type QueryGroupAsyncResult
- type QueryGroupFuture
- type QueryResult
- func (qr *QueryResult) GetAnnotations() map[string]string
- func (qr *QueryResult) GetCluster() (string, error)
- func (qr *QueryResult) GetContainer() (string, error)
- func (qr *QueryResult) GetDevice() (string, error)
- func (qr *QueryResult) GetInstance() (string, error)
- func (qr *QueryResult) GetInstanceType() (string, error)
- func (qr *QueryResult) GetLabels() map[string]string
- func (qr *QueryResult) GetNamespace() (string, error)
- func (qr *QueryResult) GetNode() (string, error)
- func (qr *QueryResult) GetPod() (string, error)
- func (qr *QueryResult) GetProviderID() (string, error)
- func (qr *QueryResult) GetString(field string) (string, error)
- func (qr *QueryResult) GetStrings(fields ...string) (map[string]string, error)
- type QueryResults
- type QueryResultsChan
- type QueryWarning
- type RAMBytesAllocatedResult
- type RAMLimitsResult
- type RAMRequestsResult
- type RAMUsageAvgResult
- type RAMUsageMaxResult
- type ReplicaSetsWithRolloutResult
- type ReplicaSetsWithoutOwnersResult
- type ResourceQuotaMetricResult
- type ResourceQuotaSpecCPULimitAvgResult
- type ResourceQuotaSpecCPULimitMaxResult
- type ResourceQuotaSpecCPURequestAvgResult
- type ResourceQuotaSpecCPURequestMaxResult
- type ResourceQuotaSpecRAMLimitAvgResult
- type ResourceQuotaSpecRAMLimitMaxResult
- type ResourceQuotaSpecRAMRequestAvgResult
- type ResourceQuotaSpecRAMRequestMaxResult
- type ResourceQuotaStatusUsedCPULimitAvgResult
- type ResourceQuotaStatusUsedCPULimitMaxResult
- type ResourceQuotaStatusUsedCPURequestAvgResult
- type ResourceQuotaStatusUsedCPURequestMaxResult
- type ResourceQuotaStatusUsedRAMLimitAvgResult
- type ResourceQuotaStatusUsedRAMLimitMaxResult
- type ResourceQuotaStatusUsedRAMRequestAvgResult
- type ResourceQuotaStatusUsedRAMRequestMaxResult
- type ResultDecoder
- type ResultKeys
- type ServiceLabelsResult
- type StatefulSetLabelsResult
- type UptimeResult
Constants ¶
const ( ProviderLabel = "provider" AccountIDLabel = "account_id" ClusterNameLabel = "cluster_name" RegionLabel = "region" ClusterIDLabel = "cluster_id" NamespaceLabel = "namespace" NodeLabel = "node" InstanceLabel = "instance" InstanceTypeLabel = "instance_type" ContainerLabel = "container" PodLabel = "pod" PodNameLabel = "pod_name" ProviderIDLabel = "provider_id" DeviceLabel = "device" PVCLabel = "persistentvolumeclaim" PVLabel = "persistentvolume" StorageClassLabel = "storageclass" VolumeNameLabel = "volumename" ServiceLabel = "service" ServiceNameLabel = "service_name" IngressIPLabel = "ingress_ip" ProvisionerNameLabel = "provisioner_name" UIDLabel = "uid" KubernetesNodeLabel = "kubernetes_node" ModeLabel = "mode" ModelNameLabel = "modelName" UUIDLabel = "UUID" ResourceLabel = "resource" DeploymentLabel = "deployment" StatefulSetLabel = "statefulSet" ReplicaSetLabel = "replicaset" ResourceQuotaLabel = "resourcequota" OwnerNameLabel = "owner_name" OwnerKindLabel = "owner_kind" UnitLabel = "unit" InternetLabel = "internet" SameZoneLabel = "same_zone" SameRegionLabel = "same_region" NatGatewayLabel = "nat_gateway" )
const NoStoreAPIWarning string = "No StoreAPIs matched for this query"
NoStoreAPIWarning is a warning that we would consider an error. It returns partial data relating only to the store apis which were reachable. In order to ensure integrity of data across all clusters, we'll need to identify this warning and convert it to an error.
const (
NoneLabelValue = "<none>"
)
Variables ¶
This section is empty.
Functions ¶
func AllErrorsFor ¶
func AllErrorsFor(collection QueryErrorCollection) []error
func DecodeAll ¶
func DecodeAll[T any](results []*QueryResult, decode ResultDecoder[T]) []*T
func IsCommError ¶
IsCommError returns true if the given error is a CommError
func IsErrorCollection ¶
IsErrorCollection returns true if the provided error is an ErrorCollection
func IsNoDataError ¶
IsNoDataError returns true if the given error is a NoDataError
func IsNoStoreAPIWarning ¶
IsNoStoreAPIWarning checks a warning to determine if it is equivalent to a no store API query.
func IsRetryable ¶
func NewHelpRetryError ¶
Types ¶
type CPUCoresAllocatedResult ¶
type CPUCoresAllocatedResult = ContainerMetricResult
func DecodeCPUCoresAllocatedResult ¶
func DecodeCPUCoresAllocatedResult(result *QueryResult) *CPUCoresAllocatedResult
type CPULimitsResult ¶ added in v1.119.0
type CPULimitsResult = ContainerMetricResult
func DecodeCPULimitsResult ¶ added in v1.119.0
func DecodeCPULimitsResult(result *QueryResult) *CPULimitsResult
type CPURequestsResult ¶
type CPURequestsResult = ContainerMetricResult
func DecodeCPURequestsResult ¶
func DecodeCPURequestsResult(result *QueryResult) *CPURequestsResult
type CPUUsageAvgResult ¶
type CPUUsageAvgResult = ContainerMetricResult
func DecodeCPUUsageAvgResult ¶
func DecodeCPUUsageAvgResult(result *QueryResult) *CPUUsageAvgResult
type CPUUsageMaxResult ¶
type CPUUsageMaxResult = ContainerMetricResult
func DecodeCPUUsageMaxResult ¶
func DecodeCPUUsageMaxResult(result *QueryResult) *CPUUsageMaxResult
type ClusterManagementDurationResult ¶
type ClusterManagementDurationResult struct {
UID string
Cluster string
Provisioner string
Data []*util.Vector
}
func DecodeClusterManagementDurationResult ¶
func DecodeClusterManagementDurationResult(result *QueryResult) *ClusterManagementDurationResult
type ClusterManagementPricePerHrResult ¶
type ClusterManagementPricePerHrResult = ClusterManagementDurationResult
func DecodeClusterManagementPricePerHrResult ¶
func DecodeClusterManagementPricePerHrResult(result *QueryResult) *ClusterManagementPricePerHrResult
type CommError ¶
type CommError struct {
// contains filtered or unexported fields
}
CommError describes an error communicating with Prometheus
func CommErrorf ¶
CommErrorf creates a new CommError using a string formatter
func NewCommError ¶
NewCommError creates a new CommError
type ContainerMetricResult ¶
type ContainerMetricResult struct {
UID string
Cluster string
Node string
Instance string
Namespace string
Pod string
Container string
Data []*util.Vector
}
func DecodeContainerMetricResult ¶
func DecodeContainerMetricResult(result *QueryResult) *ContainerMetricResult
type DaemonSetLabelsResult ¶
type DaemonSetLabelsResult struct {
UID string
Cluster string
Namespace string
Pod string
DaemonSet string
Labels map[string]string
Data []*util.Vector
}
func DecodeDaemonSetLabelsResult ¶
func DecodeDaemonSetLabelsResult(result *QueryResult) *DaemonSetLabelsResult
type DeploymentLabelsResult ¶
type DeploymentLabelsResult struct {
UID string
Cluster string
Namespace string
Deployment string
Labels map[string]string
Data []*util.Vector
}
func DecodeDeploymentLabelsResult ¶
func DecodeDeploymentLabelsResult(result *QueryResult) *DeploymentLabelsResult
type ErrorsAndWarningStrings ¶
ErrorsAndWarningStrings is a container struct for string representation storage/caching
type Future ¶
type Future[T any] struct { // contains filtered or unexported fields }
Future[T] is a async future/promise/task that will resolve into a []*T return or error when awaited. This type provides a type-safe way of interfacing with `QueryResultsChan` via a `ResultDecoder[T]` function.
func NewFuture ¶
func NewFuture[T any](decoder ResultDecoder[T], resultsChan QueryResultsChan) *Future[T]
NewFuture Creates a new `Future[T]` with the given `ResultDecoder[T]` and `QueryResultsChan`.
func NewFutureFrom ¶
NewFutureFrom accepts a result set to wrap in the a Future implementation for passthrough.
type GPUInfoResult ¶
type GPUInfoResult struct {
UID string
Cluster string
Namespace string
Pod string
Container string
Device string
ModelName string
UUID string
Data []*util.Vector
}
func DecodeGPUInfoResult ¶
func DecodeGPUInfoResult(result *QueryResult) *GPUInfoResult
type GPUsAllocatedResult ¶
type GPUsAllocatedResult struct {
UID string
Cluster string
Namespace string
Pod string
Container string
Data []*util.Vector
}
func DecodeGPUsAllocatedResult ¶
func DecodeGPUsAllocatedResult(result *QueryResult) *GPUsAllocatedResult
type GPUsRequestedResult ¶
type GPUsRequestedResult = GPUsAllocatedResult
type alias requested result to allocated result, as you can only request a full GPU
func DecodeGPUsRequestedResult ¶
func DecodeGPUsRequestedResult(result *QueryResult) *GPUsRequestedResult
type GPUsUsageAvgResult ¶
type GPUsUsageAvgResult struct {
UID string
Cluster string
Namespace string
Pod string
Container string
Data []*util.Vector
}
func DecodeGPUsUsageAvgResult ¶
func DecodeGPUsUsageAvgResult(result *QueryResult) *GPUsUsageAvgResult
type GPUsUsageMaxResult ¶
type GPUsUsageMaxResult struct {
UID string
Cluster string
Namespace string
Pod string
Container string
Data []*util.Vector
}
func DecodeGPUsUsageMaxResult ¶
func DecodeGPUsUsageMaxResult(result *QueryResult) *GPUsUsageMaxResult
type HelpRetryError ¶
type HelpRetryError struct {
// contains filtered or unexported fields
}
HelpRetryError is a wrapper error type which indicates an error should induce a retry, and is non-fatal
func (*HelpRetryError) Error ¶
func (h *HelpRetryError) Error() string
func (*HelpRetryError) Unwrap ¶
func (h *HelpRetryError) Unwrap() error
type IsGPUSharedResult ¶
type IsGPUSharedResult struct {
}
func DecodeIsGPUSharedResult ¶
func DecodeIsGPUSharedResult(result *QueryResult) *IsGPUSharedResult
type JobLabelsResult ¶
type JobLabelsResult struct {
UID string
Cluster string
Namespace string
Pod string
Job string
Labels map[string]string
Data []*util.Vector
}
func DecodeJobLabelsResult ¶
func DecodeJobLabelsResult(result *QueryResult) *JobLabelsResult
type LBActiveMinutesResult ¶
type LBActiveMinutesResult struct {
UID string
Cluster string
Namespace string
Service string
IngressIP string
Data []*util.Vector
}
func DecodeLBActiveMinutesResult ¶
func DecodeLBActiveMinutesResult(result *QueryResult) *LBActiveMinutesResult
type LBPricePerHrResult ¶
type LBPricePerHrResult = LBActiveMinutesResult
func DecodeLBPricePerHrResult ¶
func DecodeLBPricePerHrResult(result *QueryResult) *LBPricePerHrResult
type LocalStorageActiveMinutesResult ¶
type LocalStorageActiveMinutesResult struct {
UID string
Cluster string
Node string
ProviderID string
Data []*util.Vector
}
func DecodeLocalStorageActiveMinutesResult ¶
func DecodeLocalStorageActiveMinutesResult(result *QueryResult) *LocalStorageActiveMinutesResult
type LocalStorageBytesResult ¶
type LocalStorageBytesResult struct {
UID string
Cluster string
Instance string
Device string
Data []*util.Vector
}
func DecodeLocalStorageBytesResult ¶
func DecodeLocalStorageBytesResult(result *QueryResult) *LocalStorageBytesResult
type LocalStorageCostResult ¶
type LocalStorageCostResult struct {
UID string
Cluster string
Instance string
Device string
Data []*util.Vector
}
func DecodeLocalStorageCostResult ¶
func DecodeLocalStorageCostResult(result *QueryResult) *LocalStorageCostResult
type LocalStorageUsedAvgResult ¶
type LocalStorageUsedAvgResult struct {
UID string
Cluster string
Instance string
Device string
Data []*util.Vector
}
func DecodeLocalStorageUsedAvgResult ¶
func DecodeLocalStorageUsedAvgResult(result *QueryResult) *LocalStorageUsedAvgResult
type LocalStorageUsedCostResult ¶
type LocalStorageUsedCostResult struct {
UID string
Cluster string
Instance string
Device string
Data []*util.Vector
}
func DecodeLocalStorageUsedCostResult ¶
func DecodeLocalStorageUsedCostResult(result *QueryResult) *LocalStorageUsedCostResult
type LocalStorageUsedMaxResult ¶
type LocalStorageUsedMaxResult struct {
UID string
Cluster string
Instance string
Device string
Data []*util.Vector
}
func DecodeLocalStorageUsedMaxResult ¶
func DecodeLocalStorageUsedMaxResult(result *QueryResult) *LocalStorageUsedMaxResult
type MetricsQuerier ¶
type MetricsQuerier interface {
// Cluster Disks
QueryPVActiveMinutes(start, end time.Time) *Future[PVActiveMinutesResult]
QueryPVUsedAverage(start, end time.Time) *Future[PVUsedAvgResult]
QueryPVUsedMax(start, end time.Time) *Future[PVUsedMaxResult]
// Local Cluster Disks
QueryLocalStorageActiveMinutes(start, end time.Time) *Future[LocalStorageActiveMinutesResult]
QueryLocalStorageCost(start, end time.Time) *Future[LocalStorageCostResult]
QueryLocalStorageUsedCost(start, end time.Time) *Future[LocalStorageUsedCostResult]
QueryLocalStorageUsedAvg(start, end time.Time) *Future[LocalStorageUsedAvgResult]
QueryLocalStorageUsedMax(start, end time.Time) *Future[LocalStorageUsedMaxResult]
QueryLocalStorageBytes(start, end time.Time) *Future[LocalStorageBytesResult]
// Nodes
QueryNodeActiveMinutes(start, end time.Time) *Future[NodeActiveMinutesResult]
QueryNodeCPUCoresCapacity(start, end time.Time) *Future[NodeCPUCoresCapacityResult]
QueryNodeCPUCoresAllocatable(start, end time.Time) *Future[NodeCPUCoresAllocatableResult]
QueryNodeRAMBytesCapacity(start, end time.Time) *Future[NodeRAMBytesCapacityResult]
QueryNodeRAMBytesAllocatable(start, end time.Time) *Future[NodeRAMBytesAllocatableResult]
QueryNodeGPUCount(start, end time.Time) *Future[NodeGPUCountResult]
QueryNodeCPUModeTotal(start, end time.Time) *Future[NodeCPUModeTotalResult]
QueryNodeIsSpot(start, end time.Time) *Future[NodeIsSpotResult]
QueryNodeRAMSystemPercent(start, end time.Time) *Future[NodeRAMSystemPercentResult]
QueryNodeRAMUserPercent(start, end time.Time) *Future[NodeRAMUserPercentResult]
// Load Balancers
QueryLBActiveMinutes(start, end time.Time) *Future[LBActiveMinutesResult]
QueryLBPricePerHr(start, end time.Time) *Future[LBPricePerHrResult]
// Cluster Management
QueryClusterUptime(start, end time.Time) *Future[UptimeResult]
QueryClusterManagementDuration(start, end time.Time) *Future[ClusterManagementDurationResult]
QueryClusterManagementPricePerHr(start, end time.Time) *Future[ClusterManagementPricePerHrResult]
// Pods
QueryPods(start, end time.Time) *Future[PodsResult]
QueryPodsUID(start, end time.Time) *Future[PodsResult]
// RAM
QueryRAMBytesAllocated(start, end time.Time) *Future[RAMBytesAllocatedResult]
QueryRAMRequests(start, end time.Time) *Future[RAMRequestsResult]
QueryRAMLimits(start, end time.Time) *Future[RAMLimitsResult]
QueryRAMUsageAvg(start, end time.Time) *Future[RAMUsageAvgResult]
QueryRAMUsageMax(start, end time.Time) *Future[RAMUsageMaxResult]
QueryNodeRAMPricePerGiBHr(start, end time.Time) *Future[NodeRAMPricePerGiBHrResult]
// CPU
QueryCPUCoresAllocated(start, end time.Time) *Future[CPUCoresAllocatedResult]
QueryCPURequests(start, end time.Time) *Future[CPURequestsResult]
QueryCPULimits(start, end time.Time) *Future[CPULimitsResult]
QueryCPUUsageAvg(start, end time.Time) *Future[CPUUsageAvgResult]
QueryCPUUsageMax(start, end time.Time) *Future[CPUUsageMaxResult]
QueryNodeCPUPricePerHr(start, end time.Time) *Future[NodeCPUPricePerHrResult]
// GPU
QueryGPUsAllocated(start, end time.Time) *Future[GPUsAllocatedResult]
QueryGPUsRequested(start, end time.Time) *Future[GPUsRequestedResult]
QueryGPUsUsageAvg(start, end time.Time) *Future[GPUsUsageAvgResult]
QueryGPUsUsageMax(start, end time.Time) *Future[GPUsUsageMaxResult]
QueryNodeGPUPricePerHr(start, end time.Time) *Future[NodeGPUPricePerHrResult]
QueryGPUInfo(start, end time.Time) *Future[GPUInfoResult]
// PVC
QueryPodPVCAllocation(start, end time.Time) *Future[PodPVCAllocationResult]
QueryPVCBytesRequested(start, end time.Time) *Future[PVCBytesRequestedResult]
QueryPVCInfo(start, end time.Time) *Future[PVCInfoResult]
// PV
QueryPVBytes(start, end time.Time) *Future[PVBytesResult]
QueryPVPricePerGiBHour(start, end time.Time) *Future[PVPricePerGiBHourResult]
QueryPVInfo(start, end time.Time) *Future[PVInfoResult]
// Namespace
QueryNamespaceUptime(start, end time.Time) *Future[UptimeResult]
// Network Egress
QueryNetZoneGiB(start, end time.Time) *Future[NetZoneGiBResult]
QueryNetZonePricePerGiB(start, end time.Time) *Future[NetZonePricePerGiBResult]
QueryNetRegionGiB(start, end time.Time) *Future[NetRegionGiBResult]
QueryNetRegionPricePerGiB(start, end time.Time) *Future[NetRegionPricePerGiBResult]
QueryNetInternetGiB(start, end time.Time) *Future[NetInternetGiBResult]
QueryNetInternetPricePerGiB(start, end time.Time) *Future[NetInternetPricePerGiBResult]
QueryNetInternetServiceGiB(start, end time.Time) *Future[NetInternetServiceGiBResult]
QueryNetNatGatewayPricePerGiB(start, end time.Time) *Future[NetNatGatewayPricePerGiBResult]
QueryNetNatGatewayGiB(start, end time.Time) *Future[NetNatGatewayGiBResult]
QueryNetTransferBytes(start, end time.Time) *Future[NetTransferBytesResult]
// Network Ingress
QueryNetZoneIngressGiB(start, end time.Time) *Future[NetZoneIngressGiBResult]
QueryNetRegionIngressGiB(start, end time.Time) *Future[NetRegionIngressGiBResult]
QueryNetInternetIngressGiB(start, end time.Time) *Future[NetInternetIngressGiBResult]
QueryNetInternetServiceIngressGiB(start, end time.Time) *Future[NetInternetServiceIngressGiBResult]
QueryNetNatGatewayIngressPricePerGiB(start, end time.Time) *Future[NetNatGatewayPricePerGiBResult]
QueryNetNatGatewayIngressGiB(start, end time.Time) *Future[NetNatGatewayIngressGiBResult]
QueryNetReceiveBytes(start, end time.Time) *Future[NetReceiveBytesResult]
// Annotations
QueryNamespaceAnnotations(start, end time.Time) *Future[NamespaceAnnotationsResult]
QueryPodAnnotations(start, end time.Time) *Future[PodAnnotationsResult]
// Labels
QueryNodeLabels(start, end time.Time) *Future[NodeLabelsResult]
QueryNamespaceLabels(start, end time.Time) *Future[NamespaceLabelsResult]
QueryPodLabels(start, end time.Time) *Future[PodLabelsResult]
QueryServiceLabels(start, end time.Time) *Future[ServiceLabelsResult]
QueryDeploymentLabels(start, end time.Time) *Future[DeploymentLabelsResult]
QueryStatefulSetLabels(start, end time.Time) *Future[StatefulSetLabelsResult]
QueryDaemonSetLabels(start, end time.Time) *Future[DaemonSetLabelsResult]
QueryJobLabels(start, end time.Time) *Future[JobLabelsResult]
// ReplicaSet -> Controller mapping
QueryPodsWithReplicaSetOwner(start, end time.Time) *Future[PodsWithReplicaSetOwnerResult]
QueryReplicaSetsWithoutOwners(start, end time.Time) *Future[ReplicaSetsWithoutOwnersResult]
QueryReplicaSetsWithRollout(start, end time.Time) *Future[ReplicaSetsWithRolloutResult]
// ResourceQuotas
QueryResourceQuotaUptime(start, end time.Time) *Future[UptimeResult]
QueryResourceQuotaSpecCPURequestAverage(start, end time.Time) *Future[ResourceQuotaSpecCPURequestAvgResult]
QueryResourceQuotaSpecCPURequestMax(start, end time.Time) *Future[ResourceQuotaSpecCPURequestMaxResult]
QueryResourceQuotaSpecRAMRequestAverage(start, end time.Time) *Future[ResourceQuotaSpecRAMRequestAvgResult]
QueryResourceQuotaSpecRAMRequestMax(start, end time.Time) *Future[ResourceQuotaSpecRAMRequestMaxResult]
QueryResourceQuotaSpecCPULimitAverage(start, end time.Time) *Future[ResourceQuotaSpecCPULimitAvgResult]
QueryResourceQuotaSpecCPULimitMax(start, end time.Time) *Future[ResourceQuotaSpecCPULimitMaxResult]
QueryResourceQuotaSpecRAMLimitAverage(start, end time.Time) *Future[ResourceQuotaSpecRAMLimitAvgResult]
QueryResourceQuotaSpecRAMLimitMax(start, end time.Time) *Future[ResourceQuotaSpecRAMLimitMaxResult]
QueryResourceQuotaStatusUsedCPURequestAverage(start, end time.Time) *Future[ResourceQuotaStatusUsedCPURequestAvgResult]
QueryResourceQuotaStatusUsedCPURequestMax(start, end time.Time) *Future[ResourceQuotaStatusUsedCPURequestMaxResult]
QueryResourceQuotaStatusUsedRAMRequestAverage(start, end time.Time) *Future[ResourceQuotaStatusUsedRAMRequestAvgResult]
QueryResourceQuotaStatusUsedRAMRequestMax(start, end time.Time) *Future[ResourceQuotaStatusUsedRAMRequestMaxResult]
QueryResourceQuotaStatusUsedCPULimitAverage(start, end time.Time) *Future[ResourceQuotaStatusUsedCPULimitAvgResult]
QueryResourceQuotaStatusUsedCPULimitMax(start, end time.Time) *Future[ResourceQuotaStatusUsedCPULimitMaxResult]
QueryResourceQuotaStatusUsedRAMLimitAverage(start, end time.Time) *Future[ResourceQuotaStatusUsedRAMLimitAvgResult]
QueryResourceQuotaStatusUsedRAMLimitMax(start, end time.Time) *Future[ResourceQuotaStatusUsedRAMLimitMaxResult]
// Data Coverage Query
QueryDataCoverage(limitDays int) (time.Time, time.Time, error)
}
type NamespaceAnnotationsResult ¶
type NamespaceAnnotationsResult struct {
UID string
Cluster string
Namespace string
Annotations map[string]string
Data []*util.Vector
}
func DecodeNamespaceAnnotationsResult ¶
func DecodeNamespaceAnnotationsResult(result *QueryResult) *NamespaceAnnotationsResult
type NamespaceLabelsResult ¶
type NamespaceLabelsResult struct {
UID string
Cluster string
Namespace string
Labels map[string]string
Data []*util.Vector
}
func DecodeNamespaceLabelsResult ¶
func DecodeNamespaceLabelsResult(result *QueryResult) *NamespaceLabelsResult
type NetInternetGiBResult ¶
type NetInternetGiBResult = NetworkGiBResult
func DecodeNetInternetGiBResult ¶
func DecodeNetInternetGiBResult(result *QueryResult) *NetInternetGiBResult
type NetInternetIngressGiBResult ¶
type NetInternetIngressGiBResult = NetworkGiBResult
func DecodeNetInternetIngressGiBResult ¶
func DecodeNetInternetIngressGiBResult(result *QueryResult) *NetInternetIngressGiBResult
type NetInternetPricePerGiBResult ¶
type NetInternetPricePerGiBResult = NetworkPricePerGiBResult
func DecodeNetInternetPricePerGiBResult ¶
func DecodeNetInternetPricePerGiBResult(result *QueryResult) *NetInternetPricePerGiBResult
type NetInternetServiceGiBResult ¶
type NetInternetServiceGiBResult = NetworkGiBResult
func DecodeNetInternetServiceGiBResult ¶
func DecodeNetInternetServiceGiBResult(result *QueryResult) *NetInternetServiceGiBResult
type NetInternetServiceIngressGiBResult ¶
type NetInternetServiceIngressGiBResult = NetworkGiBResult
func DecodeNetInternetServiceIngressGiBResult ¶
func DecodeNetInternetServiceIngressGiBResult(result *QueryResult) *NetInternetServiceIngressGiBResult
type NetNatGatewayGiBResult ¶ added in v1.119.2
type NetNatGatewayGiBResult = NetworkGiBResult
func DecodeNetNatGatewayGiBResult ¶ added in v1.119.2
func DecodeNetNatGatewayGiBResult(result *QueryResult) *NetNatGatewayGiBResult
type NetNatGatewayIngressGiBResult ¶ added in v1.119.2
type NetNatGatewayIngressGiBResult = NetworkGiBResult
func DecodeNetNatGatewayIngressGiBResult ¶ added in v1.119.2
func DecodeNetNatGatewayIngressGiBResult(result *QueryResult) *NetNatGatewayIngressGiBResult
type NetNatGatewayPricePerGiBResult ¶ added in v1.119.2
type NetNatGatewayPricePerGiBResult = NetworkPricePerGiBResult
func DecodeNetNatGatewayPricePerGiBResult ¶ added in v1.119.2
func DecodeNetNatGatewayPricePerGiBResult(result *QueryResult) *NetNatGatewayPricePerGiBResult
type NetReceiveBytesResult ¶
type NetReceiveBytesResult struct {
UID string
Cluster string
Namespace string
Pod string
Container string
Data []*util.Vector
}
func DecodeNetReceiveBytesResult ¶
func DecodeNetReceiveBytesResult(result *QueryResult) *NetReceiveBytesResult
type NetRegionGiBResult ¶
type NetRegionGiBResult = NetworkGiBResult
func DecodeNetRegionGiBResult ¶
func DecodeNetRegionGiBResult(result *QueryResult) *NetRegionGiBResult
type NetRegionIngressGiBResult ¶
type NetRegionIngressGiBResult = NetworkGiBResult
func DecodeNetRegionIngressGiBResult ¶
func DecodeNetRegionIngressGiBResult(result *QueryResult) *NetRegionIngressGiBResult
type NetRegionPricePerGiBResult ¶
type NetRegionPricePerGiBResult = NetworkPricePerGiBResult
func DecodeNetRegionPricePerGiBResult ¶
func DecodeNetRegionPricePerGiBResult(result *QueryResult) *NetRegionPricePerGiBResult
type NetTransferBytesResult ¶
type NetTransferBytesResult struct {
UID string
Cluster string
Namespace string
Pod string
Container string
Data []*util.Vector
}
func DecodeNetTransferBytesResult ¶
func DecodeNetTransferBytesResult(result *QueryResult) *NetTransferBytesResult
type NetZoneGiBResult ¶
type NetZoneGiBResult = NetworkGiBResult
Type alias the specific network subclassification results AND price results
func DecodeNetZoneGiBResult ¶
func DecodeNetZoneGiBResult(result *QueryResult) *NetZoneGiBResult
type NetZoneIngressGiBResult ¶
type NetZoneIngressGiBResult = NetworkGiBResult
func DecodeNetZoneIngressGiBResult ¶
func DecodeNetZoneIngressGiBResult(result *QueryResult) *NetZoneIngressGiBResult
type NetZonePricePerGiBResult ¶
type NetZonePricePerGiBResult = NetworkPricePerGiBResult
func DecodeNetZonePricePerGiBResult ¶
func DecodeNetZonePricePerGiBResult(result *QueryResult) *NetZonePricePerGiBResult
type NetworkGiBResult ¶
type NetworkGiBResult struct {
UID string
Cluster string
Namespace string
Pod string
Service string
Data []*util.Vector
}
Base type for network usage results
func DecodeNetworkGiBResult ¶
func DecodeNetworkGiBResult(result *QueryResult) *NetworkGiBResult
type NetworkPricePerGiBResult ¶
Base type for network price results
func DecodeNetworkPricePerGiBResult ¶
func DecodeNetworkPricePerGiBResult(result *QueryResult) *NetworkPricePerGiBResult
type NoDataError ¶
type NoDataError struct {
// contains filtered or unexported fields
}
NoDataError indicates that no data was returned by Prometheus. This should be treated like an EOF error, in that it may be expected.
func NewNoDataError ¶
func NewNoDataError(messages ...string) NoDataError
NewNoDataError creates a new NoDataError
func (NoDataError) Wrap ¶
func (nde NoDataError) Wrap(message string) NoDataError
Wrap wraps the error with the given message, but persists the error type.
type NodeActiveMinutesResult ¶
type NodeActiveMinutesResult struct {
UID string
Cluster string
Node string
ProviderID string
Data []*util.Vector
}
func DecodeNodeActiveMinutesResult ¶
func DecodeNodeActiveMinutesResult(result *QueryResult) *NodeActiveMinutesResult
type NodeCPUCoresAllocatableResult ¶
type NodeCPUCoresAllocatableResult = NodeCPUCoresCapacityResult
func DecodeNodeCPUCoresAllocatableResult ¶
func DecodeNodeCPUCoresAllocatableResult(result *QueryResult) *NodeCPUCoresAllocatableResult
type NodeCPUCoresCapacityResult ¶
type NodeCPUCoresCapacityResult struct {
UID string
Cluster string
Node string
Data []*util.Vector
}
func DecodeNodeCPUCoresCapacityResult ¶
func DecodeNodeCPUCoresCapacityResult(result *QueryResult) *NodeCPUCoresCapacityResult
type NodeCPUModeTotalResult ¶
type NodeCPUModeTotalResult struct {
UID string
Cluster string
Node string
Mode string
Data []*util.Vector
}
func DecodeNodeCPUModeTotalResult ¶
func DecodeNodeCPUModeTotalResult(result *QueryResult) *NodeCPUModeTotalResult
type NodeCPUPricePerHrResult ¶
type NodeCPUPricePerHrResult struct {
UID string
Cluster string
Node string
InstanceType string
ProviderID string
Data []*util.Vector
}
func DecodeNodeCPUPricePerHrResult ¶
func DecodeNodeCPUPricePerHrResult(result *QueryResult) *NodeCPUPricePerHrResult
type NodeGPUCountResult ¶
type NodeGPUCountResult struct {
UID string
Cluster string
Node string
ProviderID string
Data []*util.Vector
}
func DecodeNodeGPUCountResult ¶
func DecodeNodeGPUCountResult(result *QueryResult) *NodeGPUCountResult
type NodeGPUPricePerHrResult ¶
type NodeGPUPricePerHrResult struct {
UID string
Cluster string
Node string
InstanceType string
ProviderID string
Data []*util.Vector
}
func DecodeNodeGPUPricePerHrResult ¶
func DecodeNodeGPUPricePerHrResult(result *QueryResult) *NodeGPUPricePerHrResult
type NodeIsSpotResult ¶
type NodeIsSpotResult struct {
UID string
Cluster string
Node string
ProviderID string
Data []*util.Vector
}
func DecodeNodeIsSpotResult ¶
func DecodeNodeIsSpotResult(result *QueryResult) *NodeIsSpotResult
type NodeLabelsResult ¶
type NodeLabelsResult struct {
UID string
Cluster string
Node string
Labels map[string]string
Data []*util.Vector
}
func DecodeNodeLabelsResult ¶
func DecodeNodeLabelsResult(result *QueryResult) *NodeLabelsResult
type NodeRAMBytesAllocatableResult ¶
type NodeRAMBytesAllocatableResult = NodeRAMBytesCapacityResult
func DecodeNodeRAMBytesAllocatableResult ¶
func DecodeNodeRAMBytesAllocatableResult(result *QueryResult) *NodeRAMBytesAllocatableResult
type NodeRAMBytesCapacityResult ¶
type NodeRAMBytesCapacityResult struct {
UID string
Cluster string
Node string
Data []*util.Vector
}
func DecodeNodeRAMBytesCapacityResult ¶
func DecodeNodeRAMBytesCapacityResult(result *QueryResult) *NodeRAMBytesCapacityResult
type NodeRAMPricePerGiBHrResult ¶
type NodeRAMPricePerGiBHrResult struct {
UID string
Cluster string
Node string
InstanceType string
ProviderID string
Data []*util.Vector
}
func DecodeNodeRAMPricePerGiBHrResult ¶
func DecodeNodeRAMPricePerGiBHrResult(result *QueryResult) *NodeRAMPricePerGiBHrResult
type NodeRAMSystemPercentResult ¶
type NodeRAMSystemPercentResult struct {
UID string
Cluster string
Instance string
Data []*util.Vector
}
func DecodeNodeRAMSystemPercentResult ¶
func DecodeNodeRAMSystemPercentResult(result *QueryResult) *NodeRAMSystemPercentResult
type NodeRAMUserPercentResult ¶
type NodeRAMUserPercentResult = NodeRAMSystemPercentResult
func DecodeNodeRAMUserPercentResult ¶
func DecodeNodeRAMUserPercentResult(result *QueryResult) *NodeRAMUserPercentResult
type OpenCostDataSource ¶
type OpenCostDataSource interface {
// RegisterEndPoints registers any custom endpoints that can be used for diagnostics or debug purposes.
RegisterEndPoints(router *httprouter.Router)
// RegisterDiagnostics registers any custom data source diagnostics with the `DiagnosticService` that can
// be used to report externally.
RegisterDiagnostics(diagService diagnostics.DiagnosticService)
// Metrics returns a MetricsQuerier that can be used to query historical metrics data from the data source.
Metrics() MetricsQuerier
// ClusterMap returns a mapping of cluster identifier to ClusterInfo for all known clusters (local only for
// single cluster deployments).
ClusterMap() clusters.ClusterMap
// ClusterInfo returns the ClusterInfoProvider for the local cluster.
ClusterInfo() clusters.ClusterInfoProvider
BatchDuration() time.Duration
Resolution() time.Duration
}
type PVActiveMinutesResult ¶
type PVActiveMinutesResult struct {
UID string
Cluster string
PersistentVolume string
Data []*util.Vector
}
func DecodePVActiveMinutesResult ¶
func DecodePVActiveMinutesResult(result *QueryResult) *PVActiveMinutesResult
type PVBytesResult ¶
func DecodePVBytesResult ¶
func DecodePVBytesResult(result *QueryResult) *PVBytesResult
type PVCBytesRequestedResult ¶
type PVCBytesRequestedResult struct {
UID string
Cluster string
Namespace string
PersistentVolumeClaim string
Data []*util.Vector
}
func DecodePVCBytesRequestedResult ¶
func DecodePVCBytesRequestedResult(result *QueryResult) *PVCBytesRequestedResult
type PVCInfoResult ¶
type PVCInfoResult struct {
UID string
Cluster string
Namespace string
VolumeName string
PersistentVolumeClaim string
StorageClass string
Data []*util.Vector
}
func DecodePVCInfoResult ¶
func DecodePVCInfoResult(result *QueryResult) *PVCInfoResult
type PVInfoResult ¶
type PVInfoResult struct {
UID string
Cluster string
PersistentVolume string
StorageClass string
ProviderID string
Data []*util.Vector
}
func DecodePVInfoResult ¶
func DecodePVInfoResult(result *QueryResult) *PVInfoResult
type PVPricePerGiBHourResult ¶
type PVPricePerGiBHourResult struct {
UID string
Cluster string
VolumeName string
PersistentVolume string
ProviderID string
Data []*util.Vector
}
func DecodePVPricePerGiBHourResult ¶
func DecodePVPricePerGiBHourResult(result *QueryResult) *PVPricePerGiBHourResult
type PVUsedAvgResult ¶
type PVUsedAvgResult struct {
UID string
Cluster string
Namespace string
PersistentVolumeClaim string
Data []*util.Vector
}
func DecodePVUsedAvgResult ¶
func DecodePVUsedAvgResult(result *QueryResult) *PVUsedAvgResult
type PVUsedMaxResult ¶
type PVUsedMaxResult struct {
UID string
Cluster string
Namespace string
PersistentVolumeClaim string
Data []*util.Vector
}
func DecodePVUsedMaxResult ¶
func DecodePVUsedMaxResult(result *QueryResult) *PVUsedMaxResult
type PodAnnotationsResult ¶
type PodAnnotationsResult struct {
UID string
Cluster string
Namespace string
Pod string
Annotations map[string]string
Data []*util.Vector
}
func DecodePodAnnotationsResult ¶
func DecodePodAnnotationsResult(result *QueryResult) *PodAnnotationsResult
type PodLabelsResult ¶
type PodLabelsResult struct {
UID string
Cluster string
Namespace string
Pod string
Labels map[string]string
Data []*util.Vector
}
func DecodePodLabelsResult ¶
func DecodePodLabelsResult(result *QueryResult) *PodLabelsResult
type PodPVCAllocationResult ¶
type PodPVCAllocationResult struct {
UID string
Cluster string
Namespace string
Pod string
PersistentVolume string
PersistentVolumeClaim string
Data []*util.Vector
}
func DecodePodPVCAllocationResult ¶
func DecodePodPVCAllocationResult(result *QueryResult) *PodPVCAllocationResult
type PodsResult ¶
type PodsResult struct {
UID string
Cluster string
Namespace string
Pod string
Data []*util.Vector
}
func DecodePodsResult ¶
func DecodePodsResult(result *QueryResult) *PodsResult
type PodsWithReplicaSetOwnerResult ¶
type PodsWithReplicaSetOwnerResult struct {
UID string
Cluster string
Namespace string
Pod string
ReplicaSet string
Data []*util.Vector
}
func DecodePodsWithReplicaSetOwnerResult ¶
func DecodePodsWithReplicaSetOwnerResult(result *QueryResult) *PodsWithReplicaSetOwnerResult
type QueryError ¶
type QueryError struct {
Query string `json:"query"`
Error error `json:"error"`
ParseError error `json:"parseError"`
}
func (*QueryError) String ¶
func (qe *QueryError) String() string
String returns a string representation of the QueryError
type QueryErrorCollection ¶
type QueryErrorCollection interface {
// Warnings is a slice of the QueryWarning instances
Warnings() []*QueryWarning
// Errors is a slice of the QueryError instances
Errors() []*QueryError
// ToErrorAndWarningStrings returns the errors and warnings in the collection
// as two string slices.
ToErrorAndWarningStrings() (errors []string, warnings []string)
}
QueryErrorCollection represents a collection of query errors and warnings made via context.
type QueryErrorCollector ¶
type QueryErrorCollector struct {
// contains filtered or unexported fields
}
QueryErrorCollector is used to collect prometheus query errors and warnings, and also meets the Error interface
func (*QueryErrorCollector) AppendError ¶
func (ec *QueryErrorCollector) AppendError(err *QueryError)
Appends a QueryError to the errors list
func (*QueryErrorCollector) AppendWarning ¶
func (ec *QueryErrorCollector) AppendWarning(warn *QueryWarning)
Appends a QueryWarning to the warnings list
func (*QueryErrorCollector) As ¶
func (ec *QueryErrorCollector) As(target interface{}) bool
As is a special method that implicitly works with the `errors.As()` go helper to locate the _first_ instance of the provided target type in the collection.
func (*QueryErrorCollector) Error ¶
func (ec *QueryErrorCollector) Error() string
Implement the error interface to allow returning as an aggregated error
func (*QueryErrorCollector) Errors ¶
func (ec *QueryErrorCollector) Errors() []*QueryError
Errors caught by the collector
func (*QueryErrorCollector) IsError ¶
func (ec *QueryErrorCollector) IsError() bool
Whether or not the collector caught errors
func (*QueryErrorCollector) IsWarning ¶
func (ec *QueryErrorCollector) IsWarning() bool
Whether or not the collector caught any warnings
func (*QueryErrorCollector) Report ¶
func (ec *QueryErrorCollector) Report(query string, warnings []string, requestError error, parseError error)
Reports an error to the collector. Ignores if the error is nil and the warnings are empty
func (*QueryErrorCollector) ToErrorAndWarningStrings ¶
func (ec *QueryErrorCollector) ToErrorAndWarningStrings() (errors []string, warnings []string)
ToErrorAndWarningStrings returns the errors and warnings in the collection as two string slices.
func (*QueryErrorCollector) Warnings ¶
func (ec *QueryErrorCollector) Warnings() []*QueryWarning
Warnings caught by the collector
type QueryGroup ¶
type QueryGroup struct {
// contains filtered or unexported fields
}
QueryGroup is a representation of multiple async queries. It provides a shared error collector for all queries in the group.
Example:
grp := NewQueryGroup()
q1 := WithGroup(grp, QueryFoo())
q2 := WithGroup(grp, QueryBar())
results1, _ := q1.Await()
results2, _ := q2.Await()
if grp.HasErrors() {
return grp.Error() // <-- error return type
}
func NewQueryGroup ¶
func NewQueryGroup() *QueryGroup
NewQueryGroup creates a new QueryGroup instance which can be used to group non-typed async queries with the `With(QueryResultsChan)` instance method, or with the package function `WithGroup[T](*QueryGroup, *Future[T])`
func (*QueryGroup) Error ¶
func (qg *QueryGroup) Error() error
Error returns nil if there were no errors in the group. Otherwise, it returns all of the errors that occurred grouped into a single error.
func (*QueryGroup) Errors ¶
func (qg *QueryGroup) Errors() []*QueryError
Errors returns all of individual errors that occurred in the group.
func (*QueryGroup) HasErrors ¶
func (qg *QueryGroup) HasErrors() bool
HasErrors returns true if any of the async queries in the group have errored. Note that all results must be awaited in order to be checked for errors.
func (*QueryGroup) With ¶
func (qg *QueryGroup) With(resultsChan QueryResultsChan) *QueryGroupAsyncResult
With adds the given `QueryResultsChan` to the QueryGroup instance and returns a `QueryGroupAsyncResult` instance to be awaited
type QueryGroupAsyncResult ¶
type QueryGroupAsyncResult struct {
// contains filtered or unexported fields
}
QueryGroupAsyncResult is a representation of a single async query in a group.
func (*QueryGroupAsyncResult) Await ¶
func (qgar *QueryGroupAsyncResult) Await() ([]*QueryResult, error)
Await blocks and waits for the `QueryGroupAsyncResult` to resolve, and returns a slice of generic `QueryResult` instances if successful, or an error otherwise.
type QueryGroupFuture ¶
type QueryGroupFuture[T any] struct { // contains filtered or unexported fields }
QueryGroupFuture[T] is a representation of a single async query in a group with a typed result.
func WithGroup ¶
func WithGroup[T any](g *QueryGroup, f *Future[T]) *QueryGroupFuture[T]
WithGroup creates a new QueryGroupFuture[T] instance with the given QueryGroup and Future instances. This is the specific way to add a typed `Future[T]` to a `QueryGroup`.
func (*QueryGroupFuture[T]) Await ¶
func (qgf *QueryGroupFuture[T]) Await() ([]*T, error)
Await blocks and waits for the `QueryGroupFuture[T]` to resolve, and returns a slice of `*T` instances if successful, or an error otherwise.
type QueryResult ¶
type QueryResult struct {
Metric map[string]interface{} `json:"metric"`
Values []*util.Vector `json:"values"`
// contains filtered or unexported fields
}
QueryResult contains a single result from a prometheus query. It's common to refer to query results as a slice of QueryResult
func NewQueryResult ¶
func NewQueryResult(metrics map[string]any, values []*util.Vector, keys *ResultKeys) *QueryResult
func (*QueryResult) GetAnnotations ¶
func (qr *QueryResult) GetAnnotations() map[string]string
GetAnnotations returns all annotations and their values from the query result
func (*QueryResult) GetCluster ¶
func (qr *QueryResult) GetCluster() (string, error)
func (*QueryResult) GetContainer ¶
func (qr *QueryResult) GetContainer() (string, error)
func (*QueryResult) GetDevice ¶
func (qr *QueryResult) GetDevice() (string, error)
func (*QueryResult) GetInstance ¶
func (qr *QueryResult) GetInstance() (string, error)
func (*QueryResult) GetInstanceType ¶
func (qr *QueryResult) GetInstanceType() (string, error)
func (*QueryResult) GetLabels ¶
func (qr *QueryResult) GetLabels() map[string]string
GetLabels returns all labels and their values from the query result
func (*QueryResult) GetNamespace ¶
func (qr *QueryResult) GetNamespace() (string, error)
func (*QueryResult) GetNode ¶
func (qr *QueryResult) GetNode() (string, error)
func (*QueryResult) GetPod ¶
func (qr *QueryResult) GetPod() (string, error)
func (*QueryResult) GetProviderID ¶
func (qr *QueryResult) GetProviderID() (string, error)
func (*QueryResult) GetString ¶
func (qr *QueryResult) GetString(field string) (string, error)
GetString returns the requested field, or an error if it does not exist
func (*QueryResult) GetStrings ¶
func (qr *QueryResult) GetStrings(fields ...string) (map[string]string, error)
GetStrings returns the requested fields, or an error if it does not exist
type QueryResults ¶
type QueryResults struct {
Query string
Error error
Results []*QueryResult
}
QueryResults contains all of the query results and the source query string.
func NewQueryResults ¶
func NewQueryResults(query string) *QueryResults
type QueryResultsChan ¶
type QueryResultsChan chan *QueryResults
QueryResultsChan is a channel of query results
func (QueryResultsChan) Await ¶
func (qrc QueryResultsChan) Await() ([]*QueryResult, error)
Await returns query results, blocking until they are made available, and deferring the closure of the underlying channel
type QueryWarning ¶
func (*QueryWarning) String ¶
func (qw *QueryWarning) String() string
String returns a string representation of the QueryWarning
type RAMBytesAllocatedResult ¶
type RAMBytesAllocatedResult = ContainerMetricResult
func DecodeRAMBytesAllocatedResult ¶
func DecodeRAMBytesAllocatedResult(result *QueryResult) *RAMBytesAllocatedResult
type RAMLimitsResult ¶ added in v1.119.0
type RAMLimitsResult = ContainerMetricResult
func DecodeRAMLimitsResult ¶ added in v1.119.0
func DecodeRAMLimitsResult(result *QueryResult) *RAMLimitsResult
type RAMRequestsResult ¶
type RAMRequestsResult = ContainerMetricResult
func DecodeRAMRequestsResult ¶
func DecodeRAMRequestsResult(result *QueryResult) *RAMRequestsResult
type RAMUsageAvgResult ¶
type RAMUsageAvgResult = ContainerMetricResult
func DecodeRAMUsageAvgResult ¶
func DecodeRAMUsageAvgResult(result *QueryResult) *RAMUsageAvgResult
type RAMUsageMaxResult ¶
type RAMUsageMaxResult = ContainerMetricResult
func DecodeRAMUsageMaxResult ¶
func DecodeRAMUsageMaxResult(result *QueryResult) *RAMUsageMaxResult
type ReplicaSetsWithRolloutResult ¶
type ReplicaSetsWithRolloutResult struct {
UID string
Cluster string
Namespace string
ReplicaSet string
OwnerName string
OwnerKind string
Data []*util.Vector
}
func DecodeReplicaSetsWithRolloutResult ¶
func DecodeReplicaSetsWithRolloutResult(result *QueryResult) *ReplicaSetsWithRolloutResult
type ReplicaSetsWithoutOwnersResult ¶
type ReplicaSetsWithoutOwnersResult struct {
UID string
Cluster string
Namespace string
ReplicaSet string
Data []*util.Vector
}
func DecodeReplicaSetsWithoutOwnersResult ¶
func DecodeReplicaSetsWithoutOwnersResult(result *QueryResult) *ReplicaSetsWithoutOwnersResult
type ResourceQuotaMetricResult ¶ added in v1.119.0
type ResourceQuotaMetricResult struct {
UID string
Namespace string
ResourceQuota string
Resource string
Unit string
Data []*util.Vector
}
func DecodeResourceQuotaMetricResult ¶ added in v1.119.0
func DecodeResourceQuotaMetricResult(result *QueryResult) *ResourceQuotaMetricResult
type ResourceQuotaSpecCPULimitAvgResult ¶ added in v1.119.0
type ResourceQuotaSpecCPULimitAvgResult = ResourceQuotaMetricResult
func DecodeResourceQuotaSpecCPULimitAvgResult ¶ added in v1.119.0
func DecodeResourceQuotaSpecCPULimitAvgResult(result *QueryResult) *ResourceQuotaSpecCPULimitAvgResult
type ResourceQuotaSpecCPULimitMaxResult ¶ added in v1.119.0
type ResourceQuotaSpecCPULimitMaxResult = ResourceQuotaMetricResult
func DecodeResourceQuotaSpecCPULimitMaxResult ¶ added in v1.119.0
func DecodeResourceQuotaSpecCPULimitMaxResult(result *QueryResult) *ResourceQuotaSpecCPULimitMaxResult
type ResourceQuotaSpecCPURequestAvgResult ¶ added in v1.119.0
type ResourceQuotaSpecCPURequestAvgResult = ResourceQuotaMetricResult
func DecodeResourceQuotaSpecCPURequestAvgResult ¶ added in v1.119.0
func DecodeResourceQuotaSpecCPURequestAvgResult(result *QueryResult) *ResourceQuotaSpecCPURequestAvgResult
type ResourceQuotaSpecCPURequestMaxResult ¶ added in v1.119.0
type ResourceQuotaSpecCPURequestMaxResult = ResourceQuotaMetricResult
func DecodeResourceQuotaSpecCPURequestMaxResult ¶ added in v1.119.0
func DecodeResourceQuotaSpecCPURequestMaxResult(result *QueryResult) *ResourceQuotaSpecCPURequestMaxResult
type ResourceQuotaSpecRAMLimitAvgResult ¶ added in v1.119.0
type ResourceQuotaSpecRAMLimitAvgResult = ResourceQuotaMetricResult
func DecodeResourceQuotaSpecRAMLimitAvgResult ¶ added in v1.119.0
func DecodeResourceQuotaSpecRAMLimitAvgResult(result *QueryResult) *ResourceQuotaSpecRAMLimitAvgResult
type ResourceQuotaSpecRAMLimitMaxResult ¶ added in v1.119.0
type ResourceQuotaSpecRAMLimitMaxResult = ResourceQuotaMetricResult
func DecodeResourceQuotaSpecRAMLimitMaxResult ¶ added in v1.119.0
func DecodeResourceQuotaSpecRAMLimitMaxResult(result *QueryResult) *ResourceQuotaSpecRAMLimitMaxResult
type ResourceQuotaSpecRAMRequestAvgResult ¶ added in v1.119.0
type ResourceQuotaSpecRAMRequestAvgResult = ResourceQuotaMetricResult
func DecodeResourceQuotaSpecRAMRequestAvgResult ¶ added in v1.119.0
func DecodeResourceQuotaSpecRAMRequestAvgResult(result *QueryResult) *ResourceQuotaSpecRAMRequestAvgResult
type ResourceQuotaSpecRAMRequestMaxResult ¶ added in v1.119.0
type ResourceQuotaSpecRAMRequestMaxResult = ResourceQuotaMetricResult
func DecodeResourceQuotaSpecRAMRequestMaxResult ¶ added in v1.119.0
func DecodeResourceQuotaSpecRAMRequestMaxResult(result *QueryResult) *ResourceQuotaSpecRAMRequestMaxResult
type ResourceQuotaStatusUsedCPULimitAvgResult ¶ added in v1.119.0
type ResourceQuotaStatusUsedCPULimitAvgResult = ResourceQuotaMetricResult
func DecodeResourceQuotaStatusUsedCPULimitAvgResult ¶ added in v1.119.0
func DecodeResourceQuotaStatusUsedCPULimitAvgResult(result *QueryResult) *ResourceQuotaStatusUsedCPULimitAvgResult
type ResourceQuotaStatusUsedCPULimitMaxResult ¶ added in v1.119.0
type ResourceQuotaStatusUsedCPULimitMaxResult = ResourceQuotaMetricResult
func DecodeResourceQuotaStatusUsedCPULimitMaxResult ¶ added in v1.119.0
func DecodeResourceQuotaStatusUsedCPULimitMaxResult(result *QueryResult) *ResourceQuotaStatusUsedCPULimitMaxResult
type ResourceQuotaStatusUsedCPURequestAvgResult ¶ added in v1.119.0
type ResourceQuotaStatusUsedCPURequestAvgResult = ResourceQuotaMetricResult
func DecodeResourceQuotaStatusUsedCPURequestAvgResult ¶ added in v1.119.0
func DecodeResourceQuotaStatusUsedCPURequestAvgResult(result *QueryResult) *ResourceQuotaStatusUsedCPURequestAvgResult
type ResourceQuotaStatusUsedCPURequestMaxResult ¶ added in v1.119.0
type ResourceQuotaStatusUsedCPURequestMaxResult = ResourceQuotaMetricResult
func DecodeResourceQuotaStatusUsedCPURequestMaxResult ¶ added in v1.119.0
func DecodeResourceQuotaStatusUsedCPURequestMaxResult(result *QueryResult) *ResourceQuotaStatusUsedCPURequestMaxResult
type ResourceQuotaStatusUsedRAMLimitAvgResult ¶ added in v1.119.0
type ResourceQuotaStatusUsedRAMLimitAvgResult = ResourceQuotaMetricResult
func DecodeResourceQuotaStatusUsedRAMLimitAvgResult ¶ added in v1.119.0
func DecodeResourceQuotaStatusUsedRAMLimitAvgResult(result *QueryResult) *ResourceQuotaStatusUsedRAMLimitAvgResult
type ResourceQuotaStatusUsedRAMLimitMaxResult ¶ added in v1.119.0
type ResourceQuotaStatusUsedRAMLimitMaxResult = ResourceQuotaMetricResult
func DecodeResourceQuotaStatusUsedRAMLimitMaxResult ¶ added in v1.119.0
func DecodeResourceQuotaStatusUsedRAMLimitMaxResult(result *QueryResult) *ResourceQuotaStatusUsedRAMLimitMaxResult
type ResourceQuotaStatusUsedRAMRequestAvgResult ¶ added in v1.119.0
type ResourceQuotaStatusUsedRAMRequestAvgResult = ResourceQuotaMetricResult
func DecodeResourceQuotaStatusUsedRAMRequestAvgResult ¶ added in v1.119.0
func DecodeResourceQuotaStatusUsedRAMRequestAvgResult(result *QueryResult) *ResourceQuotaStatusUsedRAMRequestAvgResult
type ResourceQuotaStatusUsedRAMRequestMaxResult ¶ added in v1.119.0
type ResourceQuotaStatusUsedRAMRequestMaxResult = ResourceQuotaMetricResult
func DecodeResourceQuotaStatusUsedRAMRequestMaxResult ¶ added in v1.119.0
func DecodeResourceQuotaStatusUsedRAMRequestMaxResult(result *QueryResult) *ResourceQuotaStatusUsedRAMRequestMaxResult
type ResultDecoder ¶
type ResultDecoder[T any] func(*QueryResult) *T
ResultDecoder[T] is a function that decodes a `QueryResult` into a `*T` type.
type ResultKeys ¶
type ResultKeys struct {
ClusterKey string
NamespaceKey string
NodeKey string
InstanceKey string
InstanceTypeKey string
ContainerKey string
PodKey string
ProviderIDKey string
DeviceKey string
}
ResultKeys is a "configuration" struct that contains the keys/labels used to resolve labeled query results. ResultKeys can be defined with every QueryResults instance if necessary, and alter the keys used to fetch results when calling the following methods on QueryResults:
GetCluster() GetNamespace() GetNode() GetInstance() GetInstanceType() GetContainer() GetPod() GetProviderID() GetDevice()
func ClusterKeyWithDefaults ¶
func ClusterKeyWithDefaults(clusterKey string) *ResultKeys
ClusterKeyWithDefaults returns a new ResultKeys instance with the provided cluster key and the rest of the keys set to their default values.
func DefaultResultKeys ¶
func DefaultResultKeys() *ResultKeys
DefaultResultKeys returns a new ResultKeys instance with typical default values.
type ServiceLabelsResult ¶
type ServiceLabelsResult struct {
UID string
Cluster string
Namespace string
Service string
Labels map[string]string
Data []*util.Vector
}
func DecodeServiceLabelsResult ¶
func DecodeServiceLabelsResult(result *QueryResult) *ServiceLabelsResult
type StatefulSetLabelsResult ¶
type StatefulSetLabelsResult struct {
UID string
Cluster string
Namespace string
StatefulSet string
Labels map[string]string
Data []*util.Vector
}
func DecodeStatefulSetLabelsResult ¶
func DecodeStatefulSetLabelsResult(result *QueryResult) *StatefulSetLabelsResult
type UptimeResult ¶ added in v1.119.0
UptimeResult represents the first and last recorded sample timestamp within the query window
func DecodeUptimeResult ¶ added in v1.119.0
func DecodeUptimeResult(result *QueryResult) *UptimeResult