Deployment and Maintenance / Reporting Self-Observability Data
This article mainly introduces how to configure DataFlux Func self-observability data.
1. Preface
By default, DataFlux Func's self-observability data is stored in local Redis and MySQL.
After heavy usage of DataFlux Func, the volume of content such as metrics and logs may become relatively large. To limit local memory and disk usage, system metrics and task record logs saved locally will be reduced, and the total amount saved will also be limited.
You can refer to Deployment and Maintenance / System Metrics and Task Records / Disable Local Function Task Record to disable "Local Function Task Record" and reduce MySQL storage pressure.
If you need to completely record system metrics and task record logs generated in DataFlux Func, you can configure the system settings to upload data to the data platform.
2. Enable "Self-Observability Data Upload"
The uploaded task logs are complete logs and will not be truncated.
In Management / System Settings / Self-Observability Data Upload, users can enable "Self-Observability Data Upload."
The URL address can be filled with the DataWay or DataKit upload address:
Text Only | |
---|---|
1 |
|
Text Only | |
---|---|
1 |
|
Additionally, it is generally recommended to fill in a site name to mark the current DataFlux Func usage, for example: "Func for testing"
After enabling 'Self-Observability Data Upload', it is also recommended to disable 'Local Function Task Record' to reduce local DataFlux Func storage pressure.
3. View system metrics and task log records on the data platform
After correctly configuring the "Self-Observability Data Upload", you can view the uploaded system metrics and task logs on the data platform.
4. Data Description
DataFlux Func will upload various types of data for troubleshooting purposes.
Function Call Metrics
DataFlux Func will record related function call metrics after each function execution.
Measurement | Description |
---|---|
DFF_func_call |
Function Execution |
Fields are as follows:
Field | Type | Description | Example Value |
---|---|---|---|
script_set_id |
Tag | Associated Script Set ID | "demo" |
script_id |
Tag | Associated Script ID | "demo__test" |
func_id |
Tag | Function ID | "demo__test.run" |
origin |
Tag | Source | "authLink" |
queue |
Tag | Execution Queue | "8" |
task_status |
Tag | Task Status | "success" |
wait_cost |
Field | Waiting Time (ms) | 100 |
run_cost |
Field | Execution Time (ms) | 300 |
total_cost |
Field | Total Time (ms) | 400 |
Worker Queue Metrics
Measurement | Description |
---|---|
DFF_worker_queue |
Worker Queue |
Fields are as follows:
Field | Type | Description | Example Value |
---|---|---|---|
queue |
Tag | Queue | "8" |
redis_key |
Tag | Queue Redis Key Name | "DataFluxFunc-worker#workerQueue@8" |
length |
Field | Queue Length | 100 |
Cache Database Metrics
Measurement | Description |
---|---|
DFF_cache_db |
Cache Database |
Fields are as follows:
Field | Type | Description | Example Value |
---|---|---|---|
target |
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 |
Cache Database Key Metrics
Measurement | Description |
---|---|
DFF_cache_db_key |
Cache Database Keys |
Fields are as follows:
Field | Type | Description | Example Value |
---|---|---|---|
target |
Tag | Target Database (HOST:PORT/DB ) |
"127.0.0.1:6379/5" |
prefix |
Tag | Key Prefix | "DataFluxFunc-monitor#heartbeat@workerOnQueue:TAGS" |
count |
Field | Number of Keys | 100 |
Database Metrics
Measurement | Description |
---|---|
DFF_db_table |
Database |
Fields are as follows:
Field | Type | Description | Example Value |
---|---|---|---|
target |
Tag | Target Database (HOST:PORT/DB ) |
"127.0.0.1:3306/dataflux_func" |
name |
Tag | Table Name | "biz_main_sync_api" |
comment |
Tag | Table Name (Chinese Comment) | "Sync API" |
total_length |
Field | Total Size (bytes) | 200 |
data_length |
Field | Data Size (bytes) | 100 |
index_length |
Field | Index Size (bytes) | 100 |
avg_row_length |
Field | Average Row Size (bytes) | 100 |
rows |
Field | Number of Rows | 10 |
auto_increment |
Field | Auto Increment Position | 10 |
System Task Records / Function Task Records
After executing any internal system tasks or function tasks, DataFlux Func will report corresponding task logs that can be viewed via Log Explorer.
Data Source | Description |
---|---|
DFF_task_record |
System Task Records |
DFF_task_record_func |
Function Task Records |
Fields are as follows:
Field | Description | System Task Records | Function Task Records |
---|---|---|---|
source |
Data Source | DFF_task_record |
DFF_task_record_func |
site_name |
Site Name | ||
id |
Task ID | ||
name |
Task Name | ||
kwargs |
Task Parameters | ||
task_status |
Task Status, possible values listed below | ||
status |
Log Status, possible values listed below | ||
queue |
Queue | ||
trigger_time_iso |
Trigger Time (ISO Date Format) | ||
start_time_iso |
Start Time (ISO Date Format) | ||
end_time_iso |
End Time (ISO Date Format) | ||
run_cost |
Execution Cost (milliseconds) | ||
wait_cost |
Queuing Cost (milliseconds) | ||
total_cost |
Total Cost (milliseconds) | ||
func_id |
Function ID | ||
script_id |
Associated Script ID | ||
script_set_id |
Associated Script Set ID | ||
func_call_kwargs |
Function Input Parameters | ||
origin |
Origin, possible values listed below | ||
origin_id |
Origin ID e.g., Scheduled Job (Legacy: Auto Trigger Config) ID |
||
crontab |
Auto-trigger Crontab Expression | ||
workspace_uuid |
Workspace ID | ||
df_monitor_checker_id |
Monitor Checker ID | ||
df_monitor_id |
Alert Policy ID |
5. Detailed Explanation of Related Fields
Some field explanations are as follows:
Fields task_status
and status
In DataFlux Func reports, task_status
and status
have a one-to-one relationship. task_status
provides a description of the task status, while status
adheres to standardized status values for the data platform.
The specific mapping table 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 fields origin
and origin_id
are used to mark the source of a function task's execution, with specific values as follows:
origin Value | Description | Meaning of origin_id Value | Notes |
---|---|---|---|
syncAPI |
Sync API | Sync API ID | |
asyncAPI |
Async API | Async API ID | |
cronJob |
Cron Job | Cron Job ID | |
direct |
Direct Function Call e.g., Cluster Internal Call from Studio |
Fixed as direct |
|
integration |
Triggered by Script Integration | {Integration Type}.{Trigger Mode}-{Function ID} |
|
authLink |
Auth Link | Auth Link ID | Replaced by syncAPI in latest version |
crontab |
Auto Trigger Configuration | Auto Trigger Configuration ID | Replaced by cronJob in latest version |
batch |
Batch | Batch ID | Replaced by asyncAPI in latest version |