Documentation ¶
Index ¶
- Constants
- func DataToChart(data []prometheus.Points) map[int64]float64
- func ExtractLogFilter(instance prometheus.InstanceKey) []string
- func FillChart(startTime, endTime time.Time, step time.Duration) map[int64]float64
- func IsInvalidData(m map[prometheus.InstanceKey]*prometheus.InstanceMetrics, ...) bool
- type DescendantStatus
- type DescendantStatusMap
- type InstanceMap
- type InstancesFilter
- type SQLMetricMap
- type SQLMetricsWithChart
- func (s *SQLMetricsWithChart) AppendGroupIfNotExist(metricGroup prom.MGroupName, metricName prom.MName) bool
- func (s *SQLMetricsWithChart) InitEmptyGroup(key prom.ConvertFromLabels) prom.MetricGroup
- func (s *SQLMetricsWithChart) SetValue(metricGroup prom.MGroupName, metricName prom.MName, value float64)
- type Service
Constants ¶
View Source
const ( // Container creation CreatedContainer = "Created" // Container start StartedContainer = "Started" // Failed to start container FailedToCreateContainer = "Failed" FailedToStartContainer = "Failed" // Delete container KillingContainer = "Killing" PreemptContainer = "Preempting" // Failed to start container and retry BackOffStartContainer = "BackOff" // container timeout ExceededGracePeriod = "ExceededGracePeriod" )
Copied from kubernetes/pkg/kubelet/events/event.go Container event reason list
View Source
const ( // Failed to delete pod FailedToKillPod = "FailedKillPod" // Failed to create pod FailedToCreatePodContainer = "FailedCreatePodContainer" FailedToMakePodDataDirectories = "Failed" // Network not ready NetworkNotReady = "NetworkNotReady" )
Pod event reason list
View Source
const ( // Getting mirror PullingImage = "Pulling" // Image obtained successfully PulledImage = "Pulled" // Failed to get mirror FailedToPullImage = "Failed" FailedToInspectImage = "InspectFailed" ErrImageNeverPullPolicy = "ErrImageNeverPull" // Retry pulling image BackOffPullImage = "BackOff" )
Image event reason list
View Source
const ( // Host node is ready NodeReady = "NodeReady" // Host node is not ready NodeNotReady = "NodeNotReady" NodeSchedulable = "NodeSchedulable" NodeNotSchedulable = "NodeNotSchedulable" StartingKubelet = "Starting" KubeletSetupFailed = "KubeletSetupFailed" FailedAttachVolume = "FailedAttachVolume" FailedMountVolume = "FailedMount" VolumeResizeFailed = "VolumeResizeFailed" VolumeResizeSuccess = "VolumeResizeSuccessful" FileSystemResizeFailed = "FileSystemResizeFailed" FileSystemResizeSuccess = "FileSystemResizeSuccessful" FailedMapVolume = "FailedMapVolume" WarnAlreadyMountedVolume = "AlreadyMountedVolume" SuccessfulAttachVolume = "SuccessfulAttachVolume" SuccessfulMountVolume = "SuccessfulMountVolume" NodeRebooted = "Rebooted" NodeShutdown = "Shutdown" ContainerGCFailed = "ContainerGCFailed" ImageGCFailed = "ImageGCFailed" FailedNodeAllocatableEnforcement = "FailedNodeAllocatableEnforcement" SuccessfulNodeAllocatableEnforcement = "NodeAllocatableEnforced" SandboxChanged = "SandboxChanged" FailedCreatePodSandBox = "FailedCreatePodSandBox" FailedStatusPodSandBox = "FailedPodSandBoxStatus" FailedMountOnFilesystemMismatch = "FailedMountOnFilesystemMismatch" FailedPrepareDynamicResources = "FailedPrepareDynamicResources" PossibleMemoryBackedVolumesOnDisk = "PossibleMemoryBackedVolumesOnDisk" CgroupV1 = "CgroupV1" )
kubelet event reason list
View Source
const ( InvalidDiskCapacity = "InvalidDiskCapacity" FreeDiskSpaceFailed = "FreeDiskSpaceFailed" )
Image manager event reason list
View Source
const ( // Container health check failed ContainerUnhealthy = "Unhealthy" ContainerProbeWarning = "ProbeWarning" )
Probe event reason list
View Source
const ( FailedPostStartHook = "FailedPostStartHook" FailedPreStopHook = "FailedPreStopHook" )
Lifecycle hooks
View Source
const ( SortByLatency = "latency" SortByErrorRate = "errorRate" SortByTps = "tps" )
View Source
const (
FailedSync = "FailedSync"
)
Pod worker event reason list
View Source
const (
FailedValidation = "FailedValidation"
)
Config event reason list
Variables ¶
This section is empty.
Functions ¶
func DataToChart ¶
func DataToChart(data []prometheus.Points) map[int64]float64
DataToChart convert chart data to map
func ExtractLogFilter ¶
func ExtractLogFilter(instance prometheus.InstanceKey) []string
func IsInvalidData ¶
func IsInvalidData(m map[prometheus.InstanceKey]*prometheus.InstanceMetrics, metric *prometheus.InstanceMetrics) bool
Types ¶
type DescendantStatus ¶
type DescendantStatus struct { DepLatency *float64 Latency *float64 LatencyDoD *float64 // Delay Day-over-Day Growth Rate ErrorRateDoD *float64 // Error Rate Day-over-Day Growth Rate RequestPerSecondDoD *float64 // Request Day-over-Day Growth Rate }
func (*DescendantStatus) AppendGroupIfNotExist ¶
func (s *DescendantStatus) AppendGroupIfNotExist(_ prom.MGroupName, metricName prom.MName) bool
func (*DescendantStatus) InitEmptyGroup ¶
func (s *DescendantStatus) InitEmptyGroup(_ prom.ConvertFromLabels) prom.MetricGroup
func (*DescendantStatus) SetValue ¶
func (s *DescendantStatus) SetValue(metricGroup prom.MGroupName, metricName prom.MName, value float64)
type DescendantStatusMap ¶
type DescendantStatusMap = prom.MetricGroupMap[prom.EndpointKey, *DescendantStatus]
type InstanceMap ¶
type InstanceMap = prometheus.MetricGroupMap[prometheus.InstanceKey, *prometheus.InstanceMetrics]
type InstancesFilter ¶
func (InstancesFilter) ExtractFilterStr ¶
func (f InstancesFilter) ExtractFilterStr() []string
type SQLMetricMap ¶
type SQLMetricMap = prom.MetricGroupMap[prom.SQLKey, *SQLMetricsWithChart]
type SQLMetricsWithChart ¶
type SQLMetricsWithChart struct { prom.SQLKey REDMetrics prom.REDMetrics LatencyChartData map[int64]float64 ErrorRateChartData map[int64]float64 TpsChartData map[int64]float64 }
func (*SQLMetricsWithChart) AppendGroupIfNotExist ¶
func (s *SQLMetricsWithChart) AppendGroupIfNotExist(metricGroup prom.MGroupName, metricName prom.MName) bool
func (*SQLMetricsWithChart) InitEmptyGroup ¶
func (s *SQLMetricsWithChart) InitEmptyGroup(key prom.ConvertFromLabels) prom.MetricGroup
func (*SQLMetricsWithChart) SetValue ¶
func (s *SQLMetricsWithChart) SetValue(metricGroup prom.MGroupName, metricName prom.MName, value float64)
type Service ¶
type Service interface { // Get the relationship between upstream and downstream calls GetServiceEndpointRelation(req *request.GetServiceEndpointRelationRequest) (*response.GetServiceEndpointRelationResponse, error) // Get the upstream and downstream topology map GetServiceEndpointTopology(req *request.GetServiceEndpointTopologyRequest) (*response.GetServiceEndpointTopologyResponse, error) // Get the delay curve of the dependent service GetDescendantMetrics(req *request.GetDescendantMetricsRequest) ([]response.GetDescendantMetricsResponse, error) // Get the dependent node delay correlation. GetDescendantRelevance(req *request.GetDescendantRelevanceRequest) ([]response.GetDescendantRelevanceResponse, error) // Get Polaris metric analysis GetPolarisInfer(req *request.GetPolarisInferRequest) (*response.GetPolarisInferResponse, error) // Get error instance GetErrorInstance(req *request.GetErrorInstanceRequest) (*response.GetErrorInstanceResponse, error) // Get the error instance fault site log GetErrorInstanceLogs(req *request.GetErrorInstanceLogsRequest) ([]clickhouse.FaultLogResult, error) // Get log metrics GetLogMetrics(req *request.GetLogMetricsRequest) ([]*response.GetLogMetricsResponse, error) // Get Log fault field log GetLogLogs(req *request.GetLogLogsRequest) ([]clickhouse.FaultLogResult, error) // Get Trace related metrics GetTraceMetrics(req *request.GetTraceMetricsRequest) ([]*response.GetTraceMetricsResponse, error) // Get SQL related metrics GetSQLMetrics(req *request.GetSQLMetricsRequest) (*response.GetSQLMetricsResponse, error) // Get trace fault site log GetTraceLogs(req *request.GetTraceLogsRequest) ([]clickhouse.FaultLogResult, error) // Get the list of services GetServiceList(req *request.GetServiceListRequest) ([]string, error) // Get the list of service instances // New interface GetInstancesNew(startTime time.Time, endTime time.Time, step time.Duration, serviceName string, endPoint string) (res response.InstancesRes, err error) // Old interface GetInstances(startTime time.Time, endTime time.Time, step time.Duration, serviceName string, endPoint string) (res response.InstancesRes, err error) // Get the list of service instances // DEPRECATED GetServiceInstanceList(req *request.GetServiceInstanceListRequest) ([]string, error) // Get service instance details GetServiceInstanceInfoList(req *request.GetServiceInstanceListRequest) ([]prometheus.InstanceKey, error) // Get service instance drop-down list GetServiceInstanceOptions(req *request.GetServiceInstanceOptionsRequest) (map[string]*model.ServiceInstance, error) // Get the list of service Endpoint GetServiceEndPointList(req *request.GetServiceEndPointListRequest) ([]string, error) // Get the list of service portal Endpoint GetServiceEntryEndpoints(req *request.GetServiceEntryEndpointsRequest) ([]clickhouse.EntryNode, error) // CountK8sEvents get the number of K8s events CountK8sEvents(req *request.GetK8sEventsRequest) (*response.GetK8sEventsResponse, error) // GetAlertEvents get alarm events GetAlertEvents(req *request.GetAlertEventsRequest) (*response.GetAlertEventsResponse, error) // GetAlertEventsSample get sampled alarm events GetAlertEventsSample(req *request.GetAlertEventsSampleRequest) (*response.GetAlertEventsSampleResponse, error) GetServiceNamespaceList(req *request.GetServiceNamespaceListRequest) (response.GetServiceNamespaceListResponse, error) }
func New ¶
func New(chRepo clickhouse.Repo, promRepo prometheus.Repo, polRepo polarisanalyzer.Repo, dbRepo database.Repo) Service
Source Files ¶
- instance_filldata_by_containerid.go
- instance_filldata_by_pid.go
- instance_filldata_by_pod.go
- log_filldata.go
- service.go
- service_count_k8s_events.go
- service_filldata.go
- service_get_alert_events.go
- service_get_descendant_metrics.go
- service_get_descendant_relevance.go
- service_get_error_instance.go
- service_get_errorinstance_logs.go
- service_get_log_logs.go
- service_get_log_metrics.go
- service_get_namespace_list.go
- service_get_polaris_infer.go
- service_get_service_endpoint_list.go
- service_get_service_endpoint_relation.go
- service_get_service_endpoint_topology.go
- service_get_service_entry_endpoints.go
- service_get_service_instance_list.go
- service_get_service_instance_options.go
- service_get_service_list.go
- service_get_sql_metrics.go
- service_get_trace_logs.go
- service_get_trace_metrics.go
- service_instance_new.go
- service_instances.go
Click to show internal directories.
Click to hide internal directories.