MONGOC_CLIENT_SET_APM_CALLBACKS(3)
β¨ MONGOC_CLIENT_SET_APM_CALLBACKS β¨
okay bestie, so this is a libmongoc page and it's literally all about hooking your callbacks into the Application Performance Monitoring event stream π
π« SYNOPSIS π«
bool
mongoc_client_set_apm_callbacks (mongoc_client_t *client,
mongoc_apm_callbacks_t *callbacks,
void *context);
πΈ DESCRIPTION πΈ
So basically you're registering a whole little set of callbacks so you can receive Application Performance Monitoring events β the vibe check of your database traffic, ykwim? π
Here's the part that eats: the callbacks are copied by the client, so you can safely destroy them yourself after this API call finishes. No cap, your mongoc_apm_callbacks_t is not on the hook for anything after that. π«Ά
But the context? That's a different story. If you pass a context, it is the application's responsibility to ensure context remains valid for the lifetime of the client. So like... don't free it, don't let it go out of scope, just keep it alive, bestie π It's giving main character energy but with a long-term commitment.
π PARAMETERS π
clientβ amongoc_client_t. The client in question, your icon, your fave.callbacksβ optionalmongoc_apm_callbacks_t. β¨ PassNULLto clear all callbacks. β¨ Yes,NULLis the "nvm, forget everything I said" option and honestly we respect it.contextβ optional pointer to include with each event notification. Optional, but if you bring it, you're keeping it π§
β RETURNS β
Returns true on success. Slay π
If any arguments are invalid, returns false and logs an error. So if you get false, it's not you being dramatic, something's genuinely wrong π
fr fr, check your arguments before you blame the library.
π SEE ALSO π
- Introduction to Application Performance Monitoring
π¦ AUTHOR π¦
MongoDB, Inc β the icon, the legend, the whole team π
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the whole page, bestie!! π no skips, no notes. this one's from libmongoc version 2.5.6, dated Oct 09, 2025, brought to you by MongoDB, Inc. β mwah π periodt. π₯
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms