@@ -213,7 +213,20 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
213213
214214 for childNumber , process := range pool .Processes {
215215 childName := fmt .Sprintf ("%d" , childNumber )
216- ch <- prometheus .MustNewConstMetric (e .processState , prometheus .GaugeValue , 1 , pool .Name , childName , process .State , pool .Address )
216+
217+ states := map [string ]int {
218+ PoolProcessRequestIdle : 0 ,
219+ PoolProcessRequestRunning : 0 ,
220+ PoolProcessRequestFinishing : 0 ,
221+ PoolProcessRequestReadingHeaders : 0 ,
222+ PoolProcessRequestInfo : 0 ,
223+ PoolProcessRequestEnding : 0 ,
224+ }
225+ states [process .State ]++
226+
227+ for stateName , inState := range states {
228+ ch <- prometheus .MustNewConstMetric (e .processState , prometheus .GaugeValue , float64 (inState ), pool .Name , childName , stateName , pool .Address )
229+ }
217230 ch <- prometheus .MustNewConstMetric (e .processRequests , prometheus .CounterValue , float64 (process .Requests ), pool .Name , childName , pool .Address )
218231 ch <- prometheus .MustNewConstMetric (e .processLastRequestMemory , prometheus .GaugeValue , float64 (process .LastRequestMemory ), pool .Name , childName , pool .Address )
219232 ch <- prometheus .MustNewConstMetric (e .processLastRequestCPU , prometheus .GaugeValue , process .LastRequestCPU , pool .Name , childName , pool .Address )
0 commit comments