SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix(web): update web settings config (#11548)
Vikrant Guptaca5ff7f617f7
diff --git a/pkg/web/config.go b/pkg/web/config.goindex bf90b92c6f..4fa3c428e0 100644--- a/pkg/web/config.go+++ b/pkg/web/config.go@@ -24,7 +24,7 @@ type SettingsConfig struct {Posthog PosthogConfig `mapstructure:"posthog"`Appcues AppcuesConfig `mapstructure:"appcues"`Sentry SentryConfig `mapstructure:"sentry"`- Pylon PylonConfig `mapstructure:"sentry"`+ Pylon PylonConfig `mapstructure:"pylon"`}type PosthogConfig struct {diff --git a/pkg/web/config_test.go b/pkg/web/config_test.goindex f4997cbbc7..f131e9622b 100644--- a/pkg/web/config_test.go+++ b/pkg/web/config_test.go@@ -43,3 +43,42 @@ func TestNewWithEnvProvider(t *testing.T) {assert.Equal(t, expected, actual)}++func TestSettingsConfigWithEnvProvider(t *testing.T) {+ testCases := []struct {+ name string+ env string+ expected SettingsConfig+ }{+ {name: "posthog", env: "SIGNOZ_WEB_SETTINGS_POSTHOG_ENABLED", expected: SettingsConfig{Posthog: PosthogConfig{Enabled: true}}},+ {name: "appcues", env: "SIGNOZ_WEB_SETTINGS_APPCUES_ENABLED", expected: SettingsConfig{Appcues: AppcuesConfig{Enabled: true}}},+ {name: "sentry", env: "SIGNOZ_WEB_SETTINGS_SENTRY_ENABLED", expected: SettingsConfig{Sentry: SentryConfig{Enabled: true}}},+ {name: "pylon", env: "SIGNOZ_WEB_SETTINGS_PYLON_ENABLED", expected: SettingsConfig{Pylon: PylonConfig{Enabled: true}}},+ }++ for _, testCase := range testCases {+ t.Run(testCase.name, func(t *testing.T) {+ t.Setenv(testCase.env, "true")++ conf, err := config.New(+ context.Background(),+ config.ResolverConfig{+ Uris: []string{"env:"},+ ProviderFactories: []config.ProviderFactory{+ envprovider.NewFactory(),+ },+ },+ []factory.ConfigFactory{+ NewConfigFactory(),+ },+ )+ require.NoError(t, err)++ actual := &Config{}+ err = conf.Unmarshal("web", actual)+ require.NoError(t, err)++ assert.Equal(t, testCase.expected, actual.Settings)+ })+ }+}