[CDRIVER-400] mongoc notification system / observer Created: 30/Jul/14  Updated: 07/Apr/23  Resolved: 13/Jul/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: TBD

Type: Improvement Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-24 Implement server discovery and monito... Closed
is depended on by PHPC-77 Support creation of Server objects ba... Closed
is depended on by PHPLIB-30 Implement MongoLog functionality Closed
is depended on by PHPLIB-38 Support stream context logging in Mon... Closed
Duplicate
duplicates CDRIVER-393 add client observer vtable for monito... Closed
Related
related to CDRIVER-769 APM Internal API Closed

 Description   

mongoc needs to be able to provide a way to get more details of what it is doing behind the scene.

All drivers do for example topology discovery.
The PHP driver would like to know the results of that discovery.

Same applies when an action is taken on a socket, we'd like to know
why and what for, along with the protocol arguments.
For example, when an command is executed we would like to be notified
that a query is being issued for that namespace, to server X, which is
primary/secondary.



 Comments   
Comment by A. Jesse Jiryu Davis [ 04/Jul/16 ]

Yes, you can use master to prepare. Also watch CDRIVER-1144 for the next set of monitoring features, which we'll implement this summer.

Comment by Frédéric G. MARAND [ 04/Jul/16 ]

Thanks for this info. I see https://jira.mongodb.org/browse/CDRIVER-769, which introduces APM, is marked fixed : is it reasonable to use a master build to prepare for this API, then ?

Just to give some context, I'm writing the new Drupal 8 driver, so I'm not specifically looking for something to use in production, but for which APIs I should ready our code for.

Comment by A. Jesse Jiryu Davis [ 03/Jul/16 ]

Hi, version 1.4.0 will ship circa September with the APM spec. This will provide callbacks for monitoring two systems:

Command Monitoring, the spec you linked to. It includes "getmore" and all other regular operations.

Server Discovery and Monitoring Monitoring. (Yes, the word "monitoring" really is repeated.) That lets you register callbacks that are executed whenever the driver checks a server, discovers a replica set member, gets disconnected from a server, or detects a change in a server's status.

Comment by Frédéric G. MARAND [ 03/Jul/16 ]

Is this APM spec https://github.com/mongodb/specifications/blob/master/source/command-monitoring/command-monitoring.rst ?

What is the other solution mentioned in the previous comment ? Since https://github.com/mongodb/mongo-c-driver/pull/80 has been closed, I do not see anything available at this point. Are client applications expected to rely on PHPLIB-level logging, which misses a lot of interactions (like getmore tracking) ?

Comment by A. Jesse Jiryu Davis [ 13/Jul/15 ]

PHP driver has another solution now. Eventually an implementation of the Application Performance Monitoring spec will offer similar features.

Comment by A. Jesse Jiryu Davis [ 25/Feb/15 ]

Depends on future logging spec, likely this year

Comment by Andrew Morrow (Inactive) [ 24/Sep/14 ]

https://github.com/mongodb/mongo-c-driver/pull/80

Generated at Wed Feb 07 21:09:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.