-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add job and execution metrics:
- Job Duration - Number of Jobs Submitted - Active Docker Executions - Active WASM Executions - Basic Node Info (metric isn't valuable, labels are)
- Loading branch information
Showing
13 changed files
with
148 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
package compute | ||
|
||
import ( | ||
"github.com/samber/lo" | ||
"go.opentelemetry.io/otel" | ||
"go.opentelemetry.io/otel/metric" | ||
) | ||
|
||
// Metrics for monitoring compute nodes: | ||
var ( | ||
meter = otel.GetMeterProvider().Meter("compute") | ||
jobsReceived, _ = meter.Int64Counter( | ||
meter = otel.GetMeterProvider().Meter("compute") | ||
jobsReceived = lo.Must(meter.Int64Counter( | ||
"jobs_received", | ||
metric.WithDescription("Number of jobs received by the compute node"), | ||
) | ||
)) | ||
|
||
jobsAccepted, _ = meter.Int64Counter( | ||
jobsAccepted = lo.Must(meter.Int64Counter( | ||
"jobs_accepted", | ||
metric.WithDescription("Number of jobs bid on and accepted by the compute node"), | ||
) | ||
)) | ||
|
||
jobsCompleted, _ = meter.Int64Counter( | ||
jobsCompleted = lo.Must(meter.Int64Counter( | ||
"jobs_completed", | ||
metric.WithDescription("Number of jobs completed by the compute node."), | ||
) | ||
)) | ||
|
||
jobsFailed, _ = meter.Int64Counter( | ||
jobsFailed = lo.Must(meter.Int64Counter( | ||
"jobs_failed", | ||
metric.WithDescription("Number of jobs failed by the compute node."), | ||
) | ||
)) | ||
|
||
jobDurationMilliseconds = lo.Must(meter.Int64Histogram( | ||
"job_duration_milliseconds", | ||
metric.WithDescription("Duration of a job on the compute node in milliseconds."), | ||
metric.WithUnit("ms"), | ||
)) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package docker | ||
|
||
import ( | ||
"github.com/samber/lo" | ||
"go.opentelemetry.io/otel" | ||
|
||
"github.com/bacalhau-project/bacalhau/pkg/telemetry" | ||
) | ||
|
||
var ( | ||
dockerExecutorMeter = otel.GetMeterProvider().Meter("docker-executor") | ||
) | ||
|
||
var ( | ||
ActiveExecutions = lo.Must(telemetry.NewGauge( | ||
dockerExecutorMeter, | ||
"docker_active_executions", | ||
"Number of active docker executions", | ||
)) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package wasm | ||
|
||
import ( | ||
"github.com/samber/lo" | ||
"go.opentelemetry.io/otel" | ||
|
||
"github.com/bacalhau-project/bacalhau/pkg/telemetry" | ||
) | ||
|
||
var ( | ||
wasmExecutorMeter = otel.GetMeterProvider().Meter("wasm-executor") | ||
) | ||
|
||
var ( | ||
ActiveExecutions = lo.Must(telemetry.NewGauge( | ||
wasmExecutorMeter, | ||
"wasm_active_executions", | ||
"Number of active WASM executions", | ||
)) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package metrics | ||
|
||
import ( | ||
"github.com/samber/lo" | ||
"go.opentelemetry.io/otel" | ||
|
||
"github.com/bacalhau-project/bacalhau/pkg/telemetry" | ||
) | ||
|
||
var ( | ||
nodeMeter = otel.GetMeterProvider().Meter("bacalhau-node") | ||
) | ||
|
||
var ( | ||
NodeInfo = lo.Must(telemetry.NewCounter( | ||
nodeMeter, | ||
"bacalhau_node_info", | ||
"A static metric with labels describing the bacalhau node", | ||
)) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package requester | ||
|
||
import ( | ||
"github.com/samber/lo" | ||
"go.opentelemetry.io/otel" | ||
|
||
"github.com/bacalhau-project/bacalhau/pkg/telemetry" | ||
) | ||
|
||
var ( | ||
requesterMeter = otel.GetMeterProvider().Meter("requester") | ||
) | ||
|
||
var ( | ||
JobsSubmitted = lo.Must(telemetry.NewCounter( | ||
requesterMeter, | ||
"job_submitted", | ||
"Number of jobs submitted")) | ||
) |