Skip to content

Commit

Permalink
Template - pass the job run id to the template (kube-burner#765)
Browse files Browse the repository at this point in the history
## Type of change

- [x] New feature

## Description

Add the RunID to the template param to allow marking sub-resources for
metrics

Signed-off-by: Ygal Blum <[email protected]>
  • Loading branch information
ygalblum authored Jan 2, 2025
1 parent 97e7bbe commit 8daa277
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ All object templates are injected with the variables below by default:
- `Replica`: Object replica number. Keep in mind that this number is reset to 1 with each job iteration.
- `JobName`: Job name.
- `UUID`: Benchmark UUID.
- `RunID`: Internal run id. Can be used to match resources for metrics collection

In addition, you can also inject arbitrary variables with the option `inputVars` of the object:

Expand Down
1 change: 1 addition & 0 deletions pkg/burner/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (ex *Executor) renderTemplateForObject(obj object, iteration, replicaIndex
jobName: ex.Name,
jobIteration: iteration,
jobUUID: ex.uuid,
jobRunId: ex.runid,
replica: replicaIndex,
}
for k, v := range obj.InputVars {
Expand Down
1 change: 1 addition & 0 deletions pkg/burner/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const (
replica = "Replica"
jobIteration = "Iteration"
jobUUID = "UUID"
jobRunId = "RunID"
rcTimeout = 2
rcAlert = 3
rcMeasurement = 4
Expand Down

0 comments on commit 8daa277

Please sign in to comment.