MONGOC_APM_COM..._CONNECTION_ID(3)

πŸ’– MONGOC_APM_COM..._CONNECTION_ID πŸ’–

okay bestie, welcome to the libmongoc corner of the manual, where we read about a lil function called mongoc_apm_command_failed_get_server_connection_id(). it's giving "old faithful but make it deprecated". let's get into it 🫢

⚠️ WARNING, and I mean it: deprecated since version 1.24.0. do not start anything new with this. use mongoc_apm_command_failed_get_server_connection_id_int64() instead. that's the glow-up, periodt. πŸ’…

✨ SYNOPSIS ✨

int32_t
mongoc_apm_command_failed_get_server_connection_id (
  const mongoc_apm_command_failed_t *event);

🌸 DESCRIPTION 🌸

so this one hands you back the event's context. that's the vibe.

more specifically, it returns the server connection ID for the command. and no, bestie, don't get it twisted β€” the server connection ID is a whole different thing from the server ID (that one lives over at mongoc_apm_command_failed_get_server_id(), different function, different energy). the server connection ID is what the server sends back in the hello or legacy hello response as "connectionId", and only from a server on 4.2+. so if you're on something ancient, this info just isn't there. 😭


πŸŽ€ PARAMETERS πŸŽ€

  • event: a mongoc_apm_command_failed_t. that's it, that's the whole list.

⭐ RETURNS ⭐

the server connection ID as a positive integer πŸ’– β€” or -1 if it's simply not available. no cap, that's the whole return story.

SEE ALSO: Introduction to Application Performance Monitoring

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc


2009-present, MongoDB, Inc.


and that's a wrap, my love πŸ’œ this page was living in version 1.30.13, dated Oct 09, and it ate. now go use the int64 version, i'm literally begging. πŸ¦‹βœ¨

πŸ“¦ where this page comes from