-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Observability: Duty Scheduler instrumentation
- Loading branch information
1 parent
bafae73
commit 0c69041
Showing
2 changed files
with
57 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package duties | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/ssvlabs/ssv/observability" | ||
"go.opentelemetry.io/otel" | ||
"go.opentelemetry.io/otel/metric" | ||
) | ||
|
||
const ( | ||
observabilityComponentName = "github.com/ssvlabs/ssv/operator/duties" | ||
observabilityComponentNamespace = "ssv.operator.duty_scheduler" | ||
) | ||
|
||
var ( | ||
meter = otel.Meter(observabilityComponentName) | ||
|
||
slotDelayHistogram = observability.GetMetric( | ||
fmt.Sprintf("%s.slot_ticker_delay.duration", observabilityComponentNamespace), | ||
func(metricName string) (metric.Float64Histogram, error) { | ||
return meter.Float64Histogram( | ||
metricName, | ||
metric.WithUnit("s"), | ||
metric.WithDescription("delay of the slot ticker"), | ||
metric.WithExplicitBucketBoundaries([]float64{5, 10, 20, 100, 500, 5000}...)) | ||
}, | ||
) | ||
|
||
dutiesExecutedCounter = observability.GetMetric( | ||
fmt.Sprintf("%s.executions", observabilityComponentNamespace), | ||
func(metricName string) (metric.Int64Counter, error) { | ||
return meter.Int64Counter( | ||
metricName, | ||
metric.WithUnit("{duty}"), | ||
metric.WithDescription("total number of duties executed by scheduler")) | ||
}, | ||
) | ||
|
||
committeeDutiesExecutedCounter = observability.GetMetric( | ||
fmt.Sprintf("%s.committee_executions", observabilityComponentNamespace), | ||
func(metricName string) (metric.Int64Counter, error) { | ||
return meter.Int64Counter( | ||
metricName, | ||
metric.WithUnit("{committee_duty}"), | ||
metric.WithDescription("total number of committee duties executed by scheduler")) | ||
}, | ||
) | ||
) |
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