service

package
v0.0.0-...-712da53 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 FillChart

func FillChart(startTime, endTime time.Time, step time.Duration) map[int64]float64

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 (*DescendantStatus) SetValue

func (s *DescendantStatus) SetValue(metricGroup prom.MGroupName, metricName prom.MName, value float64)

type InstancesFilter

type InstancesFilter struct {
	SrvName    string
	ContentKey string
}

func (InstancesFilter) ExtractFilterStr

func (f InstancesFilter) ExtractFilterStr() []string

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 (*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

Jump to

Keyboard shortcuts

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