Skip to content

Commit dff3a8f

Browse files
committed
Allow whitespace in tag values and remove tag value replacement character
1 parent f231c8a commit dff3a8f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/core/src/metrics/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const NAME_AND_TAG_KEY_NORMALIZATION_REGEX = /[^a-zA-Z0-9_/.-]+/g;
2121
*
2222
* See: https://develop.sentry.dev/sdk/metrics/#normalization
2323
*/
24-
export const TAG_VALUE_NORMALIZATION_REGEX = /[^\w\d_:/@.{}[\]$-]+/g;
24+
export const TAG_VALUE_NORMALIZATION_REGEX = /[^\w\d\s_:/@.{}[\]$-]+/g;
2525

2626
/**
2727
* This does not match spec in https://develop.sentry.dev/sdk/metrics

packages/core/src/metrics/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function sanitizeTags(unsanitizedTags: Record<string, Primitive>): Record
6262
for (const key in unsanitizedTags) {
6363
if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {
6464
const sanitizedKey = key.replace(NAME_AND_TAG_KEY_NORMALIZATION_REGEX, '_');
65-
tags[sanitizedKey] = String(unsanitizedTags[key]).replace(TAG_VALUE_NORMALIZATION_REGEX, '_');
65+
tags[sanitizedKey] = String(unsanitizedTags[key]).replace(TAG_VALUE_NORMALIZATION_REGEX, '');
6666
}
6767
}
6868
return tags;

0 commit comments

Comments
 (0)