Skip to content

Commit

Permalink
BCF-2641 Add prom bridge_name metric label to PromPipelineTasksTotalF…
Browse files Browse the repository at this point in the history
…inished (#10861)

* Add prom bridge_name metric label to PromPipelineTasksTotalFinished

* Update changelog

* Update changelog

* Add prom pipeline_tasks_total_fin... metric label addition to changelog
  • Loading branch information
ilija42 authored Oct 23, 2023
1 parent 5211322 commit ae8ec42
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/services/fluxmonitorv2/flux_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ func (fm *FluxMonitor) isValidSubmission(l logger.Logger, answer decimal.Decimal
pipeline.PromPipelineTaskExecutionTime.WithLabelValues(fmt.Sprintf("%d", jobId), jobName, "", job.FluxMonitor.String()).Set(float64(elapsed))
pipeline.PromPipelineRunErrors.WithLabelValues(fmt.Sprintf("%d", jobId), jobName).Inc()
pipeline.PromPipelineRunTotalTimeToCompletion.WithLabelValues(fmt.Sprintf("%d", jobId), jobName).Set(float64(elapsed))
pipeline.PromPipelineTasksTotalFinished.WithLabelValues(fmt.Sprintf("%d", jobId), jobName, "", job.FluxMonitor.String(), "error").Inc()
pipeline.PromPipelineTasksTotalFinished.WithLabelValues(fmt.Sprintf("%d", jobId), jobName, "", job.FluxMonitor.String(), "", "error").Inc()
return false
}

Expand Down
10 changes: 8 additions & 2 deletions core/services/pipeline/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var (
Name: "pipeline_tasks_total_finished",
Help: "The total number of pipeline tasks which have finished",
},
[]string{"job_id", "job_name", "task_id", "task_type", "status"},
[]string{"job_id", "job_name", "task_id", "task_type", "bridge_name", "status"},
)
)

Expand Down Expand Up @@ -488,7 +488,13 @@ func logTaskRunToPrometheus(trr TaskRunResult, spec Spec) {
} else {
status = "completed"
}
PromPipelineTasksTotalFinished.WithLabelValues(fmt.Sprintf("%d", spec.JobID), spec.JobName, trr.Task.DotID(), string(trr.Task.Type()), status).Inc()

bridgeName := ""
if bridgeTask, ok := trr.Task.(*BridgeTask); ok {
bridgeName = bridgeTask.Name
}

PromPipelineTasksTotalFinished.WithLabelValues(fmt.Sprintf("%d", spec.JobID), spec.JobName, trr.Task.DotID(), string(trr.Task.Type()), bridgeName, status).Inc()
}

// ExecuteAndInsertFinishedRun executes a run in memory then inserts the finished run/task run records, returning the final result
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ URL = '...'
ServerPubKey = '...'
```
These will eventually replace `TelemetryIngress.URL` and `TelemetryIngress.ServerPubKey`. Setting `TelemetryIngress.URL` and `TelemetryIngress.ServerPubKey` alongside `[[TelemetryIngress.Endpoints]]` will prevent the node from booting. Only one way of configuring telemetry endpoints is supported.
- Added bridge_name label to `pipeline_tasks_total_finished` prometheus metric. This should make it easier to see directly what bridge was failing out from the CL NODE perspective.

### Upcoming Required Configuration Change

Expand Down

0 comments on commit ae8ec42

Please sign in to comment.