# OpenTelemetry Service – LGTM Stack Example

To receive, process, and view OpenTelemetry data, the open-source LGTM Stack from Grafana Labs can be used. It consists of Loki (opens new window) for log storage, Grafana (opens new window) for visualization, Tempo (opens new window) for traces, and Mimir (opens new window) for metrics.

For our use case of receiving and viewing logs, Loki and Grafana are enough. However, the grafana/otel-lgtm (opens new window) container image makes it easy to set up a complete LGTM Stack, so you can use that instead of setting up the individual components yourself. We won't cover setting up the LGTM Stack in this documentation, you should be able to figure this out with their documentation and the internet.

Configure openHAB with the URL of your LGTM Stack, e.g., http://localhost:4318, and turn on Export Logs to send OpenTelemetry data.

# Grafana Dashboard

This example provides a tabbed Grafana dashboard that shows the openHAB "system" logs and the event logs. The dashboard allows for filtering by log level and searching for specific log messages. Clicking on a log message will open a pane that provides more details about the log entry, including the full logger name, the thread name, exception stacktraces, and more.

openHAB Logs

Event Logs

You can download the dashboard JSON file here.