Open Telemetry Protocol (OTLP) Adapter für ioBroker
Dieser Adapter ermöglicht das Übertragen historischer Daten an ein OTLP-kompatibles Gateway.
Der Abruf historischer Daten ist – systembedingt – nicht möglich. Da Datenpunkte/Zustände als Metriken veröffentlicht werden, können nur numerische Werte geschrieben werden.
Warum?
Datenpunkte exportieren - gutnumber Undboolean - die Anbindung an ein OTLP-kompatibles Gateway ermöglicht die Abstraktion vom zugrunde liegenden Datenspeicher.
Angesichts der Vielzahl verfügbarer offener Telemetrie-Exporteure fungiert dieses Projekt als Adapter für Speicher wie
- Prometheus / Mimir
- InfluxDB (offensichtlich nicht so leistungsstark wie der bestehende Adapter )
- Kafka
Diese Speicher-Backends werden innerhalb des offenen Telemetrie-Collectors (dem Ziel dieses Dienstes) konfiguriert, wo weitere Anpassungen vorgenommen werden können. Wenn ein nicht-numerischer Status für den Export aktiviert ist, wird dieser ignoriert und es werden keine Daten geschrieben.
Nicht-Ziele
Alle Datenpunkte/Zustände müssen vom Typ Boolean oder Zahl sein, da sie als Metrik, genauer gesagt als Messgröße, behandelt werden.
Zeichenketten oder auch komplexe Objekte als Metrik zu verwenden, ist einfach nicht sinnvoll; und es würde nicht funktionieren. Es wird niemals Unterstützung für etwas anderes als Zahlen und boolesche Werte geben.
Instanzkonfiguration
Folgende Optionen können in der Admin-Benutzeroberfläche des Adapters festgelegt werden:
| Schlüssel | Beschreibung |
|---|---|
| Protokoll | Das Protokoll des Servers (http oderhttps Dies ist nicht das OTLP! |
| Offenes Telemetrieprotokoll | Das Protokoll, das zum Senden von Telemetriedaten/Metriken verwendet wird (gRPC oderhttp (protobuf) ) |
| Gastgeber | Der Hostname des Zielservers/otelcol-Gateways |
| Hafen | Der Port des Otelcol-Gateways. Normalerweise4317 (gRPC) oder4318 (http) |
| Zählername | Der Name des erstellten SDK-Meters. Normalerweise ist dies nur intern im SDK. |
| Überschriften | Eine Liste von Schlüssel-Wert-Paaren mit Headern, die jeder Anfrage hinzugefügt werden. So kann die Authentifizierung konfiguriert werden. |
| Ressourcenattribute | Eine Schlüssel-Wert-Liste von Ressourcenattributen , die global befüllt werden sollen |
Benutzerdefinierte Statuskonfiguration
Der Adapter ermöglicht den Export von Metriken pro Status, der wie jeder andere Verlaufsadapter konfiguriert werden kann. Wenn ein Wert füraliasId Wenn ein Wert angegeben wird, wird dieser als Metrikname verwendet.
Hinweis: Je nach verwendetem Zeitreihen-Speicher-Backend kann es vorkommen, dass Teile der Metrik umbenannt werden. Prometheus ersetzt beispielsweise Punkte durch Unterstriche.my.metric als Alias-ID gespeichert wird alsmy_metric Die
Zusätzlich zualiasId Für jeden exportierten Wert kann eine Liste von Attributen, d. h. Schlüssel-Wert-Paaren, angegeben werden.
Schaukästen
In den folgenden Beispielen finden Sie praktische Anwendungsbeispiele:
Changelog
WORK IN PROGRESS
- (OlliMartin) Remove
info.refreshTimerRuntimestate creation through code
0.2.1 (2026-03-15)
- (OlliMartin) Add state role for refresh job execution duration
0.2.0 (2026-03-15)
- (OlliMartin) Recurringly export data points/metrics (hardcoded to every minute)
- This fixes an issue where the OpenTelemetry Framework would stop exporting data after some time (~30 minutes) where the data did not change, which makes the metrics harder to consume in downstream services, because it produces gaps in the metrics. Especially Prometheus/Mimir cannot deal with missing values that well.
- (OlliMartin) Add runtime (execution duration) state of periodic worker to be used as a metric itself (e.g. to monitor the performance of the adapter)
0.1.0 (2025-12-28)
- (OlliMartin) Implement connection test by exporting (empty) dummy metric and shutdown on error
- (OlliMartin) Recreate all meters on custom config change; Fixes alias renames only taking affect after adapter restart
- (OlliMartin) Fix issue #3 where configured headers would not be applied correctly to the respective exporter
- (OlliMartin) Translate admin & custom UI (i18n)
- (OlliMartin) Add missing layout column definitions to custom settings UI
- (OlliMartin) Remove unnecessary
noTranslationflags - (OlliMartin) Remove
.stop()call on invalid configuration
0.0.3 (2025-12-20)
- (OlliMartin) Include MIT Copyright Notice from ioBroker.influxdb
0.0.2 (2025-12-20)
- (OlliMartin) Fix invalid number-range in MeterName (type: text)
0.0.1 (2025-12-20)
- (OlliMartin) Final cleanup & release first stable
0.0.1-rc.5 (2025-12-20)
- (OlliMartin) More cleanup
0.0.1-rc.4 (2025-12-20)
- (OlliMartin) Update logo (transparent background)
0.0.1-rc.3 (2025-12-20)
- (OlliMartin) Still trying to automate release
0.0.1-rc.2 (2025-12-20)
- (OlliMartin) preparing automated release
0.0.1-rc.1 (20.12.2025)
- (OlliMartin) initial release
- Basic OTLP exporter functionality (periodic exporting)
- gRPC or HTTP otlp transport
License
MIT License
Copyright (c) 2026 OlliMartin oss@ollimart.in
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.