Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] support collect routine load latency metric #52878

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hoffermei
Copy link
Contributor

@hoffermei hoffermei commented Nov 13, 2024

Why I'm doing:

Fixes #52890

need a metric to watch routine load latency

What I'm doing:

Add a metric to record routine load consume latency (duration between kafka/pulsar publish time to sr transaction finish time)

New add metrics list are:


starrocks_fe_routine_load_latency{type="median", name="11253.test_rl_01"} 72676.0
starrocks_fe_routine_load_latency{type="95_quantile", name="11253.test_rl_01"} 74549.0
starrocks_fe_routine_load_latency{type="99_quantile", name="11253.test_rl_01"} 74549.0
starrocks_fe_routine_load_latency{type="max", name="11253.test_rl_01"} 74549

Show routine load command can also see latency detail in Statistic field:

MySQL [test_db]> show routine load for rl_test_01 \G
*************************** 1. row ***************************
                  Id: 4906906
                Name: rl_test_01
          CreateTime: 2024-11-13 10:47:30
           PauseTime: NULL
             EndTime: NULL
              DbName: test_db
           TableName: test_tbl_01
               State: RUNNING
      DataSourceType: KAFKA
      CurrentTaskNum: 1
       JobProperties: {"partial_update_mode":"null","timezone":"Asia/Shanghai","columnSeparator":"|","log_rejected_record_num":"0","taskTimeoutSecond":"200","maxFilterRatio":"1.0","strict_mode":"false","jsonpaths":"","currentTaskConcurrentNum":"1","escape":"0","enclose":"0","partitions":"*","rowDelimiter":"\n","partial_update":"false","trim_space":"false","columnToColumnExpr":"noop01,noop02,GameSvrId,dtEventTime,GameAppID,OpenID,PlatID,AreaID","maxBatchIntervalS":"10","whereExpr":"*","format":"csv","json_root":"","taskConsumeSecond":"30","desireTaskConcurrentNum":"1","maxErrorNum":"10030000","strip_outer_array":"false","maxBatchRows":"3000000"}
DataSourceProperties: {"topic":"test_topic_01","currentKafkaPartitions":"0,1,2","brokerList":"127.0.0.1:9092"}
    CustomProperties: {"kafka_default_offsets":"OFFSET_END","group.id":"k_loadtest_01","client.id":"k_loadtest_01"}
           Statistic: {"receivedBytes":10218406607,"latency99thPercentileMs":1896300.0,"errorRows":190223,"totalRows":1062515,"taskExecuteTimeMs":420835,"committedTaskNum":11,"latencyMedianMs":1892339.0,"loadedRows":872292,"loadRowsRate":2072,"abortedTaskNum":39,"latency95thPercentileMs":1896300.0,"unselectedRows":0,"receivedBytesRate":24281266,"latencyMaxMs":1896300}
            Progress: {"0":"15585573","1":"15583250","2":"15587519","3":"15591153","4":"15587126","5":"15584607","6":"15584767","7":"15586486","8":"15585819","9":"15582431","10":"15583384","11":"15586928"}
   TimestampProgress: {}
ReasonOfStateChanged: 
        ErrorLogUrls: 
         TrackingSQL: 
            OtherMsg: [2024-11-13 17:51:10] [task id: 962e7a84-f522-493f-8c0f-d50103598ba6] [txn id: -1] there is no new data in kafka, wait for 10 seconds to schedule again
LatestSourcePosition: {"0":"15585574","11":"15586929","1":"15583251","2":"15587520","3":"15591154","4":"15587127","5":"15584608","6":"15584768","7":"15586487","8":"15585820","9":"15582432","10":"15583385"}
1 row in set (0.00 sec)

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@hoffermei hoffermei requested review from a team as code owners November 13, 2024 09:55
@wanpengfei-git wanpengfei-git requested a review from a team November 13, 2024 09:55
@hoffermei hoffermei changed the title support collect routine load latency metric [Feature] support collect routine load latency metric Nov 14, 2024
@hoffermei hoffermei force-pushed the support_routine_load_latency_metric branch 4 times, most recently from c350d4b to bfb4ab4 Compare November 20, 2024 09:20
@hoffermei hoffermei force-pushed the support_routine_load_latency_metric branch from bfb4ab4 to 7b5e304 Compare November 20, 2024 10:03
Copy link

sonarcloud bot commented Nov 20, 2024

Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[BE Incremental Coverage Report]

fail : 0 / 12 (00.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/runtime/stream_load/stream_load_executor.cpp 0 4 00.00% [485, 486, 501, 502]
🔵 be/src/runtime/routine_load/data_consumer_group.cpp 0 8 00.00% [143, 233, 234, 235, 365, 425, 426, 427]

Copy link

[FE Incremental Coverage Report]

fail : 9 / 71 (12.68%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/metric/RoutineLoadLatencyMetricMgr.java 0 48 00.00% [31, 34, 37, 38, 42, 46, 47, 48, 49, 50, 53, 54, 55, 57, 60, 61, 62, 64, 68, 69, 72, 73, 76, 84, 85, 86, 87, 88, 89, 90, 93, 94, 95, 96, 97, 98, 100, 103, 104, 107, 108, 109, 111, 112, 113, 114, 115, 116]
🔵 com/starrocks/load/routineload/RoutineLoadJob.java 4 15 26.67% [1129, 1130, 1148, 1149, 1150, 1528, 1529, 1530, 1531, 1532, 1533]
🔵 com/starrocks/load/routineload/RLTaskTxnCommitAttachment.java 1 3 33.33% [106, 159]
🔵 com/starrocks/metric/MetricRepo.java 1 2 50.00% [836]
🔵 com/starrocks/load/routineload/PulsarRoutineLoadJob.java 1 1 100.00% []
🔵 com/starrocks/common/Config.java 1 1 100.00% []
🔵 com/starrocks/load/routineload/KafkaRoutineLoadJob.java 1 1 100.00% []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support collect routine load latency
2 participants