update as per the comment in pr
This commit is contained in:
22
pkg/plugin/implementation/otelsetup/otelsetup.go
Normal file
22
pkg/plugin/implementation/otelsetup/otelsetup.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package otelsetup
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/beckn-one/beckn-onix/pkg/telemetry"
|
||||
)
|
||||
|
||||
// Setup wires the telemetry provider using the shared telemetry package. This
|
||||
// is the concrete implementation behind the MetricsProvider interface.
|
||||
type Setup struct{}
|
||||
|
||||
// New initializes the underlying telemetry provider. The returned provider
|
||||
// exposes the HTTP handler and shutdown hooks that the core application can
|
||||
// manage directly.
|
||||
func (Setup) New(ctx context.Context, cfg *telemetry.Config) (*telemetry.Provider, error) {
|
||||
if cfg == nil {
|
||||
return nil, fmt.Errorf("telemetry config cannot be nil")
|
||||
}
|
||||
return telemetry.NewProvider(ctx, cfg)
|
||||
}
|
||||
Reference in New Issue
Block a user