Documentation ¶
Overview ¶
Copyright 2018 The KubeSphere Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func GetCAdvisorMetrics(nodeAddr string) string
- func GetHeapsterMetrics(url string) string
- func GetHeapsterMetricsJson(url string) *jason.Object
- func NewDBClient() *gorm.DB
- func NewK8sClient() *kubernetes.Clientset
- func NewSharedDBClient() *gorm.DB
- func SendMonitoringRequest(queryType string, params string) string
- type EtcdClient
- type MonitoringRequestParams
Constants ¶
View Source
const ( DefaultHeapsterScheme = "http" DefaultHeapsterService = "heapster.kube-system.svc.cluster.local" //"heapster" DefaultHeapsterPort = "80" // use the first exposed port on the service HeapsterApiPath = "/api/v1/model" HeapsterEndpointUrl = DefaultHeapsterScheme + "://" + DefaultHeapsterService + ":" + DefaultHeapsterPort + HeapsterApiPath )
View Source
const ( DefaultScheme = "http" DefaultPrometheusPort = "9090" PrometheusApiPath = "/api/v1/" DefaultQueryStep = "10m" DefaultQueryTimeout = "10s" RangeQueryType = "query_range?" DefaultQueryType = "query?" PrometheusAPIServerEnv = "PROMETHEUS_API_SERVER" )
Variables ¶
View Source
var PrometheusAPIServer = "prometheus-k8s.kubesphere-monitoring-system.svc"
View Source
var PrometheusEndpointUrl string
Functions ¶
func GetCAdvisorMetrics ¶
func GetHeapsterMetrics ¶
func GetHeapsterMetricsJson ¶
Get heapster response in python-like dictionary
func NewDBClient ¶
func NewK8sClient ¶
func NewK8sClient() *kubernetes.Clientset
func NewSharedDBClient ¶
func SendMonitoringRequest ¶
Types ¶
type EtcdClient ¶
type EtcdClient struct {
// contains filtered or unexported fields
}
func NewEtcdClient ¶
func NewEtcdClient() (*EtcdClient, error)
func (EtcdClient) Close ¶
func (cli EtcdClient) Close()
func (EtcdClient) Put ¶
func (cli EtcdClient) Put(key, value string) error
type MonitoringRequestParams ¶
type MonitoringRequestParams struct { Params url.Values QueryType string SortMetricName string SortType string PageNum string LimitNum string Tp string MetricsFilter string NodesFilter string WsFilter string NsFilter string PodsFilter string ContainersFilter string MetricsName string WorkloadName string WlFilter string NodeId string WsName string NsName string PodName string ContainerName string WorkloadKind string }
func ParseMonitoringRequestParams ¶
func ParseMonitoringRequestParams(request *restful.Request) *MonitoringRequestParams
Click to show internal directories.
Click to hide internal directories.