mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 01:02:23 +08:00
Analytics: Add option to pass destSDKBaseURL to rudderstack load method (#74926)
* Add option to pass destSDKBaseURL to rudderstack load method * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> --------- Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
This commit is contained in:
@ -279,6 +279,9 @@ rudderstack_sdk_url =
|
|||||||
# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config
|
# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config
|
||||||
rudderstack_config_url =
|
rudderstack_config_url =
|
||||||
|
|
||||||
|
# Rudderstack Integrations URL, optional. Only valid if you pass the SDK version 1.1 or higher
|
||||||
|
rudderstack_integrations_url =
|
||||||
|
|
||||||
# Intercom secret, optional, used to hash user_id before passing to Intercom via Rudderstack
|
# Intercom secret, optional, used to hash user_id before passing to Intercom via Rudderstack
|
||||||
intercom_secret =
|
intercom_secret =
|
||||||
|
|
||||||
|
@ -286,6 +286,9 @@
|
|||||||
# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config
|
# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config
|
||||||
;rudderstack_config_url =
|
;rudderstack_config_url =
|
||||||
|
|
||||||
|
# Rudderstack Integrations URL, optional. Only valid if you pass the SDK version 1.1 or higher
|
||||||
|
;rudderstack_integrations_url =
|
||||||
|
|
||||||
# Intercom secret, optional, used to hash user_id before passing to Intercom via Rudderstack
|
# Intercom secret, optional, used to hash user_id before passing to Intercom via Rudderstack
|
||||||
;intercom_secret =
|
;intercom_secret =
|
||||||
|
|
||||||
|
@ -575,6 +575,12 @@ URL to load the Rudderstack SDK.
|
|||||||
Optional. If tracking with Rudderstack is enabled, you can provide a custom
|
Optional. If tracking with Rudderstack is enabled, you can provide a custom
|
||||||
URL to load the Rudderstack config.
|
URL to load the Rudderstack config.
|
||||||
|
|
||||||
|
### rudderstack_integrations_url
|
||||||
|
|
||||||
|
Optional. If tracking with Rudderstack is enabled, you can provide a custom
|
||||||
|
URL to load the SDK for destinations running in device mode. This setting is only valid for
|
||||||
|
Rudderstack version 1.1 and higher.
|
||||||
|
|
||||||
### application_insights_connection_string
|
### application_insights_connection_string
|
||||||
|
|
||||||
If you want to track Grafana usage via Azure Application Insights, then specify _your_ Application Insights connection string. Since the connection string contains semicolons, you need to wrap it in backticks (`). By default, tracking usage is disabled.
|
If you want to track Grafana usage via Azure Application Insights, then specify _your_ Application Insights connection string. Since the connection string contains semicolons, you need to wrap it in backticks (`). By default, tracking usage is disabled.
|
||||||
|
@ -219,6 +219,7 @@ export interface GrafanaConfig {
|
|||||||
rudderstackDataPlaneUrl: string | undefined;
|
rudderstackDataPlaneUrl: string | undefined;
|
||||||
rudderstackSdkUrl: string | undefined;
|
rudderstackSdkUrl: string | undefined;
|
||||||
rudderstackConfigUrl: string | undefined;
|
rudderstackConfigUrl: string | undefined;
|
||||||
|
rudderstackIntegrationsUrl: string | undefined;
|
||||||
sqlConnectionLimits: SqlConnectionLimits;
|
sqlConnectionLimits: SqlConnectionLimits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,6 +150,7 @@ export class GrafanaBootConfig implements GrafanaConfig {
|
|||||||
rudderstackDataPlaneUrl: undefined;
|
rudderstackDataPlaneUrl: undefined;
|
||||||
rudderstackSdkUrl: undefined;
|
rudderstackSdkUrl: undefined;
|
||||||
rudderstackConfigUrl: undefined;
|
rudderstackConfigUrl: undefined;
|
||||||
|
rudderstackIntegrationsUrl: undefined;
|
||||||
sqlConnectionLimits = {
|
sqlConnectionLimits = {
|
||||||
maxOpenConns: 100,
|
maxOpenConns: 100,
|
||||||
maxIdleConns: 100,
|
maxIdleConns: 100,
|
||||||
|
@ -156,10 +156,11 @@ type FrontendSettingsDTO struct {
|
|||||||
GoogleAnalytics4Id string `json:"googleAnalytics4Id"`
|
GoogleAnalytics4Id string `json:"googleAnalytics4Id"`
|
||||||
GoogleAnalytics4SendManualPageViews bool `json:"GoogleAnalytics4SendManualPageViews"`
|
GoogleAnalytics4SendManualPageViews bool `json:"GoogleAnalytics4SendManualPageViews"`
|
||||||
|
|
||||||
RudderstackWriteKey string `json:"rudderstackWriteKey"`
|
RudderstackWriteKey string `json:"rudderstackWriteKey"`
|
||||||
RudderstackDataPlaneUrl string `json:"rudderstackDataPlaneUrl"`
|
RudderstackDataPlaneUrl string `json:"rudderstackDataPlaneUrl"`
|
||||||
RudderstackSdkUrl string `json:"rudderstackSdkUrl"`
|
RudderstackSdkUrl string `json:"rudderstackSdkUrl"`
|
||||||
RudderstackConfigUrl string `json:"rudderstackConfigUrl"`
|
RudderstackConfigUrl string `json:"rudderstackConfigUrl"`
|
||||||
|
RudderstackIntegrationsUrl string `json:"rudderstackIntegrationsUrl"`
|
||||||
|
|
||||||
FeedbackLinksEnabled bool `json:"feedbackLinksEnabled"`
|
FeedbackLinksEnabled bool `json:"feedbackLinksEnabled"`
|
||||||
ApplicationInsightsConnectionString string `json:"applicationInsightsConnectionString"`
|
ApplicationInsightsConnectionString string `json:"applicationInsightsConnectionString"`
|
||||||
|
@ -136,6 +136,7 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
|
|||||||
RudderstackDataPlaneUrl: hs.Cfg.RudderstackDataPlaneURL,
|
RudderstackDataPlaneUrl: hs.Cfg.RudderstackDataPlaneURL,
|
||||||
RudderstackSdkUrl: hs.Cfg.RudderstackSDKURL,
|
RudderstackSdkUrl: hs.Cfg.RudderstackSDKURL,
|
||||||
RudderstackConfigUrl: hs.Cfg.RudderstackConfigURL,
|
RudderstackConfigUrl: hs.Cfg.RudderstackConfigURL,
|
||||||
|
RudderstackIntegrationsUrl: hs.Cfg.RudderstackIntegrationsURL,
|
||||||
FeedbackLinksEnabled: hs.Cfg.FeedbackLinksEnabled,
|
FeedbackLinksEnabled: hs.Cfg.FeedbackLinksEnabled,
|
||||||
ApplicationInsightsConnectionString: hs.Cfg.ApplicationInsightsConnectionString,
|
ApplicationInsightsConnectionString: hs.Cfg.ApplicationInsightsConnectionString,
|
||||||
ApplicationInsightsEndpointUrl: hs.Cfg.ApplicationInsightsEndpointUrl,
|
ApplicationInsightsEndpointUrl: hs.Cfg.ApplicationInsightsEndpointUrl,
|
||||||
|
@ -432,6 +432,7 @@ type Cfg struct {
|
|||||||
RudderstackWriteKey string
|
RudderstackWriteKey string
|
||||||
RudderstackSDKURL string
|
RudderstackSDKURL string
|
||||||
RudderstackConfigURL string
|
RudderstackConfigURL string
|
||||||
|
RudderstackIntegrationsURL string
|
||||||
IntercomSecret string
|
IntercomSecret string
|
||||||
|
|
||||||
// AzureAD
|
// AzureAD
|
||||||
@ -1113,6 +1114,7 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
|
|||||||
cfg.RudderstackDataPlaneURL = analytics.Key("rudderstack_data_plane_url").String()
|
cfg.RudderstackDataPlaneURL = analytics.Key("rudderstack_data_plane_url").String()
|
||||||
cfg.RudderstackSDKURL = analytics.Key("rudderstack_sdk_url").String()
|
cfg.RudderstackSDKURL = analytics.Key("rudderstack_sdk_url").String()
|
||||||
cfg.RudderstackConfigURL = analytics.Key("rudderstack_config_url").String()
|
cfg.RudderstackConfigURL = analytics.Key("rudderstack_config_url").String()
|
||||||
|
cfg.RudderstackIntegrationsURL = analytics.Key("rudderstack_integrations_url").String()
|
||||||
cfg.IntercomSecret = analytics.Key("intercom_secret").String()
|
cfg.IntercomSecret = analytics.Key("intercom_secret").String()
|
||||||
|
|
||||||
cfg.ReportingEnabled = analytics.Key("reporting_enabled").MustBool(true)
|
cfg.ReportingEnabled = analytics.Key("reporting_enabled").MustBool(true)
|
||||||
|
@ -325,6 +325,7 @@ function initEchoSrv() {
|
|||||||
user: config.bootData.user,
|
user: config.bootData.user,
|
||||||
sdkUrl: config.rudderstackSdkUrl,
|
sdkUrl: config.rudderstackSdkUrl,
|
||||||
configUrl: config.rudderstackConfigUrl,
|
configUrl: config.rudderstackConfigUrl,
|
||||||
|
integrationsUrl: config.rudderstackIntegrationsUrl,
|
||||||
buildInfo: config.buildInfo,
|
buildInfo: config.buildInfo,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -34,6 +34,7 @@ export interface RudderstackBackendOptions {
|
|||||||
user?: CurrentUserDTO;
|
user?: CurrentUserDTO;
|
||||||
sdkUrl?: string;
|
sdkUrl?: string;
|
||||||
configUrl?: string;
|
configUrl?: string;
|
||||||
|
integrationsUrl?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class RudderstackBackend implements EchoBackend<PageviewEchoEvent, RudderstackBackendOptions> {
|
export class RudderstackBackend implements EchoBackend<PageviewEchoEvent, RudderstackBackendOptions> {
|
||||||
@ -68,7 +69,10 @@ export class RudderstackBackend implements EchoBackend<PageviewEchoEvent, Rudder
|
|||||||
})(method);
|
})(method);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.rudderanalytics?.load?.(options.writeKey, options.dataPlaneUrl, { configUrl: options.configUrl });
|
window.rudderanalytics?.load?.(options.writeKey, options.dataPlaneUrl, {
|
||||||
|
configUrl: options.configUrl,
|
||||||
|
destSDKBaseURL: options.integrationsUrl,
|
||||||
|
});
|
||||||
|
|
||||||
if (options.user) {
|
if (options.user) {
|
||||||
const { identifier, intercomIdentifier } = options.user.analytics;
|
const { identifier, intercomIdentifier } = options.user.analytics;
|
||||||
|
Reference in New Issue
Block a user