update as per the comment in pr
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
// Metrics exposes strongly typed metric instruments used across the adapter.
|
||||
// Note: Most metrics have been moved to their respective modules. Only plugin-level
|
||||
// metrics remain here. See:
|
||||
// - HTTP metrics: pkg/plugin/implementation/otelmetrics/metrics.go
|
||||
// - OTel setup: pkg/plugin/implementation/otelsetup
|
||||
// - Step metrics: pkg/telemetry/step_metrics.go
|
||||
// - Cache metrics: pkg/plugin/implementation/cache/metrics.go
|
||||
// - Handler metrics: core/module/handler/metrics.go
|
||||
|
||||
@@ -11,19 +11,23 @@ import (
|
||||
|
||||
"github.com/beckn-one/beckn-onix/pkg/log"
|
||||
"github.com/beckn-one/beckn-onix/pkg/model"
|
||||
"github.com/beckn-one/beckn-onix/pkg/plugin/definition"
|
||||
)
|
||||
|
||||
// StepRunner represents the minimal contract required for step instrumentation.
|
||||
type StepRunner interface {
|
||||
Run(*model.StepContext) error
|
||||
}
|
||||
|
||||
// InstrumentedStep wraps a processing step with telemetry instrumentation.
|
||||
type InstrumentedStep struct {
|
||||
step definition.Step
|
||||
step StepRunner
|
||||
stepName string
|
||||
moduleName string
|
||||
metrics *StepMetrics
|
||||
}
|
||||
|
||||
// NewInstrumentedStep returns a telemetry enabled wrapper around a definition.Step.
|
||||
func NewInstrumentedStep(step definition.Step, stepName, moduleName string) (*InstrumentedStep, error) {
|
||||
func NewInstrumentedStep(step StepRunner, stepName, moduleName string) (*InstrumentedStep, error) {
|
||||
metrics, err := GetStepMetrics(context.Background())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user