mirror of
https://github.com/grafana/grafana.git
synced 2024-11-21 16:38:03 -06:00
Frontend Traces: Ignore Faro tracking of Google Analytics and Rudderstack (#95322)
* Ignore Faro tracking of Google Analytics and Rudderstack * Fix test * Fancy it up Tom style
This commit is contained in:
parent
5a0ef46280
commit
c9984cbb7a
@ -317,6 +317,15 @@ function initEchoSrv() {
|
||||
}
|
||||
|
||||
if (config.grafanaJavascriptAgent.enabled) {
|
||||
// Ignore Rudderstack URLs
|
||||
const rudderstackUrls = [
|
||||
config.rudderstackConfigUrl,
|
||||
config.rudderstackDataPlaneUrl,
|
||||
config.rudderstackIntegrationsUrl,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.map((url) => new RegExp(`${url}.*.`));
|
||||
|
||||
registerEchoBackend(
|
||||
new GrafanaJavascriptAgentBackend({
|
||||
...config.grafanaJavascriptAgent,
|
||||
@ -329,6 +338,7 @@ function initEchoSrv() {
|
||||
id: String(config.bootData.user?.id),
|
||||
email: config.bootData.user?.email,
|
||||
},
|
||||
ignoreUrls: rudderstackUrls,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ describe('GrafanaJavascriptAgentEchoBackend', () => {
|
||||
id: '504',
|
||||
orgId: 1,
|
||||
},
|
||||
ignoreUrls: [],
|
||||
};
|
||||
|
||||
it('will set up FetchTransport if customEndpoint is provided', () => {
|
||||
|
@ -34,8 +34,11 @@ export interface GrafanaJavascriptAgentBackendOptions extends BrowserConfig {
|
||||
consoleInstrumentalizationEnabled: boolean;
|
||||
webVitalsInstrumentalizationEnabled: boolean;
|
||||
tracingInstrumentalizationEnabled: boolean;
|
||||
ignoreUrls: RegExp[];
|
||||
}
|
||||
|
||||
const TRACKING_URLS = [/.*.google-analytics.com*.*/, /.*.googletagmanager.com*.*/, /frontend-metrics/];
|
||||
|
||||
export class GrafanaJavascriptAgentBackend
|
||||
implements EchoBackend<GrafanaJavascriptAgentEchoEvent, GrafanaJavascriptAgentBackendOptions>
|
||||
{
|
||||
@ -87,7 +90,7 @@ export class GrafanaJavascriptAgentBackend
|
||||
'ResizeObserver loop completed',
|
||||
'Non-Error exception captured with keys',
|
||||
],
|
||||
ignoreUrls: [new RegExp(`/*${options.customEndpoint}/`), /frontend-metrics/],
|
||||
ignoreUrls: [new RegExp(`/*${options.customEndpoint}/`), ...TRACKING_URLS, ...options.ignoreUrls],
|
||||
sessionTracking: {
|
||||
persistent: true,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user