Monitoring#
In most cases, when deploying an application in production, monitoring tools also need to be set up alongside it to ensure it is functioning as expected and to track errors when they occur.
Monitoring can be enabled by adding the following java_options
:
-Dotel.java.global-autoconfigure.enabled=true
: enable the OpenTelemetry auto-configuration, which is necessary to activate the OpenTelemetry instrumentation.
The instrumentation can be configured using these environment variables.
Note
An OpenTelemetry collector can be used to collect logs, metrics, and traces from multiple sources and send them to a single destination. It can also be used to export data to multiple destinations.
It’s possible to add more instrumentation to the application by configuring the OpenTelemetry agent by:
Adding
/path/to/opentelemetry-javaagent.jar
toextra_jars
.Adding
-javaagent:/path/to/opentelemetry-javaagent.jar
tojava_options
.
Metrics#
Atoti exposes metrics through OpenTelemetry.
These metrics can also be scraped by Prometheus and visualized in Grafana.
Atoti also exposes some of the Spring Boot Actuator endpoints at {session.url}/actuator
.
For instance, JVM and system metrics can be scraped with Prometheus from the /actuator/prometheus
endpoint.
If security has been enabled, it is recommended to set up a technical user for Prometheus.
The available metrics are listed here.
Tracing#
Atoti also exposes traces through OpenTelemetry. See the OpenTelemetry documentation for more information on how to set up tracing.
Logging#
In order to make analyzing the application’s easier (e.g.: if you are using the Elastic Stack ), we recommend formatting the Python logs the same way Atoti’s Java logs are formatted using logging.basicConfig()
like this:
logging.basicConfig(format="%(asctime)s %(levelname)s %(process)s --- [%(threadName)s] %(name)s : %(message)s")