Skip to content

Commit

Permalink
Stop logging prometheus query
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Oct 16, 2024
1 parent b98120e commit f8be56e
Show file tree
Hide file tree
Showing 10 changed files with 954 additions and 193 deletions.
6 changes: 3 additions & 3 deletions client/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func GetPodResourceUsage(pc promv1.API, obj metav1.ObjectMeta) core.ResourceList
}
resUsage[core.ResourceCPU] = cpuQuantity
} else {
klog.ErrorS(err, "failed to get prometheus cpu query result")
klog.Infoln("failed to execute prometheus cpu query")
}

if res, err := getPromQueryResult(pc, promMemoryQuery); err == nil {
Expand All @@ -77,7 +77,7 @@ func GetPodResourceUsage(pc promv1.API, obj metav1.ObjectMeta) core.ResourceList
}
resUsage[core.ResourceMemory] = memQuantity
} else {
klog.ErrorS(err, "failed to get prometheus memory query result")
klog.Infoln("failed to execute prometheus memory query")
}

if res, err := getPromQueryResult(pc, promStorageQuery); err == nil {
Expand All @@ -92,7 +92,7 @@ func GetPodResourceUsage(pc promv1.API, obj metav1.ObjectMeta) core.ResourceList
}
resUsage[core.ResourceStorage] = storageQuantity
} else {
klog.ErrorS(err, "failed to get prometheus storage query result")
klog.Infoln("failed to execute prometheus storage query")
}

return resUsage
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
k8s.io/client-go v0.30.2
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b
kmodules.xyz/client-go v0.30.17
kmodules.xyz/client-go v0.30.27
kmodules.xyz/custom-resources v0.30.0
sigs.k8s.io/controller-runtime v0.18.4
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCI
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80=
kmodules.xyz/client-go v0.30.17 h1:Ec22XIkAsN8Fwd001P0EzRTsfeibIFkzkZ6oYjLe5LQ=
kmodules.xyz/client-go v0.30.17/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
kmodules.xyz/client-go v0.30.27 h1:pmM11k/XNVGTFp22qRsXBnGRnFeLNGX2lB9I0Gu+JWY=
kmodules.xyz/client-go v0.30.27/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
kmodules.xyz/custom-resources v0.30.0 h1:vR3CbseHMLwR4GvtcJJuRuwIV8voKqFqNii27rMcm1o=
kmodules.xyz/custom-resources v0.30.0/go.mod h1:ZsTuI2mLG2s3byre7bHmpxJ9w0HDqAkRTL1+izGFI24=
sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw=
Expand Down
4 changes: 4 additions & 0 deletions vendor/kmodules.xyz/client-go/api/v1/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ type CertificateSpec struct {
Duration *metav1.Duration `json:"duration,omitempty" protobuf:"bytes,5,opt,name=duration"`

// Certificate renew before expiration duration
//
// Deprecated use `ReconfigureTLS` type OpsRequest instead.
//
// +deprecated
// +optional
RenewBefore *metav1.Duration `json:"renewBefore,omitempty" protobuf:"bytes,6,opt,name=renewBefore"`

Expand Down
45 changes: 21 additions & 24 deletions vendor/kmodules.xyz/client-go/api/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,21 @@ import (
"strings"
)

// +kubebuilder:validation:Enum=Aws;Azure;DigitalOcean;GoogleCloud;Linode;Packet;Scaleway;Vultr;BareMetal;KIND;Generic;Private
// +kubebuilder:validation:Enum=AKS;DigitalOcean;EKS;Exoscale;Generic;GKE;Linode;Packet;Rancher;Scaleway;Vultr
type HostingProvider string

const (
HostingProviderAWS HostingProvider = "Aws"
HostingProviderAzure HostingProvider = "Azure"
HostingProviderAKS HostingProvider = "AKS"
HostingProviderDigitalOcean HostingProvider = "DigitalOcean"
HostingProviderGoogleCloud HostingProvider = "GoogleCloud"
HostingProviderEKS HostingProvider = "EKS"
HostingProviderExoscale HostingProvider = "Exoscale"
HostingProviderGeneric HostingProvider = "Generic"
HostingProviderGKE HostingProvider = "GKE"
HostingProviderLinode HostingProvider = "Linode"
HostingProviderPacket HostingProvider = "Packet"
HostingProviderRancher HostingProvider = "Rancher"
HostingProviderScaleway HostingProvider = "Scaleway"
HostingProviderVultr HostingProvider = "Vultr"
HostingProviderBareMetal HostingProvider = "BareMetal"
HostingProviderKIND HostingProvider = "KIND"
HostingProviderGeneric HostingProvider = "Generic"
HostingProviderPrivate HostingProvider = "Private"
)

const (
Expand All @@ -56,10 +54,10 @@ type ClusterMetadata struct {
Name string `json:"name,omitempty" protobuf:"bytes,2,opt,name=name"`
DisplayName string `json:"displayName,omitempty" protobuf:"bytes,3,opt,name=displayName"`
Provider HostingProvider `json:"provider,omitempty" protobuf:"bytes,4,opt,name=provider,casttype=HostingProvider"`
OwnerID string `json:"ownerID,omitempty"`
OwnerType string `json:"ownerType,omitempty"`
APIEndpoint string `json:"apiEndpoint,omitempty"`
CABundle string `json:"caBundle,omitempty"`
OwnerID string `json:"ownerID,omitempty" protobuf:"bytes,5,opt,name=ownerID"`
OwnerType string `json:"ownerType,omitempty" protobuf:"bytes,6,opt,name=ownerType"`
APIEndpoint string `json:"apiEndpoint,omitempty" protobuf:"bytes,7,opt,name=apiEndpoint"`
CABundle string `json:"caBundle,omitempty" protobuf:"bytes,8,opt,name=caBundle"`
}

func (md ClusterMetadata) State() string {
Expand Down Expand Up @@ -153,27 +151,26 @@ func (cm ClusterManager) String() string {
}

type CAPIClusterInfo struct {
Provider CAPIProvider `json:"provider"`
Namespace string `json:"namespace"`
ClusterName string `json:"clusterName"`
Provider CAPIProvider `json:"provider" protobuf:"bytes,1,opt,name=provider,casttype=CAPIProvider"`
Namespace string `json:"namespace" protobuf:"bytes,2,opt,name=namespace"`
ClusterName string `json:"clusterName" protobuf:"bytes,3,opt,name=clusterName"`
}

// ClusterInfo used in ace-installer
type ClusterInfo struct {
UID string `json:"uid"`
Name string `json:"name"`
ClusterManagers []string `json:"clusterManagers"`
UID string `json:"uid" protobuf:"bytes,1,opt,name=uid"`
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
ClusterManagers []string `json:"clusterManagers" protobuf:"bytes,3,rep,name=clusterManagers"`
// +optional
CAPI CAPIClusterInfo `json:"capi"`
CAPI *CAPIClusterInfo `json:"capi" protobuf:"bytes,4,opt,name=capi"`
}

// +kubebuilder:validation:Enum=capa;capg;capz
type CAPIProvider string

const (
CAPIProviderUnknown CAPIProvider = ""
CAPIProviderCAPA CAPIProvider = "capa"
CAPIProviderCAPG CAPIProvider = "capg"
CAPIProviderCAPZ CAPIProvider = "capz"
CAPIProviderCAPH CAPIProvider = "caph"
CAPIProviderCAPA CAPIProvider = "capa"
CAPIProviderCAPG CAPIProvider = "capg"
CAPIProviderCAPZ CAPIProvider = "capz"
CAPIProviderCAPH CAPIProvider = "caph"
)
Loading

0 comments on commit f8be56e

Please sign in to comment.