File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/browser/src/utils Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,11 @@ export const FLAG_BUFFER_SIZE = 100;
18
18
*/
19
19
export const MAX_FLAGS_PER_SPAN = 10 ;
20
20
21
+ // Global map of spans to feature flag buffers. Populated by feature flag integrations.
21
22
GLOBAL_OBJ . _spanToFlagBufferMap = new WeakMap < Span , FeatureFlag [ ] > ( ) ;
22
23
24
+ const SPAN_FLAG_ATTRIBUTE_PREFIX = 'flag.evaluation.' ;
25
+
23
26
/**
24
27
* Copies feature flags that are in current scope context to the event context
25
28
*/
@@ -131,6 +134,6 @@ export function bufferSpanFeatureFlag(
131
134
export function freezeSpanFeatureFlags ( span : Span ) : void {
132
135
const flags = GLOBAL_OBJ . _spanToFlagBufferMap ?. get ( span ) ;
133
136
if ( flags ) {
134
- span . setAttributes ( Object . fromEntries ( flags . map ( flag => [ `flag.evaluation. ${ flag . flag } ` , flag . result ] ) ) ) ;
137
+ span . setAttributes ( Object . fromEntries ( flags . map ( flag => [ `${ SPAN_FLAG_ATTRIBUTE_PREFIX } ${ flag . flag } ` , flag . result ] ) ) ) ;
135
138
}
136
139
}
You can’t perform that action at this time.
0 commit comments