Deployment and Maintenance / Reporting Self-Monitor Data
This article mainly describes how to configure the Self-Monitor data reporting of DataFlux Func.
1. Preface
By default, DataFlux Func's Self-Monitor data is stored in local Redis and MySQL.
After heavy use of DataFlux Func, the volume of data such as metrics and logs may be quite large. To limit local memory and disk usage, the system metrics and task record logs stored locally will be reduced, and the total amount stored will also be limited.
You can refer to Deployment and Maintenance / System Metrics and Task Records / Disable Local Function Task Records to disable "Local Function Task Records" and reduce MySQL storage pressure.
If you need to centrally store the system metrics and task record logs generated in DataFlux Func, you can report the data to the data platform through system settings.
2. Enabling Self-Monitor Data Reporting
In Management / System Settings / Self-Monitor Data Reporting, users can enable "Self-Monitor Data Reporting".
Starting from 8.1.16, the URL address supports entering multiple DataWay or DataKit HTTP(S) reporting addresses on separate lines, which are reported in the order they are entered. Empty lines, invalid addresses, and duplicate addresses are automatically ignored. If a single address fails to report, other addresses will continue to be processed. Each address independently maintains its reporting urgency, which can be viewed and reset on the Self-Monitor data reporting error page.
The address format is as follows:
| Text Only | |
|---|---|
1 | |
| Text Only | |
|---|---|
1 | |
In addition, it is generally recommended to fill in the site name to indicate the purpose of the current DataFlux Func, such as "Test Func".
After enabling "Self-Monitor Data Reporting", you can also disable "Local Function Task Records" to reduce local DataFlux Func storage pressure
Print Content and Pagination
Starting from 8.1.19, the [Report Log] in "Self-Monitor Data Reporting" supports the following modes:
| Mode | Behavior |
|---|---|
| Full print content reporting | Default mode; reports print content paginated by UTF-8 bytes |
| Reduced print content reporting | Uses locally saved print content with head and tail retained, reported in a single page, still subject to single-page size limits |
| No print content reporting | Omits print content; still retains non-print content such as task summary, exceptions, error stack traces |
The [Report Log] only controls the print content to be reported; it does not affect whether local task records are saved. For local log retention, see Script Development / Print Log print.
In full mode, the default soft limit for pagination is 500000 bytes, and the hard limit for a single page of print content is 800000 bytes; overly large single outputs may still be truncated. Non-print content such as task summary and exceptions is attached to the last page and is not truncated by print limits. Do not interpret full mode as being able to save any length of single output as is.
Reporting Urgency
Each reporting address maintains its own Panic value. By default, when Panic is greater than 30, the task log for that address omits print content but retains exceptions and error stack traces; when greater than 100, the report is skipped. You can view and reset it on the Self-Monitor reporting error page.
At task start, if the Panic of all valid reporting addresses is greater than 30, this task will not collect print content for reporting; even if the addresses recover later, the uncollected content cannot be retrieved. Local records are still processed according to local settings.
3. View System Metrics and Task Record Logs in the Data Platform
After correctly configuring "Self-Monitor Data Reporting", you can view the reported system metrics and task logs in the data platform.
4. Description of Reported Data
DataFlux Func reports various data for troubleshooting.
Starting from 8.1.19, Self-Monitor data that does not explicitly provide a hostname will have the hostname of the host where the process runs appended before reporting.
Self-Monitor may be adjusted at any time
Self-Monitor data may be adjusted at any time with version updates according to actual conditions. This document only provides the description of the latest Self-Monitor data.
Add a service filter to improve query efficiency
In the latest version, all Logging Self-Monitor data will additionally include a service Tag, whose value is the same as source in Logging, to adapt to ScopeDB's service partition storage.
Therefore, when querying Func's Logging Self-Monitor data, adding service:xxxxx on the basis of the filter condition source:xxxxx can significantly improve query efficiency.
Delay Queue (Metric)
Task queue whose trigger time has not yet arrived
Metric set: DFF_delay_queue
| Field | Type | Description | Example Value |
|---|---|---|---|
queue |
Tag | Queue | "8" |
length |
Field | Queue length | 100 |
Worker Queue (Metric)
Task queue whose trigger time has arrived
Metric set: DFF_worker_queue
| Field | Type | Description | Example Value |
|---|---|---|---|
queue |
Tag | Queue | "8" |
length |
Field | Queue length | 100 |
worker_count |
Field | Number of worker units listening to the queue | 5 |
process_count |
Field | Number of processes listening to the queue | 25 |
Function Trigger Count (Metric)
Metric set: DFF_func_trigger
| Field | Type | Description | Example Value |
|---|---|---|---|
func_id |
Tag | Function ID | demo__test.run |
trigger_count_per_minute |
Field | Trigger count per minute | 100 |
Function Run Count (Metric)
Metric set: DFF_func_run
| Field | Type | Description | Example Value |
|---|---|---|---|
func_id |
Tag | Function ID | demo__test.run |
run_count_per_minute |
Field | Run count per minute | 100 |
Function Run Status Count (Metric)
Metric set: DFF_func_status
| Field | Type | Description | Example Value |
|---|---|---|---|
status |
Tag | Function run status | "success" |
status_count_per_minute |
Field | Status count per minute | 100 |
Function Run Cost (Metric)
Metric set: DFF_func_cost
| Field | Type | Description | Example Value |
|---|---|---|---|
wait_cost_sum_per_minute |
Field | Total wait time per minute (milliseconds) | 10000 |
queue_cost_sum_per_minute |
Field | Total queue time per minute (milliseconds) | 10000 |
run_cost_sum_per_minute |
Field | Total run time per minute (milliseconds) | 10000 |
total_cost_sum_per_minute |
Field | Total time consumed per minute (milliseconds) | 10000 |
cpu_cost_sum_per_minute |
Field | Total CPU time per minute (milliseconds) | 10000 |
non_cpu_cost_sum_per_minute |
Field | Total non-CPU time per minute (milliseconds) | 10000 |
Cache Database (Metric)
Metric set: DFF_cache_db
| Field | Type | Description | Example Value |
|---|---|---|---|
server |
Tag | Target database (HOST:PORT/DB) |
"127.0.0.1:6379/5" |
keys |
Field | Number of keys | 100 |
used_memory |
Field | Memory usage (bytes) | 10000 |
connected_clients |
Field | Number of connected clients | 100 |
uptime |
Field | Service uptime (seconds) | 60 |
Database Table (Metric)
Metric set: DFF_db_table
| Field | Type | Description | Example Value |
|---|---|---|---|
server |
Tag | Target database (HOST:PORT/DB) |
"127.0.0.1:3306/dataflux_func" |
name |
Tag | Table name | "biz_main_func_api" |
rows |
Field | Number of rows | 10 |
data_size |
Field | Data size (bytes) | 100 |
index_size |
Field | Index size (bytes) | 100 |
total_size |
Field | Total size (bytes) | 200 |
avg_row_size |
Field | Average row size (bytes) | 100 |
Cron Job Schedule (Metric)
Metric set: DFF_cron_job_scheduled
| Field | Type | Description | Example Value |
|---|---|---|---|
scheduled_count_per_week |
Field | Scheduled count per week | 604800 |
scheduled_count_per_day |
Field | Scheduled count per day | 86400 |
scheduled_count_per_hour |
Field | Scheduled count per hour | 3600 |
scheduled_count_per_minute |
Field | Scheduled count per minute | 60 |
scheduled_count_per_second |
Field | Scheduled count per second | 1 |
Business Entity (Metric)
Metric set: DFF_entity
| Field | Type | Description | Example Value |
|---|---|---|---|
entity |
Tag | Business entity | "funcAPI" |
count |
Field | Count | 100 |
enabled_count |
Field | Enabled count | 99 |
Self-Monitor Data Reporting Panic Level (Metric)
Metric set: DFF_self_monitor_upload_panic_level
| Field | Type | Description | Example Value |
|---|---|---|---|
panic_level |
Field | Panic level | 10 |
Func Service Info (Metric)
Metric set: DFF_service_info
Starting from 8.1.19, service information has been changed to metrics and should be viewed through metric queries; logs reported in older versions remain historical data.
| Field | Type | Description | Example Value |
|---|---|---|---|
name |
Tag | Service name | "server", "worker", "beat" |
service |
Tag | Added in version 8.1.19; service group; includes queue number when Worker listens to specific queues | "worker-1_2" |
version |
Tag | Version | "8.1.19" |
edition |
Tag | Edition | "GSE" |
hostname |
Tag | Hostname | "web001" |
pid |
Tag | Changed to a string tag since 8.1.19; process PID | "1234" |
uptime |
Field | Service uptime (seconds) | 60 |
cpu_percent |
Field | Added in version 8.1.19; CPU usage (percent) | 12.5 |
memory_pss |
Field | Added in version 8.1.19; usage after proportionally sharing memory (bytes) | 104857600 |
memory_rss |
Field | Added in version 8.1.19; resident memory (bytes) | 125829120 |
memory_heap_total |
Field | Added in version 8.1.19; total V8 heap size (bytes), only for services that provide this value | 67108864 |
memory_heap_used |
Field | Added in version 8.1.19; used V8 heap size (bytes), only for services that provide this value | 33554432 |
memory_heap_external |
Field | Added in version 8.1.19; external memory associated with V8-managed objects (bytes), only applicable to services that provide this value | 1048576 |
time_diff_ms |
Field | Added in version 8.1.19; time deviation between the host where the service resides and Redis (milliseconds) | 5 |
System Task Record / Function Task Record (Logging)
After DataFlux Func executes any internal system task or function task, it reports the corresponding task log, which can be viewed in the Log Viewer.
Starting from 8.1.19, the task log no longer automatically includes the result field. When you need to query the function return value, enable Return Value Retention and query by Task ID, see Script Development / Export Function DFF.API / Query Execution Result by Task ID.
| Metric Set | Description |
|---|---|
DFF_task_record |
System task record |
DFF_task_record_func |
Function task record |
| Field | Description | System Task Record | Function Task Record |
|---|---|---|---|
source |
Data source | "DFF_task_record" |
"DFF_task_record_func" |
site_name |
Site name | ||
id |
Task ID | ||
name |
Task name | ||
queue |
Queue | ||
task_status |
Task status; see below for possible values | ||
root_task_id |
Root task ID | ||
script_set_id |
Script Set ID | ||
script_id |
Script ID | ||
func_id |
Function ID | ||
func_name |
Function name | ||
origin |
Origin; see below for possible values | ||
origin_id |
Origin ID e.g., Cron Job ID |
||
script_set_title |
Script Set title | ||
script_title |
Script title | ||
func_title |
Function title | ||
cron_job_exec_mode |
Cron Job execution mode | ||
func_call_kwargs |
Function call arguments | ||
cron_expr |
Cron Job Crontab expression | ||
call_chain |
Call chain | ||
return_value |
Return value | ||
message |
Task log | ||
kwargs |
Task parameters | ||
eta |
Expected execution time | ||
delay |
Delay duration (seconds) | ||
timeout |
Timeout duration (seconds) | ||
expires |
Expiration duration (seconds) | ||
ignore_result |
Whether to ignore the result | ||
exception_from |
Exception source | ||
exception_type |
Exception type | ||
exception |
Exception content | ||
origin_exception_type |
Original exception type | ||
origin_exception |
Original exception content | ||
traceback |
Stack trace | ||
trigger_time_iso |
Trigger time (ISO date format) | ||
start_time_iso |
Start time (ISO date format) | ||
end_time_iso |
End time (ISO date format) | ||
wait_cost |
Queue wait time (ms) | ||
run_cost |
Execution time (ms) | ||
total_cost |
Total time (ms) | ||
cpu_cost |
CPU time (ms) | ||
cpu_cost_percent |
CPU time percentage | ||
non_cpu_cost |
Non-CPU time (ms) | ||
non_cpu_cost_percent |
Non-CPU time percentage | ||
sys_db_query_count |
System DB query count | ||
sys_db_query_details |
System DB query details | ||
sys_cache_db_query_count |
System cache query count | ||
sys_cache_db_query_details |
System cache query details | ||
status |
Log status; possible values are listed below | ||
workspace_uuid |
Workspace ID | ||
df_monitor_checker_id |
Monitor ID | ||
df_monitor_id |
Alert policy ID | ||
df_wksp_id |
wksp_xxxxx field |
||
df_rul_id |
rul_xxxxx field |
5. Details of Related Fields
Details of some fields are as follows:
Fields task_status and status
In logs reported by DataFlux Func, task_status and status have a one-to-one relationship. task_status is the task status description, and status is the status value that conforms to the data platform specification.
The specific mapping is as follows:
| task_status value | status value | Description |
|---|---|---|
"success" |
"ok" |
Success |
"failure" |
"critical" |
Failure |
"skip" |
"warning" |
Task skipped |
Fields origin and origin_id
The origin and origin_id fields are used to mark the execution source of function tasks. The specific values are as follows:
| origin value | Description | Meaning of origin_id value | Remarks |
|---|---|---|---|
"funcAPI" |
Func API | Func API ID | |
"cronJob" |
Cron Job | Cron Job ID | |
"direct" |
Direct function call e.g., Data Platform Studio calls it within the cluster |
Fixed to "direct" |
|
"integration" |
Triggered by Script Set integration | {integration type}.{startup method}-{function ID} |
|
"syncAPI" |
Sync API | Sync API ID | Replaced by "funcAPI" in the latest version |
"asyncAPI" |
Async API | Async API ID | Replaced by "funcAPI" in the latest version |
"authLink" |
Auth Link | Auth Link ID | Replaced by "syncAPI" in the latest version |
"crontab" |
Automatic trigger configuration | Automatic trigger configuration ID | Replaced by "cronJob" in the latest version |
"batch" |
Batch | Batch ID | Replaced by "asyncAPI" in the latest version |