== Monitoring

The appNG platform offers some built-in monitoring services to check the state of a site and to give some information about the system appNG is running on.

=== Configuration
The path to health monitoring can be configured with the platform property `monitoringPath`, using the default value `/health`.

The monitoring path is secured with basic authentication.

The user name is `monitoring`. The password can be defined using the platform property `monitoringPassword`. If not defined, the platform's `sharedSecret` is used.

=== Services
Monitoring offers different services, as listed here. All of them use `application/json` as a content-type, making it easy for load balancers like https://www.nginx.com/[nginx^] or https://www.haproxy.org/[HAProxy^] to make use of them.

==== Site health
Shows the current site, including it's state (one of: `STARTED`, `STARTING`, `STOPPING`, `STOPPED`, `INACTIVE`), applications and properties.

*Path*: `/health`

*Example Response*:
[source,json]
----
include::listing/health.json[]
----

==== Platform JARs
Shows a list of all Jars offered by the platform.

*Path*: `/health/platform`

==== Site JARs
Shows a list of all Jars that the site's classloader is built from.

*Path*: `/health/jars`

==== System environment
Shows the system's environment as returned by `System.getenv()`.

*Path*: `/health/environment`

==== System properties
Shows the system's properties as returned by `System.getProperties()`.

*Path*: `/health/system`

=== Opentelemetry metrics

Offers some request-based https://opentelemetry.io/[OpenTelemetry^] metrics that can be consumed by https://prometheus.io/[Prometheus^] and visualized with https://grafana.com/[Grafana^].

*Path*: `/health/metrics`

The available https://opentelemetry.io/docs/reference/specification/metrics/data-model/#histogram[histogramm^] metrics are:

* `<site>::<app>::<type>::act:<event>::<action>`
* `<site>::<app>::<type>::dat:<datasource>`
* `<site>::<app>::<type> +
The possible values for `<type>` are: +
** `gui` +
Content provided by the appNG GUI
** `jsp` +
A JSP file served from a content repository
** `static` +
A static file served from a content repository
* `<site>::<app>::<type>::<service>` +
The possible values for `<type>` are: +
** `webservice` +
With `<service>` being an implementation of `org.appng.api.Webservice`
** `soap` +
With `<service>` being an implementation of `org.appng.api.SoapService`
** `rest` +
With `<service>` being an implementation a  `org.springframework.web.bind.annotation.Controller`, which includes calls to the https://appng.org/appng/docs/{project-version}/reference/html/developerguide.html#openapi[appNG OpenAPI^]
