Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status code in worker_errors and worker_requests metrics #67

Open
POD666 opened this issue May 31, 2022 · 0 comments
Open

Status code in worker_errors and worker_requests metrics #67

POD666 opened this issue May 31, 2022 · 0 comments

Comments

@POD666
Copy link

POD666 commented May 31, 2022

Hi,

I want to observe errors/requests counts by different status codes.
But the only available dimension is script_name.

Looks like it's missing from being passed to labels at the moment:

for _, a := range r.Viewer.Accounts {
for _, w := range a.WorkersInvocationsAdaptive {
workerRequests.With(prometheus.Labels{"script_name": w.Dimensions.ScriptName}).Add(float64(w.Sum.Requests))
workerErrors.With(prometheus.Labels{"script_name": w.Dimensions.ScriptName}).Add(float64(w.Sum.Errors))
workerCPUTime.With(prometheus.Labels{"script_name": w.Dimensions.ScriptName, "quantile": "P50"}).Set(float64(w.Quantiles.CPUTimeP50))
workerCPUTime.With(prometheus.Labels{"script_name": w.Dimensions.ScriptName, "quantile": "P75"}).Set(float64(w.Quantiles.CPUTimeP75))

Meanwhile, it seems to be supported:

type accountResp struct {
WorkersInvocationsAdaptive []struct {
Dimensions struct {
ScriptName string `json:"scriptName"`
Status string `json:"status"`
}
Sum struct {

Do I miss anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant