Skip to content

Commit 5453c1f

Browse files
committed
Attribute prefix const
1 parent af6fa72 commit 5453c1f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/browser/src/utils/featureFlags.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ export const FLAG_BUFFER_SIZE = 100;
1818
*/
1919
export const MAX_FLAGS_PER_SPAN = 10;
2020

21+
// Global map of spans to feature flag buffers. Populated by feature flag integrations.
2122
GLOBAL_OBJ._spanToFlagBufferMap = new WeakMap<Span, FeatureFlag[]>();
2223

24+
const SPAN_FLAG_ATTRIBUTE_PREFIX = 'flag.evaluation.';
25+
2326
/**
2427
* Copies feature flags that are in current scope context to the event context
2528
*/
@@ -131,6 +134,6 @@ export function bufferSpanFeatureFlag(
131134
export function freezeSpanFeatureFlags(span: Span): void {
132135
const flags = GLOBAL_OBJ._spanToFlagBufferMap?.get(span);
133136
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])));
135138
}
136139
}

0 commit comments

Comments
 (0)