Skip to content

Commit fb00c46

Browse files
committed
Add short-circuit on servers from Atlas / mongodb.net
1 parent fbc118c commit fb00c46

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/mongodb-build-info/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ export async function identifyServerName({
158158
}: IdentifyServerNameOptions): Promise<string> {
159159
try {
160160
const hostname = getHostnameFromUrl(connectionString);
161+
if (hostname.match(ATLAS_REGEX)) {
162+
return 'mongodb';
163+
}
164+
161165
if (hostname.match(COSMOS_DB_REGEX)) {
162166
return 'cosmosdb';
163167
}

0 commit comments

Comments
 (0)