@@ -216,25 +216,25 @@ var (
216216 workerRequests = prometheus .NewCounterVec (prometheus.CounterOpts {
217217 Name : workerRequestsMetricName .String (),
218218 Help : "Number of requests sent to worker by script name" ,
219- }, []string {"script_name" , "account" },
219+ }, []string {"script_name" , "account" , "status" },
220220 )
221221
222222 workerErrors = prometheus .NewCounterVec (prometheus.CounterOpts {
223223 Name : workerErrorsMetricName .String (),
224224 Help : "Number of errors by script name" ,
225- }, []string {"script_name" , "account" },
225+ }, []string {"script_name" , "account" , "status" },
226226 )
227227
228228 workerCPUTime = prometheus .NewGaugeVec (prometheus.GaugeOpts {
229229 Name : workerCPUTimeMetricName .String (),
230230 Help : "CPU time quantiles by script name" ,
231- }, []string {"script_name" , "account" , "quantile" },
231+ }, []string {"script_name" , "account" , "status" , " quantile" },
232232 )
233233
234234 workerDuration = prometheus .NewGaugeVec (prometheus.GaugeOpts {
235235 Name : workerDurationMetricName .String (),
236236 Help : "Duration quantiles by script name (GB*s)" ,
237- }, []string {"script_name" , "account" , "quantile" },
237+ }, []string {"script_name" , "account" , "status" , " quantile" },
238238 )
239239
240240 poolHealthStatus = prometheus .NewGaugeVec (prometheus.GaugeOpts {
@@ -457,16 +457,16 @@ func fetchWorkerAnalytics(account cloudflare.Account, wg *sync.WaitGroup) {
457457
458458 for _ , a := range r .Viewer .Accounts {
459459 for _ , w := range a .WorkersInvocationsAdaptive {
460- workerRequests .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName }).Add (float64 (w .Sum .Requests ))
461- workerErrors .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName }).Add (float64 (w .Sum .Errors ))
462- workerCPUTime .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "quantile" : "P50" }).Set (float64 (w .Quantiles .CPUTimeP50 ))
463- workerCPUTime .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "quantile" : "P75" }).Set (float64 (w .Quantiles .CPUTimeP75 ))
464- workerCPUTime .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "quantile" : "P99" }).Set (float64 (w .Quantiles .CPUTimeP99 ))
465- workerCPUTime .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "quantile" : "P999" }).Set (float64 (w .Quantiles .CPUTimeP999 ))
466- workerDuration .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "quantile" : "P50" }).Set (float64 (w .Quantiles .DurationP50 ))
467- workerDuration .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "quantile" : "P75" }).Set (float64 (w .Quantiles .DurationP75 ))
468- workerDuration .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "quantile" : "P99" }).Set (float64 (w .Quantiles .DurationP99 ))
469- workerDuration .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "quantile" : "P999" }).Set (float64 (w .Quantiles .DurationP999 ))
460+ workerRequests .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status }).Add (float64 (w .Sum .Requests ))
461+ workerErrors .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status }).Add (float64 (w .Sum .Errors ))
462+ workerCPUTime .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status , " quantile" : "P50" }).Set (float64 (w .Quantiles .CPUTimeP50 ))
463+ workerCPUTime .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status , " quantile" : "P75" }).Set (float64 (w .Quantiles .CPUTimeP75 ))
464+ workerCPUTime .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status , " quantile" : "P99" }).Set (float64 (w .Quantiles .CPUTimeP99 ))
465+ workerCPUTime .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status , " quantile" : "P999" }).Set (float64 (w .Quantiles .CPUTimeP999 ))
466+ workerDuration .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status , " quantile" : "P50" }).Set (float64 (w .Quantiles .DurationP50 ))
467+ workerDuration .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status , " quantile" : "P75" }).Set (float64 (w .Quantiles .DurationP75 ))
468+ workerDuration .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status , " quantile" : "P99" }).Set (float64 (w .Quantiles .DurationP99 ))
469+ workerDuration .With (prometheus.Labels {"script_name" : w .Dimensions .ScriptName , "account" : accountName , "status" : w . Dimensions . Status , " quantile" : "P999" }).Set (float64 (w .Quantiles .DurationP999 ))
470470 }
471471 }
472472}
0 commit comments