would you generally be interested in adding observability support based on OpenTelemetry to openHAB?
I’ve been an openHab user since the early days. In my professional life I am leading the open source program office of a large Observability provider. As such, I added observability support to my openHab instances to monitor system health (e.g. down times) remotely, proactively getting alerts about problems (e.g. services not running), and using it for automated root cause detection with logs, metrics, and traces.
Setting up an OpenTelemetry collector for logs, metrics and traces of different system components is super lightweight and non-invasive. You could then use literally any observability provider in the backend (Grafana, Prometheus, Datadog, New Relic, Dynatrace) for application performance monitoring, infrastructure monitoring and other related system health information.
In case this is of interest, or somebody else has already built something, I’d love to dig into this and contribute.
You certainly don’t need to wait for permission to contribute something like this. I agree it sounds interesting and there are a number of users running OH in a home lab kind of deployment where running a separate monitoring system is natural and desired. There are a number of people managing OH for clients as well.
There have been some tutorials posted over the years to get OH logs into ELK and there was a Prometheus plug-ing for a time IIRC so I am pretty sure that there is a demand for something like this.
I run OH on bare metal. I have been playing around with the idea of deploying to a single node k8s cluster, just for fun. Observability baked into OH would be awesome!
This is an old thread, and I am sure the technology has improved since this was written, which has enabled me to get some simple Otel integration working with OpenHab by starting the Otel Java Agent. It seems to be working well. I have Otel configured in a small app I am playing with, which calls into OpenHab to chat with the Habot API and to get Item statuses from the OpenHab REST API.
Start the Aspire Otel Dashboard. This is the service that listens for Otel events and has a dashboard to view correlated events. I run this on my docker VM.
There may be others, but this is one I was already familiar with.
Configure OpenHab to start the agent.
sudo vi /etc/default/openhab
Find the line for EXTRA_JAVA_OPTS and add the options to start the otel java agent
I’ve split the lines up for readability, but in my file they are all on one line inside quotes.
The Aspire engine exposes a port for GRPC, so I had to set that port (4317) and protocol (grpc).
Then restart openhab
sudo systemctl restart openhab.service
I can now see Traces, Logs and Metrics in Aspire’s dashboard showing my Signal-Bot talking to OpenHab. Both are configured to push events to my Aspire container. There are other services in use too, but I have not yet managed to convince them to push events to Aspire.