Logs and performance
When investigating failures, lag, or missing data, align task logs, monitoring charts, and error archives to the same time window before identifying the failing segment. Cumulative metrics are not current rates. Error archives retain only the first batch for each failure reason and cannot establish the full scope of a failure.
Where to operate: logs on the actual execution host; the TDinsight for taosX dashboard in Grafana; the monitoring database; the taosX /metrics endpoint. Run SQL in the taosExplorer Data Browser or taos CLI, and archive inspection commands in PowerShell or Bash.
First record the failure time, time zone, task ID, and actual execution host, then follow these steps.
1. Find the task's logs
1.1 Confirm the host, directory, and files
- Run
SHOW XNODE TASKS;andSHOW XNODE JOBS;in the taosExplorer Data Browser or taos CLI. Record the target task's ID, execution node, and failure reason. Check node addresses withSHOW XNODES;. - Log in to the taosX host actually executing the task and check
pathin the[log]section of thetaosx.tomlused at startup. Default directories are/var/log/taoson Linux andC:\TDengine\logon Windows. If startup arguments override configuration, use the actual value. - Find
taosx_<实例 ID>_<日期>.logand its rotated files covering the failure period. The instance ID in the filename is not the task ID. One process log may contain multiple tasks. - For tasks using taosX-Agent, also check the log directory in
agent.tomlon the agent host and collecttaosx_agent_<实例 ID>_<日期>.logand relevant connector logs. Do not check only the taosExplorer host.
- Linux
- Windows
In Bash on the Linux host, use GNU find, sort, and head to list recently updated logs:
find '/var/log/taos' -maxdepth 1 -type f -name 'taosx_*.log*' \
-printf '%TY-%Tm-%Td %TH:%TM:%TS %s %f\n' | sort -r | head -n 10
Columns show modification date, time, file size in bytes, and filename. Only regular files at the first level of the specified directory are listed; the first 10 are selected in descending modification-time order. Replace the directory with the actual log.path. This pattern may also list compressed rotated files. Do not pass compressed files directly to ordinary text search commands.
Search a selected uncompressed log by task identifier:
grep -n -F -B 3 -A 5 -- 'task.id:123,' '/var/log/taos/taosx_16_20261121.log'
-n displays line numbers, -F matches literal text, and -B 3 and -A 5 retain 3 preceding and 5 following lines. If the failure-period log is compressed as .gz, read it with an installed zgrep; there is no need to modify it or decompress over the original file:
zgrep -n -F -B 3 -A 5 -- 'task.id:123,' '/var/log/taos/taosx_16_20261121.log.1.gz'
The filename is a placeholder example. Use the actual rotation suffixes from the directory listing. Ordinary grep returns 0 for matches, 1 for no matches, and greater than 1 for read or usage errors. If access is denied, request authorization or have the service administrator extract the logs. Do not change production log directory ownership or permissions to bypass restrictions.
For a systemd deployment on Linux, also view service logs:
journalctl -u taosx --since "30 minutes ago" --no-pager
This command shows the last 30 minutes of service output on the taosX service host. To inspect the agent, run it on the agent host with unit name taosx-agent. For historical failures, specify a window with --since '2026-11-21 10:00:00' --until '2026-11-21 10:30:00'. Times use that host's time zone; compare them with the failure record. Only accounts with log read permission can see complete results; otherwise, have an authorized administrator run it. The journal may contain only service start/stop information. Collect detailed application logs from the actual log.path. An empty journal does not mean the application reported no errors. If the service has not started and no application logs exist, check service startup failure information first.
List recently updated taosX logs in PowerShell on the Windows host:
Get-ChildItem -LiteralPath 'C:\TDengine\log' -Filter 'taosx_*.log*' -File |
Sort-Object LastWriteTime -Descending |
Select-Object -First 10 Name, Length, LastWriteTime
After selecting a file covering the failure period, search by task identifier. For example, if the target task's identifier in the log is task.id:123,:
Select-String -LiteralPath 'C:\TDengine\log\taosx_16_20261121.log' -SimpleMatch 'task.id:123,' -Context 3,5
Replace the path, instance ID, date, and task ID. -Context 3,5 displays 3 lines before and 5 after each match to retain error context. Task identifier formats may differ among component logs. Inspect raw logs before selecting a search string. No matching string does not prove the task reported no errors.
1.2 What to retain from logs
Record the first error, complete error code and message, surrounding connection or retry records, and last error time. Correlate the same period by task ID, job ID, and host. See Error codes and log keywords for specific search strings.
Before temporarily increasing log verbosity, save the original configuration and agree on an observation duration. Follow the Log reload procedure to change settings, check evidence that they took effect, and restore them. Only the global log level and module filtering rules fall within this reload scope. Apply path and rotation changes under a maintenance plan. Restore the original level after diagnosis and check disk usage. Do not start a second taosx serve beside an existing service to obtain logs.
2. View metrics reported to taosKeeper
taosKeeper receives metrics and writes them to a TDengine monitoring database. It is not a graphical interface for viewing charts. After configuring reporting, use Grafana dashboards or SQL to view data.
2.1 Confirm where monitoring data is stored
Confirm the following with the monitoring administrator:
| Information | Where to confirm | Purpose |
|---|---|---|
| taosKeeper address | [monitor] in taosX startup configuration; monitoring is disabled when fqdn is unset; default port is 6043 | Check which collection service taosX reports to |
| Monitoring target cluster | taosKeeper [tdengine] configuration | SQL and Grafana must connect to this cluster, which is not necessarily the business data cluster |
| Monitoring database name | name under taosKeeper [metrics.database], default log | Select the query database; do not look only for the default name |
| View permissions | Monitoring cluster account and Grafana access | Use an account with query access to the monitoring database; business database write access is unnecessary for viewing metrics |
The SQL below uses database log. Replace it with the actual monitoring database name where different. Confirm tables and fields through queries instead of guessing.
2.2 View charts in Grafana
- Open the deployed Grafana and go to the TDengine data source configuration. Confirm that the data source connects to the monitoring cluster's taosAdapter address identified above and passes the connection test.
- Import TDinsight for taosX on the data source's Dashboards tab, or open it if already imported. Do not use TDinsight for 3.x, which shows only taosd and taosAdapter.
- Select the actual monitoring database in Log from and start with the last 15 minutes. For historical failures, select a period around the failure and check the displayed time zone.
- Find monitoring rows for the relevant taosX, taosX-Agent, or task. Match the task ID, name, and execution instance. Do not use another node's charts as this task's data.
- View read, processing, failure, and process resource charts together. Record when the abnormality began, then use the assessment table below to investigate.
If Grafana or the TDengine data source plugin is not deployed, or dashboard import fails, see Operations monitoring. Until dashboard configuration is complete, use the SQL queries below directly. Follow that guide for Grafana data source plugin requirements and installation.
2.3 Query the monitoring database
Run in the monitoring cluster's taosExplorer Data Browser or taos CLI. First check which supertables have been created:
SHOW log.STABLES;
Common tables serve the following purposes. Tables may appear only after the corresponding objects generate and report metrics.
| Supertable | Monitored object |
|---|---|
taosx_sys | Resources of the taosX process and its host |
taosx_agent | Reported taosX-Agent process resources |
taosx_connector | Connector subprocess resources |
taosx_task_kafka | Kafka ingestion tasks |
taosx_task_opcua | OPC UA ingestion tasks |
taosx_resource | taosX resource-limit metrics reported when resource control is enabled |
The following uses OPC UA as an example. For other connectors, first identify the corresponding taosx_task_ table from the table list. Do not copy the table name literally.
DESCRIBE log.taosx_task_opcua;
SELECT DISTINCT taosx_id, task_id, task_name
FROM log.taosx_task_opcua;
DESCRIBE confirms actual column names. taosx_id in query results identifies a monitoring instance, not the numeric Xnode ID in SQL. Replace '123' and 'taosx-host:6050' below with the queried task ID and instance identifier:
SELECT _ts, start_time, received_batches, processed_batches,
failed_rows, total_written_rows
FROM log.taosx_task_opcua
WHERE task_id = '123' AND taosx_id = 'taosx-host:6050'
AND _ts > NOW - 15m
ORDER BY _ts DESC LIMIT 20;
| Field | How to use it |
|---|---|
_ts | Monitoring sample time, not the business record timestamp; first confirm data is still updating |
start_time | Identifier for this task run's start; do not calculate rates directly across runs when it changes |
received_batches | Batches received in this run; growth across consecutive samples indicates input activity |
processed_batches | Batches successfully processed in this run; assess with failures, filtering, and target records; this is not the number of new business rows |
failed_rows | Rows that failed processing in this run; if growing continuously, check errors and error archives first |
total_written_rows | Cumulative successful writes, including duplicate writes; not the number of unique target rows |
Neither current-run counts nor historical totals are counts for the current sampling interval. Interpret received_batches, processed_batches, and failed_rows per run. total_written_rows is cumulative and is not guaranteed to reset on every restart. Compare two samples from the same task, instance, and run by subtracting the earlier value from the later one. Establish a new baseline if counts decrease, the run start changes, or the task changes nodes. Missing columns are not zero; first confirm whether the connector provides that metric. See Metrics dictionary and alert recommendations for other connector and resource counter definitions.
For example, if two samples from the same run are 10 seconds apart and total_written_rows rises from 1000 to 1600, the write rate over that interval is about 60 rows/second. If failed_rows also increases, address errors first; throughput growth alone does not establish task health. The difference between received_batches and processed_batches is not an exact backlog count either, because error handling affects their relationship.
To view resources for the same taosX instance, first confirm the process monitoring table structure and instance identifiers:
DESCRIBE log.taosx_sys;
SELECT DISTINCT taosx_id FROM log.taosx_sys;
Replace the following instance identifier with the queried value, then inspect resources for the same failure window:
SELECT _ts, taosx_id, process_cpu_percent, process_memory_percent
FROM log.taosx_sys
WHERE taosx_id = 'taosx-host:6050' AND _ts > NOW - 15m
ORDER BY _ts DESC LIMIT 20;
Use the same time range for task and resource queries. To check a connector or agent, first run DESCRIBE on its supertable and confirm tags, then filter for the same task or agent. Do not aggregate all instances directly.
2.4 Checks when metrics are missing
SHOW log.STABLESfails: confirm connection to the monitoring cluster, the correct database name, and query permissions.- Table does not exist: check whether reporting is enabled, whether the task has run, and whether taosKeeper logs show receiving or ingestion errors.
- Table exists but query is empty: temporarily remove task, instance, and time filters to view a few recent records. Confirm actual tags and sample times, then add conditions back individually.
- Only old data exists: retaining old monitoring records is normal for stopped tasks. If the task should run, check the taosX-to-taosKeeper connection, reporting configuration, and logs on both sides.
- SQL returns data but the dashboard is empty: check the Grafana data source, Log from, time range, and dashboard filters instead of restarting collection tasks first.
If no ingestion task has run, the monitoring database may contain taosx_sys process resource records but no corresponding taosx_task_ table. If resource control is disabled, taosx_resource may also be absent. A missing table alone does not establish monitoring reporting failure. Distinguish process monitoring, task monitoring, and resource-control metrics first, then check the corresponding objects and switches. Treat DB error in SQL as an error, not as a successful query with no data.
3. View instantaneous metrics without taosKeeper
Read /metrics directly from a host that can reach the taosX HTTP listener. The default HTTP port is 6050. Use the actual deployment's HTTPS, custom ports, and access controls. Do not publicly expose the endpoint for troubleshooting.
- Linux
- Windows
Linux Bash example:
curl --fail --silent --show-error --connect-timeout 5 --max-time 10 \
'http://taosx-host:6050/metrics'
Windows PowerShell example:
(Invoke-WebRequest -Uri 'http://taosx-host:6050/metrics' -UseBasicParsing -TimeoutSec 10).Content
Replace taosx-host with the actual taosX host. Linux requires curl. The arguments limit connection time to 5 seconds and the whole request to 10 seconds, and return a nonzero exit code for connection failure or HTTP 4xx/5xx. If the endpoint is inaccessible, check services, addresses, and networks using Health assessment and missing-data investigation. Do not interpret empty output as all metrics being zero. Output is Prometheus text format. Labels before metric values distinguish instances, tasks, and other objects. For example, process_cpu_percent has stable="taosx_sys" and taosx_id labels. Select objects by labels before comparing values.
This endpoint provides metrics exposed by the current process, not historical chart queries. After a task stops or a process restarts, its former instantaneous metrics may no longer be available. Use saved monitoring data for failure history. taosX-Agent has no /metrics endpoint and does not export resource_* metrics. Check agent resource limits using agent logs and host monitoring together.
4. Use metrics to choose the next check
First confirm that sample times still update, then compare the same task and time period. Narrow the scope with the table below and confirm causes with logs and data.
| Observation | Next action | How to confirm the direction |
|---|---|---|
The source has confirmed new records, but received_batches does not grow | Check source connections, authentication, object scope, and collection mode on the actual collection host; use a known record as described in Health assessment and missing-data investigation | The record is read and appears in the correct target table |
Input exists and failed_rows keeps increasing | Check complete errors for the same period, then archive samples; prioritize data types, mapping, permissions, or target structure issues | New failures stop increasing, and corrected error samples can be ingested |
| Input keeps growing, processing falls behind, and target lag increases | Check target service load and errors, taosX/agent/connector resources, then assess batches and concurrency | Under equivalent load, processing rate improves while lag and source backlog decrease |
High process_cpu_percent with complex transformations | Compare load before and after transformations in a small-scope task; check filters, splitting, and calculation settings instead of directly increasing concurrency | CPU or processing time decreases while values and tags remain correct |
| Memory or disk keeps growing | Determine whether growth belongs to process working sets, pending-write caches, or raw data files; follow Tuning and resource control | Resource trends stabilize without discarding caches to “eliminate backlog” |
resource_* pauses or rate-limit waits occur and throughput falls | Compare budgets and activation logs to distinguish intentional throttling from a slow target | Processing continues within approved budgets and can catch up within source retention |
End-to-end lag requires comparing the source time and target queryable time of the same record. Not all connectors have a uniform lag field. Host clocks, late source data, and unchanged business timestamps can affect assessment.
4.1 Kafka consumer group positions and lag
For Kafka ingestion, also check each partition's consumer position at the source. First obtain the actual consumer group name from saved task configuration; it is a separate field from Client ID. The checking host must reach Kafka bootstrap addresses and broker advertised addresses and have permission to inspect the group and topics.
When using the Kafka practice environment, Kafka tools are already in the container. Confirm that the dedicated container is running, then run this complete single line in PowerShell or Bash. The group name must match the task:
docker exec taosx-kafka-demo /opt/kafka/bin/kafka-consumer-groups.sh --bootstrap-server localhost:29092 --describe --group quickstart_kafka_01
This uses container-internal address localhost:29092. Windows Git Bash may convert absolute container paths; prefix the command with MSYS_NO_PATHCONV=1 if needed. PowerShell does not need that prefix. Do not start this test Kafka to query production positions.
For existing Kafka deployments, use clients and configuration files supplied by the administrator. The following assumes Kafka tools with the required scripts and a matching Java runtime are installed. Replace paths, broker, and group name with actual values. The --command-config file holds the SASL/TLS settings required by this tool and must be prepared by an administrator with restricted access. Do not put a taosX DSN directly in it.
- Linux
- Windows
Run in Bash on an authorized Linux tools host:
kafka_home='/opt/kafka'
kafka_broker='broker.example.com:9092'
kafka_group='quickstart_kafka_01'
kafka_config='/etc/kafka-client/admin.properties'
"$kafka_home/bin/kafka-consumer-groups.sh" \
--bootstrap-server "$kafka_broker" --describe --group "$kafka_group" \
--command-config "$kafka_config"
Run in PowerShell on an authorized Windows tools host:
$kafkaHome = 'C:\kafka'
$kafkaBroker = 'broker.example.com:9092'
$kafkaGroup = 'quickstart_kafka_01'
$kafkaConfig = 'C:\kafka-client\admin.properties'
& "$kafkaHome\bin\windows\kafka-consumer-groups.bat" --bootstrap-server $kafkaBroker --describe --group $kafkaGroup --command-config $kafkaConfig
If the tool package lacks scripts for the platform, use a tools host confirmed by the administrator to work. Do not disable Kafka authentication to run the example. These commands query status only; they do not delete groups or reset positions.
| Output column or symptom | Interpretation and next step |
|---|---|
GROUP, TOPIC, PARTITION | Check the actual group, topic, and each partition, not just aggregate values. |
CURRENT-OFFSET | The committed next consumer position for this partition, not the target table row count. |
LOG-END-OFFSET | The end position of this partition's log. |
LAG | Difference between the two positions; if growing continuously, investigate with task logs and metrics. |
CONSUMER-ID, HOST, CLIENT-ID | Identify running group members and assignments; other consumers in the same group may share partitions. No active members after the task stops may be expected. |
Position is -, group does not exist, or command fails | Check group name, permissions, and whether the task has joined the group and committed positions; do not interpret this as zero lag. |
After consuming two messages and committing positions in an isolated single-partition exercise, CURRENT-OFFSET=2, LOG-END-OFFSET=2, and LAG=0 may appear. These values do not apply if the topic has other messages. The default commit interval is 5000 ms, which actual configuration may override. If new target records appear while group positions briefly lag, wait for the commit and recheck. Even at zero lag, verify target timestamps, values, and tags by primary key. Filtered, archived, or discarded messages are not automatically backfilled. Changing Earliest/Latest does not reset existing valid group positions. Confirm historical replay scope and duplicate-processing rules separately.
5. Inspect error archives
5.1 Archive contents
Error archives contain failed-data samples saved under a task's Archive policy for analyzing parsing, mapping, or write errors. For example, if the primary timestamp is null after mapping, inspect input values and failure reasons in a sample. An archive is not an ordinary text log, target database backup, or complete copy of all failed records.
The Cache policy for target connection failures instead saves data awaiting rewrite. The task rewrites it when recovery conditions are met. Although taosx archive can inspect both kinds of files, archives and caches have different purposes and handling.
5.2 Locate input files
- Confirm the error handling policy and archive/cache locations in task configuration. Files may not exist if the policy is not used or the relevant error has not occurred.
- Look on the taosX host executing the task, not blindly on the browser host or in agent raw-data directories. The default archive path is
${data_dir}/tasks/<任务 ID>/<子任务 ID>/archived/, with target-error caches incache/at the same level. Use configuration and logs for custom locations. The job ID may be-1; do not replace it with the task ID yourself. - Confirm that files belong to the failed task and period. Names may look like
archive.<日期>.<序号>; do not search only for.parquetextensions. A file may be a container with multiple data frames. - For files still being written, preserve the current state and analyze a stable rotated file or copy first, to avoid mistaking changes during reading for corruption. Do not move or delete cache files the task still needs to rewrite.
5.3 Start with a summary, then samples
Command format:
taosx archive [--limit N] [-o OUTPUT_DIR] INPUT_FILE [INPUT_FILE ...]
| Part | Meaning |
|---|---|
INPUT_FILE | Existing archive or cache files to read; multiple files are supported; not an output path |
--limit N | Print at most N sample rows per input file, default 20; not a limit on file count or total failures |
--limit 0 | Print summaries only, without sample rows; files are still read to calculate summaries, so this does not mean contents are not read |
-o OUTPUT_DIR | Optional: extract each data frame into a standard Parquet file in the output directory |
Paths and IDs are placeholders. Replace them with located files before execution. Inspect only the summary first, confirm that contents match the intended task and period, then view a few samples:
- Linux
- Windows
Run on the Linux taosX host storing the archive files. Replace the input path first and ensure the current account has read permissions and taosx is on PATH; otherwise use the actual executable's full path:
archive_file='/var/lib/taos/taosx/tasks/123/-1/archived/archive.20261121.1'
taosx archive --limit 0 "$archive_file"
taosx archive --limit 5 "$archive_file"
The two archive commands show the summary and first 5 sample rows respectively. Retain archive_file in the same Bash session to use this input for extraction in the next step.
Run in Windows PowerShell. Use the executable's full path if taosX is not on PATH:
$archiveFile = 'C:\TDengine\data\taosx\tasks\123\-1\archived\archive.20261121.1'
& 'C:\TDengine\taosx.exe' archive --limit 0 $archiveFile
Print the first 5 rows to inspect specific fields:
& 'C:\TDengine\taosx.exe' archive --limit 5 $archiveFile
The summary shows format, file size, frame count (frames), batch count (batches), row count (rows), schema count (schemas), and up to 20 leading failure reasons. If it shows Primary timestamp ts is null after mapping., first check the time field and units in task mapping and verify with that sample, rather than increasing write concurrency.
_taosx_error_ in samples is the failure reason. Samples with different schemas are printed in groups. Cache files may not have this column. rows and counts by reason describe only what is saved in the current file, not all failed rows during the incident.
5.4 The -o option and output paths
-o is unnecessary for summaries or samples alone. Extract files only when Parquet analysis tools are needed for further filtering or aggregation, or when standard-format data must be provided to support:
- Linux
- Windows
In the same Bash session where archive_file was defined, select a separate output directory and run:
output_dir="$HOME/taosx-diagnostics/case-001/archive-frames"
(
umask 077
taosx archive --limit 0 -o "$output_dir" "$archive_file"
)
find "$output_dir" -type f -name '*.parquet' -print
Keep the previously defined archive_file variable in the same Bash session. $HOME is the current operator's home directory. Do not use the task's archive or cache directory as the output directory. umask 077 restricts newly created directory and file permissions in the subshell; it does not change existing directory permissions. Confirm that parent directory access is controlled first. find only lists extracted Parquet paths. Compare them with the tool's printed result; existing old files alone do not prove this run succeeded. If space is insufficient, read access is denied, or extraction fails, retain the error first. Do not change task cache permissions or delete files to retry.
Run in the same PowerShell session where $archiveFile was defined:
$outputDir = 'C:\taosx-diagnostics\archive-frames'
& 'C:\TDengine\taosx.exe' archive --limit 0 -o $outputDir $archiveFile
$outputDir is the output directory, and $archiveFile is the input located earlier. The command prints actual output paths. Check new files at those paths.
-o accepts only the single output directory immediately following it; subsequent paths are input files to read. The command reads input files, writes every data frame as a separate .parquet file, and prints actual output paths. --limit 0 only disables terminal sample output; it does not limit extracted data. Multiple input files are written to separate subdirectories.
Choose a new diagnostic directory with sufficient space and controlled access. Do not mix it with archive or cache directories in use by the task. Extracting the same input into the same directory again overwrites generated Parquet files with matching names; use a new directory to retain old results. The tool does not modify source files or write extracted results back to TDengine. For backfill, first fix the original error, confirm recoverable scope and duplicate risk, then prepare a separate backfill plan.
5.5 Verify inspection results
- Summary and expected samples appear: use failure reasons, field types, and source records to locate configuration issues, then verify corrections with a small sample.
- Extraction succeeds: check the printed paths and confirm output files exist; successful extraction does not mean business data recovery succeeded.
- File missing or access denied: check the execution host, path, and service file permissions. Do not change cache ownership to force access.
- Corruption or salvage warning: preserve the original and complete output. The tool may read only intact frames; partial readability does not establish file completeness. If unreadable, provide support with a controlled copy of the original.
Error archives retain the first batch for each failure reason per file, not every failed row. Full queues, file write failures, and rotation retention may cause further omissions. Assess failure scope using task metrics, logs, and source/target data, not archive sample counts. See Restarts, checkpoints, and store-and-forward for the purposes of different recovery materials.
6. Retain comparable performance records
Choose a representative fixed observation window, such as 10 minutes. Record the task ID, run start, configuration, source load, and the following:
| Item | How to obtain it |
|---|---|
| Input and processing changes | Save task monitoring query results or Grafana charts from before and after the window |
| Write and failure changes | Compare count increments within the same run and note restarts or node changes |
| Lag | Select an identifiable source record and record its timestamp and the first time it is found in the target |
| Backlog | Record source consumer positions, unprocessed time ranges, or cache growth; state the calculation method |
| Resources | Save taosX, agent, connector, and target service resource data for the same window |
| Errors | Save the first and last error in the window, recurrence details, and archive summaries |
After tuning, measure again using the same definitions. See Tuning and resource control for selecting changes and Diagnostic packages and support tickets for organization and redaction.