update as per the comment in pr

This commit is contained in:
Manendra Pal Singh
2025-11-27 22:43:42 +05:30
parent 88eef682df
commit 5e3170c859
15 changed files with 506 additions and 294 deletions

View 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)
}