update as per the PR comment
This commit is contained in:
@@ -25,7 +25,7 @@ import (
|
||||
type Config struct {
|
||||
AppName string `yaml:"appName"`
|
||||
Log log.Config `yaml:"log"`
|
||||
Telemetry *telemetry.Config `yaml:"telemetry"`
|
||||
Telemetry *otelsetup.Config `yaml:"telemetry"`
|
||||
PluginManager *plugin.ManagerConfig `yaml:"pluginManager"`
|
||||
Modules []module.Config `yaml:"modules"`
|
||||
HTTP httpConfig `yaml:"http"`
|
||||
@@ -95,7 +95,7 @@ func validateConfig(cfg *Config) error {
|
||||
}
|
||||
|
||||
// initPlugins initializes application-level plugins including telemetry.
|
||||
func initPlugins(ctx context.Context, mgr *plugin.Manager, telemetryCfg *telemetry.Config) (*telemetry.Provider, error) {
|
||||
func initPlugins(ctx context.Context, mgr *plugin.Manager, telemetryCfg *otelsetup.Config) (*telemetry.Provider, error) {
|
||||
if telemetryCfg == nil {
|
||||
log.Info(ctx, "Telemetry config not provided; skipping OpenTelemetry setup")
|
||||
return nil, nil
|
||||
|
||||
@@ -5,13 +5,14 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/beckn-one/beckn-onix/pkg/telemetry"
|
||||
"github.com/beckn-one/beckn-onix/pkg/plugin/implementation/otelsetup"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestMetricsEndpointExposesPrometheus(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
provider, err := telemetry.NewProvider(ctx, &telemetry.Config{
|
||||
setup := otelsetup.Setup{}
|
||||
provider, err := setup.New(ctx, &otelsetup.Config{
|
||||
ServiceName: "test-onix",
|
||||
ServiceVersion: "1.0.0",
|
||||
EnableMetrics: true,
|
||||
|
||||
Reference in New Issue
Block a user