From 75d5cfdf9784a32c24792a06dc47a54d22626607 Mon Sep 17 00:00:00 2001 From: Jairo Date: Thu, 23 Jan 2025 08:46:14 -0800 Subject: [PATCH] Add ignore/allow urls config option --- .../src/types.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/web/opentelemetry-instrumentation-document-load/src/types.ts b/plugins/web/opentelemetry-instrumentation-document-load/src/types.ts index 8ff85d48cb..d188d99efb 100644 --- a/plugins/web/opentelemetry-instrumentation-document-load/src/types.ts +++ b/plugins/web/opentelemetry-instrumentation-document-load/src/types.ts @@ -29,6 +29,12 @@ export interface ResourceFetchCustomAttributeFunction { */ export interface DocumentLoadInstrumentationConfig extends InstrumentationConfig { + /** + * URLs that partially match any regex or exactly match strings in allowUrls + * will be traced. + */ + allowUrls?: Array; + /** Function for adding custom attributes on the document load, document fetch and or resource fetch spans */ applyCustomAttributesOnSpan?: { documentLoad?: DocumentLoadCustomAttributeFunction; @@ -69,4 +75,11 @@ export interface DocumentLoadInstrumentationConfig * firstPaint */ ignorePerformancePaintEvents?: boolean; + + /** + * URLs that partially match any regex in ignoreUrls will not be traced. + * In addition, URLs that are _exact matches_ of strings in ignoreUrls will + * also not be traced. + */ + ignoreUrls?: Array; }