.. _schemaregistry_monitoring: Monitor |sr| in |cp| ----------------------- |sr| reports a variety of metrics through Java Management Extensions (JMX). It can also be configured to report stats using additional pluggable stats reporters using the ``metric.reporters`` configuration option. The easiest way to view the available metrics is to use jconsole to browse JMX MBeans. |sr| has two types of metrics. Global metrics help you monitor the overall health of the service. Per-endpoint metrics monitor each API endpoint request method and are prefixed by a name of the endpoint (e.g. ``subjects.get-schema``). These help you understand how the proxy is being used and track down specific performance problems. .. tip:: Authentication is disabled for JMX by default in |ak|. You must use environment variables to override these defaults. For each platform component, the :ref:`options to override the JMX defaults ` take the form ``_JMX_OPTS``. Use the following environment variable to override default JMX options for |sr|: ``SCHEMA_REGISTRY_JMX_OPTS``. Global Metrics ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MBean: kafka.schema.registry:type=jetty-metrics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``connections-active`` Total number of active TCP connections. ``connections-accepted-rate`` (deprecated since 2.0) * In 1.x: The average rate per second of accepted TCP connections. * In 2.x: Same as ``connections-opened-rate``. ``connections-opened-rate`` The average rate per second of opened TCP connections. ``connections-closed-rate`` The average rate per second of closed TCP connections. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MBean: kafka.schema.registry:type=master-slave-role ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``master-slave-role`` The current role of this |sr| instance. A value of 1 indicates this instance is the primary, 0 indicates it is a secondary. Per-Endpoint Metrics ~~~~~~~~~~~~~~~~~~~~ The following are the metrics available for each endpoint request method. Metrics for all requests are also aggregated into a global instance for each one. These aggregate instances have no prefix in their name. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MBean: kafka.schema.registry:type=jersey-metrics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``.request-byte-rate`` Bytes/second of incoming requests ``.request-error-rate`` The average number of requests per second that resulted in HTTP error responses ``.request-latency-avg`` The average request latency in ms ``.request-latency-max`` The maximum request latency in ms ``.request-rate`` The average number of HTTP requests per second. ``.request-size-avg`` The average request size in bytes ``.request-size-max`` The maximum request size in bytes ``.response-byte-rate`` Bytes/second of outgoing responses ``.response-rate`` The average number of HTTP responses per second. ``.response-size-avg`` The average response size in bytes ``.response-size-max`` The maximum response size in bytes Endpoints ~~~~~~~~~ The following is a list of all the API endpoint methods. The naming should map intuitively to each of the API operations. To create a full metric name, prefix a per-endpoint metric name with one of these values. For example, to find the rate of ``GET /brokers`` API calls, combine the endpoint name ``brokers.list`` with the metric name ``request-rate`` to get ``brokers.list.request-rate``. ========================================== ======================================================= ``compatibility.subjects.versions.verify`` ``POST /compatibility/subjects/{subject}/versions/{version}`` ``schemas.ids.get-schema`` ``GET /schemas/ids/{id}`` ``subjects.get-schema`` ``POST /subjects/{subject}`` ``subjects.list`` ``GET /subjects`` ``subjects.versions.get-schema`` ``GET /subjects/{subject}/versions/{version}`` ``subjects.versions.get-schema.only`` ``GET /subjects/{subject}/versions/{version}/schema`` ``subjects.versions.list`` ``GET /subjects/{subject}/versions`` ``subjects.versions.register`` ``POST /subjects/{subject}/versions`` ========================================== =======================================================