Skip to content

Commit 81f372f

Browse files
authored
migrate away from antiquated language to more inclusive terms. (#3117)
1 parent cc8caae commit 81f372f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

implementations/micrometer-registry-signalfx/src/main/java/io/micrometer/signalfx/SignalFxNamingConvention.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public class SignalFxNamingConvention implements NamingConvention {
3939
private static final Pattern START_UNDERSCORE_PATTERN = Pattern.compile("^_");
4040
private static final Pattern SF_PATTERN = Pattern.compile("^sf_");
4141
private static final Pattern START_LETTERS_PATTERN = Pattern.compile("^[a-zA-Z].*");
42-
private static final Pattern PATTERN_TAG_KEY_BLACKLISTED_CHARS = Pattern.compile("[^\\w_\\-]");
43-
private static final Pattern PATTERN_TAG_KEY_BLACKLISTED_PREFIX = Pattern.compile("^(aws|gcp|azure)_.*");
42+
private static final Pattern PATTERN_TAG_KEY_DENYLISTED_CHARS = Pattern.compile("[^\\w_\\-]");
43+
private static final Pattern PATTERN_TAG_KEY_DENYLISTED_PREFIX = Pattern.compile("^(aws|gcp|azure)_.*");
4444

4545
private static final int NAME_MAX_LENGTH = 256;
4646
private static final int TAG_VALUE_MAX_LENGTH = 256;
@@ -74,11 +74,11 @@ public String tagKey(String key) {
7474
conventionKey = START_UNDERSCORE_PATTERN.matcher(conventionKey).replaceAll(""); // 2
7575
conventionKey = SF_PATTERN.matcher(conventionKey).replaceAll(""); // 2
7676

77-
conventionKey = PATTERN_TAG_KEY_BLACKLISTED_CHARS.matcher(conventionKey).replaceAll("_");
77+
conventionKey = PATTERN_TAG_KEY_DENYLISTED_CHARS.matcher(conventionKey).replaceAll("_");
7878
if (!START_LETTERS_PATTERN.matcher(conventionKey).matches()) { // 3
7979
conventionKey = "a" + conventionKey;
8080
}
81-
if (PATTERN_TAG_KEY_BLACKLISTED_PREFIX.matcher(conventionKey).matches()) {
81+
if (PATTERN_TAG_KEY_DENYLISTED_PREFIX.matcher(conventionKey).matches()) {
8282
logger.log("'" + conventionKey + "' (original name: '" + key + "') is not a valid tag key. "
8383
+ "Must not start with any of these prefixes: aws_, gcp_, or azure_. "
8484
+ "Please rename it to conform to the constraints. "

implementations/micrometer-registry-signalfx/src/test/java/io/micrometer/signalfx/SignalFxNamingConventionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void tagKey() {
3737
}
3838

3939
@Test
40-
void tagKeyWhenKeyHasBlacklistedCharShouldSanitize() {
40+
void tagKeyWhenKeyHasDenylistedCharShouldSanitize() {
4141
assertThat(convention.tagKey("a.b")).isEqualTo("a_b");
4242
}
4343

0 commit comments

Comments
 (0)