Skip to content

Commit 0d7df85

Browse files
committed
log when getting public cloud info fails
1 parent 139fa5d commit 0d7df85

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/compass/src/app/utils/telemetry.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { getCloudInfo } from 'mongodb-cloud-info';
55
import ConnectionString from 'mongodb-connection-string-url';
66
import resolveMongodbSrv from 'resolve-mongodb-srv';
77
import type { KMSProviders, MongoClientOptions } from 'mongodb';
8+
import { createLogger } from '@mongodb-js/compass-logging';
9+
const { log, mongoLogId } = createLogger('COMPASS-TELEMETRY');
810

911
type HostInformation = {
1012
is_localhost: boolean;
@@ -38,6 +40,12 @@ async function getPublicCloudInfo(host: string): Promise<{
3840
public_cloud_name,
3941
};
4042
} catch (err) {
43+
log.error(
44+
mongoLogId(1_001_000_339),
45+
'getPublicCloudInfo',
46+
'Error fetching cloud info',
47+
(err as Error).message
48+
);
4149
return {};
4250
}
4351
}

0 commit comments

Comments
 (0)