Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow periods (".") in alarm names #593

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/dashboard/MonitoringNamingStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class MonitoringNamingStrategy {
static isAlarmFriendly(str: string) {
// we do not know the exact pattern yet, but this is a safe approximation
// also, tokens are not allowed in alarm names
return str && !Token.isUnresolved(str) && /^[a-zA-Z0-9\-_]+$/.test(str);
return str && !Token.isUnresolved(str) && /^[a-zA-Z0-9\-_\.]+$/.test(str);
}

private getFallbackAlarmFriendlyName() {
Expand Down
2 changes: 1 addition & 1 deletion test/dashboard/MonitoringNamingStrategy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test("string with comma is not alarm friendly", () => {

test("this string is alarm friendly", () => {
expect(
MonitoringNamingStrategy.isAlarmFriendly("This_is__Valid-Alarm-Name"),
MonitoringNamingStrategy.isAlarmFriendly("This_is__Valid-Alarm.Name"),
).toBeTruthy();
});

Expand Down