Documentation ¶
Index ¶
Constants ¶
View Source
const ( // NamespaceEnvKey is the metric namespace key in environment NamespaceEnvKey = "METRIC_NAMESPACE" // SubsystemEnvKey is the metric subsystem key in environment SubsystemEnvKey = "METRIC_SUBSYSTEM" )
Variables ¶
View Source
var ( // TotalInFlightGauge used to collect total in flight number TotalInFlightGauge = prometheus.NewGauge( prometheus.GaugeOpts{ Namespace: os.Getenv(NamespaceEnvKey), Subsystem: os.Getenv(SubsystemEnvKey), Name: "http_inflight_requests", Help: "The total number of requests", }, ) // TotalReqCnt used to collect total request counter TotalReqCnt = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: os.Getenv(NamespaceEnvKey), Subsystem: os.Getenv(SubsystemEnvKey), Name: "http_request_total", Help: "The total number of requests", }, []string{"method", "code", "operation"}, ) // TotalReqDurSummary used to collect total request duration summaries TotalReqDurSummary = prometheus.NewSummaryVec( prometheus.SummaryOpts{ Namespace: os.Getenv(NamespaceEnvKey), Subsystem: os.Getenv(SubsystemEnvKey), Name: "http_request_duration_seconds", Help: "The time duration of the requests", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }, []string{"method", "operation"}) )
View Source
var ( // JobserviceInfo used for collect jobservice information JobserviceInfo = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: os.Getenv(NamespaceEnvKey), Subsystem: os.Getenv(SubsystemEnvKey), Name: "info", Help: "the information of jobservice", }, []string{"node", "pool", "workers"}, ) // JobserviceTotalTask used for collect data JobserviceTotalTask = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: os.Getenv(NamespaceEnvKey), Subsystem: os.Getenv(SubsystemEnvKey), Name: "task_total", Help: "The number of processed tasks", }, []string{"type", "status"}, ) // JobservieTaskProcessTimeSummary used for instrument task running time JobservieTaskProcessTimeSummary = prometheus.NewSummaryVec( prometheus.SummaryOpts{ Namespace: os.Getenv(NamespaceEnvKey), Subsystem: os.Getenv(SubsystemEnvKey), Name: "task_process_time_seconds", Help: "The time duration of the task processing time", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }, []string{"type", "status"}) )
Functions ¶
func RegisterCollectors ¶
func RegisterCollectors()
RegisterCollectors register all the common static collector
func RegisterJobServiceCollectors ¶
func RegisterJobServiceCollectors()
RegisterJobServiceCollectors ...
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.