[GODRIVER-2904] Log informational message client-side based on detected environment (DocumentDB or CosmosDB) Created: 14/Jul/23  Updated: 06/Dec/23  Resolved: 12/Sep/23

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.13.0, 1.13.1

Type: Task Priority: Major - P3
Reporter: PM Bot Assignee: Qingyang Hu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
Quarter: FY24Q3
Upstream Changes Summary:

DRIVERS-2583:
Drivers should detect Cosmos and DocumentDB servers by examining host names added to a topology during MongoClient construction. If SRV is used, this check should be done on the SRV URI's `{hostname}.{domainname}` prior to SRV lookup (ex: xyz.mongodb.net).

If one or more host names end with ".cosmos.azure.com" (case-insensitive), log the following message using an "info" level:

You appear to be connected to a CosmosDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb

If one or more host names end with ".docdb.amazonaws.com" or ".docdb-elastic.amazonaws.com" (case-insensitive), log the following message using an "info" level:

You appear to be connected to a DocumentDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/documentdb

Drivers should not emit more than one log message per MongoClient construction.

Note: there are no spec/prose tests for this ticket. Each driver should implement its own set of tests for this behavior. The libmongoc tests from mongodb/mongo-c-driver#1374 may be used as a reference.
Note#2: Refer to DRIVERS-2753 if using standardized logging.

Documentation Changes: Not Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

This ticket was split from DRIVERS-2583, please see that ticket for a detailed description.



 Comments   
Comment by Githook User [ 12/Sep/23 ]

Author:

{'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}

Message: GODRIVER-2904 Add environment log. (#1373)

  • minor updates
  • fix typos
  • fix typos
  • log before SRV lookup
Generated at Thu Feb 08 08:39:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.