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

Fix missing driver instrumentation #775

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jul 20, 2023

The ODM sends its own version data to servers to augment the driver version info. When using the bundle, the client isn't created by the DocumentManager, so this driver data is missing. This PR fixes this issue by adding the correct version info for Doctrine ODM.

Note that the added dependency is already a dependency of the ODM itself and does not add to the dependency chain. It is merely added here to avoid relying on a transitive dependency.

@alcaeus alcaeus requested a review from jmikola July 20, 2023 07:31
@alcaeus alcaeus self-assigned this Jul 20, 2023
@alcaeus alcaeus added this to the 4.5.3 milestone Jul 20, 2023
@alcaeus alcaeus force-pushed the fix-missing-instrumentation branch from 817641e to d2f5a8a Compare July 20, 2023 07:51
@alcaeus alcaeus removed the request for review from jmikola July 20, 2023 07:51
@alcaeus
Copy link
Member Author

alcaeus commented Jul 20, 2023

Note that a number of check failures are unrelated to the current. I'd like to revisit this in the 4.6.x branch.

@@ -407,6 +412,11 @@ private function normalizeDriverOptions(array $connection)
$driverOptions['context'] = new Reference($driverOptions['context']);
}

$driverOptions['driver'] = [
'name' => 'symfony-mongodb',
'version' => self::getODMVersion(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it have more value if augmented with bundle's version as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. I'm not sure what other hosters use this for, but at MongoDB we use the data from MongoDB Atlas to judge version adoption and to influence strategic decisions (e.g. around what PHP versions to support/not support). In that sense the relevant info for us is a) the fact that someone is using the ODM through Symfony, and b) what ODM version they are using.

@alcaeus alcaeus merged commit 78849b4 into doctrine:4.5.x Jul 20, 2023
7 of 21 checks passed
@alcaeus alcaeus deleted the fix-missing-instrumentation branch July 20, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants