EchoSrv: Enable auto route tracking for Azure App Insights (#113354)

* Echo: Enable auto route tracking with Azure App Insights

* Add server config option to disable auto route tracking

* fix not using minified js
This commit is contained in:
Josh Hunt
2025-11-11 16:33:46 +00:00
committed by GitHub
parent 4ae1774e1f
commit 96f34f8f56
13 changed files with 131 additions and 108 deletions
+3 -2
View File
@@ -38,8 +38,9 @@ type FSFrontendSettings struct {
AnalyticsConsoleReporting bool `json:"analyticsConsoleReporting,omitempty"`
GrafanaJavascriptAgent setting.GrafanaJavascriptAgent `json:"grafanaJavascriptAgent,omitempty"`
ApplicationInsightsConnectionString string `json:"applicationInsightsConnectionString,omitempty"`
ApplicationInsightsEndpointUrl string `json:"applicationInsightsEndpointUrl,omitempty"`
ApplicationInsightsConnectionString string `json:"applicationInsightsConnectionString,omitempty"`
ApplicationInsightsEndpointUrl string `json:"applicationInsightsEndpointUrl,omitempty"`
ApplicationInsightsAutoRouteTracking bool `json:"applicationInsightsAutoRouteTracking,omitempty"`
TrustedTypesDefaultPolicyEnabled bool `json:"trustedTypesDefaultPolicyEnabled,omitempty"`
CSPReportOnlyEnabled bool `json:"cspReportOnlyEnabled,omitempty"`
+29 -28
View File
@@ -67,34 +67,35 @@ func NewIndexProvider(cfg *setting.Cfg, assetsManifest dtos.EntryPointAssets, li
// subset of frontend settings needed for the login page
// TODO what about enterprise settings here?
frontendSettings := FSFrontendSettings{
AnalyticsConsoleReporting: cfg.FrontendAnalyticsConsoleReporting,
AnonymousEnabled: cfg.Anonymous.Enabled,
ApplicationInsightsConnectionString: cfg.ApplicationInsightsConnectionString,
ApplicationInsightsEndpointUrl: cfg.ApplicationInsightsEndpointUrl,
AuthProxyEnabled: cfg.AuthProxy.Enabled,
AutoAssignOrg: cfg.AutoAssignOrg,
CSPReportOnlyEnabled: cfg.CSPReportOnlyEnabled,
DisableLoginForm: cfg.DisableLoginForm,
DisableUserSignUp: !cfg.AllowUserSignUp,
GoogleAnalytics4Id: cfg.GoogleAnalytics4ID,
GoogleAnalytics4SendManualPageViews: cfg.GoogleAnalytics4SendManualPageViews,
GoogleAnalyticsId: cfg.GoogleAnalyticsID,
GrafanaJavascriptAgent: cfg.GrafanaJavascriptAgent,
Http2Enabled: cfg.Protocol == setting.HTTP2Scheme,
JwtHeaderName: cfg.JWTAuth.HeaderName,
JwtUrlLogin: cfg.JWTAuth.URLLogin,
LdapEnabled: cfg.LDAPAuthEnabled,
LoginHint: cfg.LoginHint,
PasswordHint: cfg.PasswordHint,
ReportingStaticContext: cfg.ReportingStaticContext,
RudderstackConfigUrl: cfg.RudderstackConfigURL,
RudderstackDataPlaneUrl: cfg.RudderstackDataPlaneURL,
RudderstackIntegrationsUrl: cfg.RudderstackIntegrationsURL,
RudderstackSdkUrl: cfg.RudderstackSDKURL,
RudderstackWriteKey: cfg.RudderstackWriteKey,
TrustedTypesDefaultPolicyEnabled: (cfg.CSPEnabled && strings.Contains(cfg.CSPTemplate, "require-trusted-types-for")) || (cfg.CSPReportOnlyEnabled && strings.Contains(cfg.CSPReportOnlyTemplate, "require-trusted-types-for")),
VerifyEmailEnabled: cfg.VerifyEmailEnabled,
BuildInfo: getBuildInfo(license, cfg),
AnalyticsConsoleReporting: cfg.FrontendAnalyticsConsoleReporting,
AnonymousEnabled: cfg.Anonymous.Enabled,
ApplicationInsightsConnectionString: cfg.ApplicationInsightsConnectionString,
ApplicationInsightsEndpointUrl: cfg.ApplicationInsightsEndpointUrl,
ApplicationInsightsAutoRouteTracking: cfg.ApplicationInsightsAutoRouteTracking,
AuthProxyEnabled: cfg.AuthProxy.Enabled,
AutoAssignOrg: cfg.AutoAssignOrg,
CSPReportOnlyEnabled: cfg.CSPReportOnlyEnabled,
DisableLoginForm: cfg.DisableLoginForm,
DisableUserSignUp: !cfg.AllowUserSignUp,
GoogleAnalytics4Id: cfg.GoogleAnalytics4ID,
GoogleAnalytics4SendManualPageViews: cfg.GoogleAnalytics4SendManualPageViews,
GoogleAnalyticsId: cfg.GoogleAnalyticsID,
GrafanaJavascriptAgent: cfg.GrafanaJavascriptAgent,
Http2Enabled: cfg.Protocol == setting.HTTP2Scheme,
JwtHeaderName: cfg.JWTAuth.HeaderName,
JwtUrlLogin: cfg.JWTAuth.URLLogin,
LdapEnabled: cfg.LDAPAuthEnabled,
LoginHint: cfg.LoginHint,
PasswordHint: cfg.PasswordHint,
ReportingStaticContext: cfg.ReportingStaticContext,
RudderstackConfigUrl: cfg.RudderstackConfigURL,
RudderstackDataPlaneUrl: cfg.RudderstackDataPlaneURL,
RudderstackIntegrationsUrl: cfg.RudderstackIntegrationsURL,
RudderstackSdkUrl: cfg.RudderstackSDKURL,
RudderstackWriteKey: cfg.RudderstackWriteKey,
TrustedTypesDefaultPolicyEnabled: (cfg.CSPEnabled && strings.Contains(cfg.CSPTemplate, "require-trusted-types-for")) || (cfg.CSPReportOnlyEnabled && strings.Contains(cfg.CSPReportOnlyTemplate, "require-trusted-types-for")),
VerifyEmailEnabled: cfg.VerifyEmailEnabled,
BuildInfo: getBuildInfo(license, cfg),
}
return &IndexProvider{