# How to Monitor a Teamscale Instance

To check and monitor the state of a Teamscale instance, the following options are available:

# Monitoring via Web UI

Teamscale provides many helpful metrics via the System Information view in the System perspective. In addition, the logs (e.g., Worker Log) can be helpful for diagnosis.

# API Endpoint for Nagios

The URLs api/health-check and health-<metrics provide check results and metrics in the Nagios format. This can be used with Nagios or compatible solutions, such as Sensu, to monitor the current health status of Teamscale. To integrate on the command-line, see the monitoring directory in your Teamscale distribution.

# API Endpoint for Prometheus

The URL prometheus-metrics exposes various metrics of Teamscale in the Prometheus format. To enable this service, the environment variable TS_PROMETHEUS_ENABLED must be set to true . Additional protection of the metrics can be provided by setting a secret token in the environment variable TS_PROMETHEUS_TOKEN . If this is set, the URL becomes prometheus-metrics/<secret-token>.

# Forwarding Teamscale Logs to Splunk

Teamscale uses the Log4J logging framework and provides support for forwarding the generated logs to a Splunk server. Log forwarding can be configured using the Splunk logging for Java integration and Teamscale fully supports HTTP Event Collector (recommended) and TCP data inputs. See the default log4j2.yaml Log4J configuration file in the Teamscale distribution Zip for an example configuration. For further configuration options refer to the official How to use Splunk logging for Java page. To reduce load on the Splunk server, consider adjusting the batch_interval, batch_size_bytes, or batch_size_count of the Log4J appender for Splunk to reduce the frequency of log forwarding.