.. _installation_guide/deploy/monitoring: Application monitoring ====================== The Genropy framework supports the export or integration of useful data to application monitoring, for different technologies. Prometheus ---------- Every Genropy application, starting from version 24.5.30.2, has integrated a data exporter for Prometheus, exposing the resource to the standard `/metrics` path for Prometheus URL scraping, allowing for easier configuration of scraping targets. Currently the exposed metric is `genropy_site_counters`, of type `counter`, with the following possible attributes: +---------------------------+------------+-------------------------------------+ | Attribute | Type | Description | +=======================+=================================================== + | `users` | integer | Number of active users | +---------------------------+------------+-------------------------------------+ | `pages` | integer | Number of active pages | +---------------------------+------------+-------------------------------------+ | `connections` | integer | Number of active connections | +---------------------------+------------+-------------------------------------+ | `stable_connections_5min` | integer | Connections with 5 min of inactivity | +---------------------------+------------+-------------------------------------+ The data can then be monitored and viewed with all the accessory tools that support Prometheus. Sentry ---------- Since 2024 June 06th in the `develop` branch and in future versions released after this date, support for Sentry is introduced experimentally By installing the python package “sentry_dk” through `pip` and configuring the installation accordingly, it is possible to activate tracing. The configuration requires the inclusion in the `siteconfig` of the Client Keys (DSN) provided by the projects configured on Sentry to monitor the backend or frontend of a Genropy application. This is the example skeleton of the configuration to be inserted:: The possible attributes of the `sentry` element are as follows: +--------------------------------+---------+-------------+ | Attribute | Default | Description | +=====================================+=============+ | `js` | empty | Js Url | +--------------------------------+---------+-------------+ | `pydsn` | empty | Python DSN | +--------------------------------+---------+-------------+ | `sample_rate` | 0.0 | Sampling | +--------------------------------+---------+-------------+ | `traces_sample_rate` | 1.0 | Tracing | +--------------------------------+---------+-------------+ | `profiles_sample_rate` | 1.0 | Profiling | +--------------------------------+---------+-------------+ | `replays_session_sample_rate` | 0.0 | Replays | +--------------------------------+---------+-------------+ | `replays_on_error_sample_rate` | 0.0 | Replays | +--------------------------------+---------+-------------+ For configuration values related to rates, refer to the Sentry documentation to identify the optimal ones, as they vary based on the type of installation and use of the application. They indicate, with a value from 0.0 to 1.0, the percentage (rate) of specific collection and dispatch. References ----------- * https://github.com/getsentry/sentry * https://docs.sentry.io/platforms/python/configuration/sampling/ * https://docs.sentry.io/platforms/python/profiling/ .. sectionauthor:: Christopher Gabriel