taosAdapter is the official data adapter service provided by TDengine. It bridges heterogeneous data sources and TDengine, receiving data from multiple collection agents and monitoring systems and writing it into TDengine efficiently. For users with existing InfluxDB or OpenTSDB deployments, taosAdapter also provides protocol-level compatibility. Written in Go, taosAdapter delivers high performance with low resource consumption and supports horizontal scaling.
Core features
WebSocket interface
taosAdapter exposes a WebSocket interface on port 6041 by default. Through this interface, clients can execute SQL statements, perform schemaless writes, bind parameters for prepared statements, and subscribe to data changes. The WebSocket connection supports long-lived sessions, which reduces the overhead of repeated handshakes for streaming workloads.
Data collection agent integration
taosAdapter integrates with several industry-standard collection agents, each mapped to a dedicated port:
| Agent | Port | Purpose |
|---|---|---|
| Telegraf | 6046 | General-purpose metrics collection |
| StatsD | 8125 | Application-level metric aggregation |
| collectd | 6044 | System statistics collection |
| icinga2 | 6045 | Infrastructure monitoring |
| TCollector | 6047 | OpenTSDB-style data collection |
Protocol-compatible writes
taosAdapter accepts writes using protocols already familiar to many operations teams. InfluxDB Line Protocol writes are supported, allowing applications built for InfluxDB to send data to TDengine without changing their write code. OpenTSDB JSON and Telnet write protocols are also supported, enabling migration from OpenTSDB deployments.
Prometheus integration
taosAdapter fully implements the Prometheus remote_read and remote_write interfaces. This means TDengine can serve as a long-term remote storage backend for Prometheus. Metrics collected by Prometheus are written to TDengine through taosAdapter, where they benefit from TDengine’s compression and retention policies.
OpenMetrics collection
Beyond Prometheus remote storage, taosAdapter can scrape OpenMetrics endpoints directly, collecting metrics from services that expose them in the OpenMetrics format.
RESTful interface
A standard RESTful API is available for JSON data writes. This interface is useful for custom applications that need to push data into TDengine without using a specific client library or protocol adapter.
Installation and configuration
taosAdapter requires TDengine Server 2.4.0.0 or later. It supports Linux on AMD64 and ARM64 architectures. Plan for at least 2 GB of available memory.
The configuration file lives at /etc/taos/taosadapter.toml. Each integration port, timeout, and behavior flag is configured in this file.
To start taosAdapter, run taosadapter & directly, or manage it through systemd:
systemctl start taosadapter
systemctl status taosadapter
systemctl stop taosadapter
Using systemd is recommended for production deployments. It ensures taosAdapter restarts automatically after a host reboot or an unexpected crash.
Typical application scenarios
IoT data collection
In a common IoT architecture, devices publish data to an MQTT broker. Telegraf subscribes to the relevant MQTT topics and collects the incoming messages. Telegraf then forwards the data to taosAdapter on port 6046. taosAdapter parses the data and writes it into TDengine. This chain requires no custom code beyond configuring the MQTT broker address in Telegraf and pointing it at the taosAdapter endpoint.
InfluxDB application migration
For applications already using InfluxDB, migration is straightforward. Change the write endpoint from the InfluxDB server to taosAdapter on port 6046. The existing Line Protocol code stays intact. taosAdapter handles the data conversion and schema mapping behind the scenes. Applications that previously stored data in InfluxDB start writing directly to TDengine with a single configuration change.
Prometheus and Grafana monitoring
Configure Prometheus to use taosAdapter as its remote storage backend by pointing the remote_write URL to taosAdapter. For visualization, add Prometheus as a data source in Grafana. This setup gives you long-term metric storage in TDengine while keeping the familiar Prometheus and Grafana workflow for collection and dashboards.
Performance tuning recommendations
Set the batch write size between 1000 and 5000 records. Larger batches improve write throughput by reducing the number of network round-trips and database transactions. Stay within this range to avoid excessive memory pressure.
Keep WebSocket connections open for long-lived sessions. Repeated connection setup and teardown adds latency and wastes resources. Long-lived connections are especially important for streaming data sources and real-time monitoring pipelines.
Set the concurrency level to 2 to 4 times the number of CPU cores. This provides enough parallelism to saturate I/O without causing excessive context switching. Monitor CPU usage and adjust if you see contention.
Design your Supertable and Subtable structure carefully. A well-designed data model reduces write amplification and improves query performance. Follow the “One Table per Device” principle. Group devices with similar schemas under the same Supertable to keep tag-based queries fast.
Summary
taosAdapter simplifies time-series data collection and import by providing rich protocol compatibility and flexible data access methods. For teams running TDengine, taosAdapter is the standard gateway for data from Telegraf, StatsD, collectd, Prometheus, and other monitoring tools, as well as for applications migrating from InfluxDB and OpenTSDB.


