:man_page: mongoc_apm_command_failed_get_server_connection_id

mongoc_apm_command_failed_get_server_connection_id()
====================================================

.. warning::
   .. deprecated:: 1.24.0

      This function is deprecated and should not be used in new code.

      Please use :symbol:`mongoc_apm_command_failed_get_server_connection_id_int64()` in new code.

Synopsis
--------

.. code-block:: c

  int32_t
  mongoc_apm_command_failed_get_server_connection_id (
    const mongoc_apm_command_failed_t *event)
    BSON_GNUC_DEPRECATED_FOR (
        "mongoc_apm_command_failed_get_server_connection_id_int64");

Returns this event's context.

Returns the server connection ID for the command. The server connection ID is
distinct from the server ID (:symbol:`mongoc_apm_command_failed_get_server_id`)
and is returned by the hello or legacy hello response as "connectionId" from the
server on 4.2+.

Parameters
----------

* ``event``: A :symbol:`mongoc_apm_command_failed_t`.

Returns
-------

The server connection ID as a positive integer or -1 if it is not available.

.. seealso::

  | :doc:`Introduction to Application Performance Monitoring <application-performance-monitoring>`

