From 788f86221dfc61b237b8969772463e26cc90052f Mon Sep 17 00:00:00 2001 From: MisluNotFound <108245592+MisluNotFound@users.noreply.github.com> Date: Mon, 14 Apr 2025 21:16:24 +0800 Subject: [PATCH] feat: Update alert workflow. (#15) --- .../en/alert simple root cause analysis.yml | 8794 ++++++++------ .../workflows/zh/告警简单根因分析.yml | 10033 +++++++++------- 2 files changed, 11196 insertions(+), 7631 deletions(-) diff --git a/api/init_data/workflows/en/alert simple root cause analysis.yml b/api/init_data/workflows/en/alert simple root cause analysis.yml index ae175d8043..50761dfe1d 100644 --- a/api/init_data/workflows/en/alert simple root cause analysis.yml +++ b/api/init_data/workflows/en/alert simple root cause analysis.yml @@ -287,6 +287,7 @@ workflow: sourceType: code targetType: question-classifier id: 1741497181784-source-1742461755094-target + selected: false source: '1741497181784' sourceHandle: source target: '1742461755094' @@ -299,6 +300,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980720651-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980720651' @@ -311,6 +313,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980748320-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980748320' @@ -323,6 +326,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980780865-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980780865' @@ -335,6 +339,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980837261-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980837261' @@ -347,6 +352,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980885557-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980885557' @@ -359,6 +365,7 @@ workflow: sourceType: tool targetType: tool id: 1742980720651-source-1742980228913-target + selected: false source: '1742980720651' sourceHandle: source target: '1742980228913' @@ -371,6 +378,7 @@ workflow: sourceType: tool targetType: tool id: 1742980748320-source-1742980318484-target + selected: false source: '1742980748320' sourceHandle: source target: '1742980318484' @@ -383,6 +391,7 @@ workflow: sourceType: tool targetType: tool id: 1742980780865-source-1742547917612-target + selected: false source: '1742980780865' sourceHandle: source target: '1742547917612' @@ -395,6 +404,7 @@ workflow: sourceType: tool targetType: tool id: 1742980837261-source-1742798505742-target + selected: false source: '1742980837261' sourceHandle: source target: '1742798505742' @@ -407,100 +417,32 @@ workflow: sourceType: tool targetType: tool id: 1742980885557-source-1741502699500-target + selected: false source: '1742980885557' sourceHandle: source target: '1741502699500' targetHandle: target type: custom zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742980933811-source-1741506766037-target - source: '1742980933811' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742981271838-source-1741506766037-target - source: '1742981271838' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742981275937-source-1741506766037-target - source: '1742981275937' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742981278010-source-1741506766037-target - source: '1742981278010' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742981280434-source-1741506766037-target - source: '1742981280434' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - data: isInIteration: false sourceType: code targetType: code id: 1741509454645-source-17430589567120-target + selected: false source: '1741509454645' sourceHandle: source target: '17430589567120' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: code - targetType: question-classifier - id: 17430589567120-source-17430590082510-target - source: '17430589567120' - sourceHandle: source - target: '17430590082510' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: true iteration_id: '1741497176064' sourceType: question-classifier targetType: tool id: 1742461755094-1742462167200-1743059090157-target + selected: false source: '1742461755094' sourceHandle: '1742462167200' target: '1743059090157' @@ -513,6 +455,7 @@ workflow: sourceType: tool targetType: llm id: 1743059090157-source-1742468584059-target + selected: false source: '1743059090157' sourceHandle: source target: '1742468584059' @@ -524,6 +467,7 @@ workflow: sourceType: question-classifier targetType: tool id: 17430590082510-1742462167200-17430593614550-target + selected: false source: '17430590082510' sourceHandle: '1742462167200' target: '17430593614550' @@ -535,6 +479,7 @@ workflow: sourceType: tool targetType: llm id: 17430593614550-source-17430593816310-target + selected: false source: '17430593614550' sourceHandle: source target: '17430593816310' @@ -546,6 +491,7 @@ workflow: sourceType: llm targetType: variable-aggregator id: 17430593816310-source-17430594012660-target + selected: false source: '17430593816310' sourceHandle: source target: '17430594012660' @@ -557,171 +503,79 @@ workflow: sourceType: question-classifier targetType: llm id: 17430590082510-1742463856746-17430594510140-target + selected: false source: '17430590082510' sourceHandle: '1742463856746' target: '17430594510140' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: variable-aggregator - id: 17430594510140-source-17430594012660-target - source: '17430594510140' - sourceHandle: source - target: '17430594012660' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: variable-aggregator targetType: iteration id: 17430594012660-source-1741497176064-target + selected: false source: '17430594012660' sourceHandle: source target: '1741497176064' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: question-classifier - targetType: tool - id: 17430590082510-1742464231696-17430595109950-target - source: '17430590082510' - sourceHandle: '1742464231696' - target: '17430595109950' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: tool targetType: tool id: 17430595109950-source-17430595158080-target + selected: false source: '17430595109950' sourceHandle: source target: '17430595158080' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430595248160-source-17430596469370-target - source: '17430595248160' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: llm targetType: variable-aggregator id: 17430596469370-source-17430594012660-target + selected: false source: '17430596469370' sourceHandle: source target: '17430594012660' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: question-classifier - targetType: tool - id: 17430590082510-1742464231696-17430597987060-target - source: '17430590082510' - sourceHandle: '1742464231696' - target: '17430597987060' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: tool targetType: tool id: 17430597987060-source-17430598152780-target + selected: false source: '17430597987060' sourceHandle: source target: '17430598152780' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430598299820-source-17430596469370-target - source: '17430598299820' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: tool targetType: tool id: 17430598907140-source-17430598942980-target + selected: false source: '17430598907140' sourceHandle: source target: '17430598942980' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430598979590-source-17430596469370-target - source: '17430598979590' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - - data: - isInIteration: false - sourceType: question-classifier - targetType: tool - id: 17430590082510-1742464231696-17430598907140-target - source: '17430590082510' - sourceHandle: '1742464231696' - target: '17430598907140' - targetHandle: target - type: custom - zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430610680150-source-17430596469370-target - source: '17430610680150' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430610794990-source-17430596469370-target - source: '17430610794990' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: question-classifier targetType: tool id: 17430590082510-1742464231696-17430610599980-target + selected: false source: '17430590082510' sourceHandle: '1742464231696' target: '17430610599980' @@ -733,28 +587,19 @@ workflow: sourceType: tool targetType: tool id: 17430610599980-source-17430610640640-target + selected: false source: '17430610599980' sourceHandle: source target: '17430610640640' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: question-classifier - targetType: tool - id: 17430590082510-1742464231696-17430610719970-target - source: '17430590082510' - sourceHandle: '1742464231696' - target: '17430610719970' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: tool targetType: tool id: 17430610719970-source-17430610756270-target + selected: false source: '17430610719970' sourceHandle: source target: '17430610756270' @@ -766,6 +611,7 @@ workflow: sourceType: tool targetType: tool id: 17430595158080-source-1743149089034-target + selected: false source: '17430595158080' sourceHandle: source target: '1743149089034' @@ -775,11 +621,12 @@ workflow: - data: isInIteration: false sourceType: tool - targetType: llm - id: 1743149089034-source-17430595248160-target - source: '1743149089034' + targetType: tool + id: 17430610756270-source-17431493682530-target + selected: false + source: '17430610756270' sourceHandle: source - target: '17430595248160' + target: '17431493682530' targetHandle: target type: custom zIndex: 0 @@ -787,135 +634,147 @@ workflow: isInIteration: false sourceType: tool targetType: tool - id: 17430610756270-source-17431493682530-target - source: '17430610756270' + id: 17430598152780-source-17431493591600-target + selected: false + source: '17430598152780' sourceHandle: source - target: '17431493682530' + target: '17431493591600' targetHandle: target type: custom zIndex: 0 - data: - isInIteration: false + isInIteration: true + iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 17431493682530-source-17430610794990-target - source: '17431493682530' + targetType: tool + id: 1742980228913-source-1743149606391-target + selected: false + source: '1742980228913' sourceHandle: source - target: '17430610794990' + target: '1743149606391' targetHandle: target type: custom - zIndex: 0 + zIndex: 1002 - data: - isInIteration: false + isInIteration: true + iteration_id: '1741497176064' sourceType: tool targetType: tool - id: 17430610640640-source-17431493655610-target - source: '17430610640640' + id: 1742980318484-source-1743152043813-target + selected: false + source: '1742980318484' sourceHandle: source - target: '17431493655610' + target: '1743152043813' targetHandle: target type: custom - zIndex: 0 + zIndex: 1002 - data: - isInIteration: false + isInIteration: true + iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 17431493655610-source-17430610680150-target - source: '17431493655610' + targetType: tool + id: 1741502699500-source-1743152169252-target + selected: false + source: '1741502699500' sourceHandle: source - target: '17430610680150' + target: '1743152169252' targetHandle: target type: custom - zIndex: 0 + zIndex: 1002 - data: isInIteration: false - sourceType: tool - targetType: tool - id: 17430598942980-source-17431493623970-target - source: '17430598942980' + sourceType: code + targetType: question-classifier + id: 17430589567120-source-17430590082510-target + selected: false + source: '17430589567120' sourceHandle: source - target: '17431493623970' + target: '17430590082510' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false - sourceType: tool - targetType: llm - id: 17431493623970-source-17430598979590-target - source: '17431493623970' + sourceType: llm + targetType: variable-aggregator + id: 17430594510140-source-17430594012660-target + selected: false + source: '17430594510140' sourceHandle: source - target: '17430598979590' + target: '17430594012660' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false sourceType: tool - targetType: tool - id: 17430598152780-source-17431493591600-target - source: '17430598152780' + targetType: code + id: 1743149089034-source-1744185676164-target + selected: false + source: '1743149089034' sourceHandle: source - target: '17431493591600' + target: '1744185676164' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false sourceType: tool - targetType: llm - id: 17431493591600-source-17430598299820-target + targetType: code + id: 17431493591600-source-17441926182400-target + selected: false source: '17431493591600' sourceHandle: source - target: '17430598299820' + target: '17441926182400' targetHandle: target type: custom zIndex: 0 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool - targetType: tool - id: 1742980228913-source-1743149606391-target - source: '1742980228913' + targetType: code + id: 17431493623970-source-17441926217060-target + selected: false + source: '17431493623970' sourceHandle: source - target: '1743149606391' + target: '17441926217060' targetHandle: target type: custom - zIndex: 1002 + zIndex: 0 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool - targetType: llm - id: 1743149606391-source-1742980933811-target - source: '1743149606391' + targetType: code + id: 17431493655610-source-17441926243210-target + selected: false + source: '17431493655610' sourceHandle: source - target: '1742980933811' + target: '17441926243210' targetHandle: target type: custom - zIndex: 1002 + zIndex: 0 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool - targetType: tool - id: 1742547917612-source-1743150910103-target - source: '1742547917612' + targetType: code + id: 17431493682530-source-17441926286390-target + selected: false + source: '17431493682530' sourceHandle: source - target: '1743150910103' + target: '17441926286390' targetHandle: target type: custom - zIndex: 1002 + zIndex: 0 - data: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 1743150910103-source-1742981275937-target - source: '1743150910103' + targetType: code + id: 1743149606391-source-1744206107700-target + selected: false + source: '1743149606391' sourceHandle: source - target: '1742981275937' + target: '1744206107700' targetHandle: target type: custom zIndex: 1002 @@ -923,11 +782,12 @@ workflow: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: tool - id: 1742980318484-source-1743152043813-target - source: '1742980318484' + targetType: code + id: 1743152043813-source-1744206199211-target + selected: false + source: '1743152043813' sourceHandle: source - target: '1743152043813' + target: '1744206199211' targetHandle: target type: custom zIndex: 1002 @@ -935,11 +795,12 @@ workflow: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 1743152043813-source-1742981271838-target - source: '1743152043813' + targetType: code + id: 1743150910103-source-1744206249528-target + selected: false + source: '1743150910103' sourceHandle: source - target: '1742981271838' + target: '1744206249528' targetHandle: target type: custom zIndex: 1002 @@ -947,11 +808,12 @@ workflow: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: tool - id: 1742798505742-source-1743152103020-target - source: '1742798505742' + targetType: code + id: 1743152103020-source-1744206286177-target + selected: false + source: '1743152103020' sourceHandle: source - target: '1743152103020' + target: '1744206286177' targetHandle: target type: custom zIndex: 1002 @@ -959,190 +821,679 @@ workflow: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 1743152103020-source-1742981278010-target - source: '1743152103020' + targetType: code + id: 1743152169252-source-1744206314118-target + selected: false + source: '1743152169252' sourceHandle: source - target: '1742981278010' + target: '1744206314118' targetHandle: target type: custom zIndex: 1002 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool + targetType: code + id: 17430610640640-source-1744255998058-target + selected: false + source: '17430610640640' + sourceHandle: source + target: '1744255998058' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code targetType: tool - id: 1741502699500-source-1743152169252-target - source: '1741502699500' + id: 1744255998058-source-17431493655610-target + selected: false + source: '1744255998058' sourceHandle: source - target: '1743152169252' + target: '17431493655610' targetHandle: target type: custom - zIndex: 1002 + zIndex: 0 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool - targetType: llm - id: 1743152169252-source-1742981280434-target - source: '1743152169252' + targetType: code + id: 17430598942980-source-17442560822670-target + selected: false + source: '17430598942980' sourceHandle: source - target: '1742981280434' + target: '17442560822670' targetHandle: target type: custom - zIndex: 1002 - nodes: + zIndex: 0 - data: - desc: '' - selected: false - title: start - type: start - variables: - - label: startTime - max_length: 48 - options: [] - required: true - type: number - variable: startTime - - label: endTime - max_length: 48 - options: [] - required: true - type: number - variable: endTime - - label: params - max_length: 9999999 - options: [] - required: false - type: paragraph - variable: params - - label: nodeName - max_length: 256 - options: [] - required: false - type: text-input - variable: nodeName - - label: nodeIp - max_length: 48 - options: [] - required: false - type: text-input - variable: nodeIp - height: 194 - id: '1741227526517' - position: - x: 30 - y: 586 - positionAbsolute: - x: 30 - y: 586 + isInIteration: false + sourceType: code + targetType: tool + id: 17442560822670-source-17431493623970-target selected: false - sourcePosition: right - targetPosition: left + source: '17442560822670' + sourceHandle: source + target: '17431493623970' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - desc: '' - error_handle_mode: terminated - height: 1408 - is_parallel: false - iterator_selector: - - '1741509454645' - - monitor - output_selector: - - '1742470455066' - - output - output_type: array[string] - parallel_nums: 10 - selected: false - start_node_id: 1741497176064start - title: iteration - type: iteration - width: 3603.817693995864 - height: 1408 - id: '1741497176064' - position: - x: 4286 - y: 904 - positionAbsolute: - x: 4286 - y: 904 + isInIteration: false + sourceType: code + targetType: code + id: 17441926243210-source-1744287265980-target selected: false - sourcePosition: right - targetPosition: left + source: '17441926243210' + sourceHandle: source + target: '1744287265980' + targetHandle: target type: custom - width: 3604 - zIndex: 1 + zIndex: 0 - data: - desc: '' - isInIteration: true - selected: false - title: '' - type: iteration-start - draggable: false - height: 48 - id: 1741497176064start - parentId: '1741497176064' - position: - x: 24 - y: 68 - positionAbsolute: - x: 4310 - y: 972 - selectable: false + isInIteration: false + sourceType: code + targetType: code + id: 1744287265980-source-1744290470304-target selected: false - sourcePosition: right - targetPosition: left - type: custom-iteration-start - width: 44 - zIndex: 1002 + source: '1744287265980' + sourceHandle: source + target: '1744290470304' + targetHandle: target + type: custom + zIndex: 0 - data: - code: "\ndef main(arg1: str) -> dict:\n data = json.loads(arg1)\n return\ - \ {\n \"pod\": data.get(\"pod\", \"\"),\n \"namespace\": data.get(\"\ - namespace\", \"\")\n }\n" - code_language: python3 - desc: '' - isInIteration: true - iteration_id: '1741497176064' - outputs: - namespace: - children: null - type: string - pod: - children: null - type: string - selected: false - title: get instance info - type: code - variables: - - value_selector: - - '1741497176064' - - item - variable: arg1 - height: 54 - id: '1741497181784' - parentId: '1741497176064' - position: - x: 247.70722025930104 - y: 65 - positionAbsolute: - x: 4533.707220259301 - y: 969 + isInIteration: false + sourceType: question-classifier + targetType: tool + id: 17430590082510-1742464231696-17430595109950-target selected: false - sourcePosition: right - targetPosition: left + source: '17430590082510' + sourceHandle: '1742464231696' + target: '17430595109950' + targetHandle: target type: custom - width: 244 - zIndex: 1002 + zIndex: 0 - data: - desc: '' - isInIteration: true - is_team_authorization: true - iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null + isInIteration: false + sourceType: question-classifier + targetType: tool + id: 17430590082510-1742464231696-17430597987060-target + selected: false + source: '17430590082510' + sourceHandle: '1742464231696' + target: '17430597987060' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: question-classifier + targetType: tool + id: 17430590082510-1742464231696-17430598907140-target + selected: false + source: '17430590082510' + sourceHandle: '1742464231696' + target: '17430598907140' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: question-classifier + targetType: tool + id: 17430590082510-1742464231696-17430610719970-target + selected: false + source: '17430590082510' + sourceHandle: '1742464231696' + target: '17430610719970' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 17441926286390-source-17443356883380-target + selected: false + source: '17441926286390' + sourceHandle: source + target: '17443356883380' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 17441926217060-source-17443357536900-target + selected: false + source: '17441926217060' + sourceHandle: source + target: '17443357536900' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 17441926182400-source-17443357893440-target + selected: false + source: '17441926182400' + sourceHandle: source + target: '17443357893440' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 1744185676164-source-17443357899060-target + selected: false + source: '1744185676164' + sourceHandle: source + target: '17443357899060' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 17443357899060-source-17443388433580-target + selected: false + source: '17443357899060' + sourceHandle: source + target: '17443388433580' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: llm + id: 17443388433580-source-17430596469370-target + selected: false + source: '17443388433580' + sourceHandle: source + target: '17430596469370' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 17443357893440-source-17443388421360-target + selected: false + source: '17443357893440' + sourceHandle: source + target: '17443388421360' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: llm + id: 17443388421360-source-17430596469370-target + selected: false + source: '17443388421360' + sourceHandle: source + target: '17430596469370' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 17443357536900-source-17443388438160-target + selected: false + source: '17443357536900' + sourceHandle: source + target: '17443388438160' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: llm + id: 17443388438160-source-17430596469370-target + selected: false + source: '17443388438160' + sourceHandle: source + target: '17430596469370' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 17443356883380-source-17443388443000-target + selected: false + source: '17443356883380' + sourceHandle: source + target: '17443388443000' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: llm + id: 17443388443000-source-17430596469370-target + selected: false + source: '17443388443000' + sourceHandle: source + target: '17430596469370' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: llm + id: 1744290470304-source-17430596469370-target + selected: false + source: '1744290470304' + sourceHandle: source + target: '17430596469370' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: tool + targetType: code + id: 1742798505742-source-1744342068305-target + selected: false + source: '1742798505742' + sourceHandle: source + target: '1744342068305' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: tool + id: 1744342068305-source-1743152103020-target + selected: false + source: '1744342068305' + sourceHandle: source + target: '1743152103020' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: tool + targetType: code + id: 1742547917612-source-1744342138380-target + selected: false + source: '1742547917612' + sourceHandle: source + target: '1744342138380' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: tool + id: 1744342138380-source-1743150910103-target + selected: false + source: '1744342138380' + sourceHandle: source + target: '1743150910103' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744206107700-source-1744342244843-target + selected: false + source: '1744206107700' + sourceHandle: source + target: '1744342244843' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744206199211-source-1744342309386-target + selected: false + source: '1744206199211' + sourceHandle: source + target: '1744342309386' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744206249528-source-1744342372882-target + selected: false + source: '1744206249528' + sourceHandle: source + target: '1744342372882' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744206286177-source-1744342426374-target + selected: false + source: '1744206286177' + sourceHandle: source + target: '1744342426374' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744206314118-source-1744342478278-target + source: '1744206314118' + sourceHandle: source + target: '1744342478278' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342478278-source-1744342609856-target + source: '1744342478278' + sourceHandle: source + target: '1744342609856' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342609856-source-1741506766037-target + source: '1744342609856' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342426374-source-1744342800777-target + source: '1744342426374' + sourceHandle: source + target: '1744342800777' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342800777-source-1741506766037-target + source: '1744342800777' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342372882-source-1744342846753-target + source: '1744342372882' + sourceHandle: source + target: '1744342846753' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342846753-source-1741506766037-target + source: '1744342846753' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342309386-source-1744342890395-target + source: '1744342309386' + sourceHandle: source + target: '1744342890395' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342890395-source-1741506766037-target + source: '1744342890395' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342244843-source-1744342920172-target + source: '1744342244843' + sourceHandle: source + target: '1744342920172' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342920172-source-1741506766037-target + source: '1744342920172' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + nodes: + - data: + desc: '' + selected: false + title: start + type: start + variables: + - label: startTime + max_length: 48 + options: [] + required: true + type: number + variable: startTime + - label: endTime + max_length: 48 + options: [] + required: true + type: number + variable: endTime + - label: params + max_length: 9999999 + options: [] + required: false + type: paragraph + variable: params + - label: nodeName + max_length: 256 + options: [] + required: false + type: text-input + variable: nodeName + - label: nodeIp + max_length: 48 + options: [] + required: false + type: text-input + variable: nodeIp + height: 193 + id: '1741227526517' + position: + x: 30 + y: 444 + positionAbsolute: + x: 30 + y: 444 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + desc: '' + error_handle_mode: terminated + height: 1408 + is_parallel: false + iterator_selector: + - '1741509454645' + - monitor + output_selector: + - '1742470455066' + - output + output_type: array[string] + parallel_nums: 10 + selected: false + start_node_id: 1741497176064start + title: iteration + type: iteration + width: 6503.360125927147 + height: 1408 + id: '1741497176064' + position: + x: 5262.456277280085 + y: 916 + positionAbsolute: + x: 5262.456277280085 + y: 916 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 6503 + zIndex: 1 + - data: + desc: '' + isInIteration: true + selected: false + title: '' + type: iteration-start + draggable: false + height: 48 + id: 1741497176064start + parentId: '1741497176064' + position: + x: 24 + y: 68 + positionAbsolute: + x: 5286.456277280085 + y: 984 + selectable: false + selected: false + sourcePosition: right + targetPosition: left + type: custom-iteration-start + width: 44 + zIndex: 1002 + - data: + code: "\ndef main(arg1: str) -> dict:\n data = json.loads(arg1)\n return\ + \ {\n \"pod\": data.get(\"pod\", \"\"),\n \"namespace\": data.get(\"\ + namespace\", \"\")\n }\n" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + namespace: + children: null + type: string + pod: + children: null + type: string + selected: false + title: get instance info + type: code + variables: + - value_selector: + - '1741497176064' + - item + variable: arg1 + height: 53 + id: '1741497181784' + parentId: '1741497176064' + position: + x: 247.70722025930104 + y: 65 + positionAbsolute: + x: 5510.163497539385 + y: 981 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: + - auto_generate: null + default: null form: llm human_description: en_US: Specified pod name @@ -1269,20 +1620,20 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 + height: 53 id: '1741502699500' parentId: '1741497176064' position: x: 844.0068118865438 y: 800.2561082923241 positionAbsolute: - x: 5130.006811886544 - y: 1704.2561082923241 + x: 6106.463089166628 + y: 1716.2561082923241 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -1296,19 +1647,19 @@ workflow: selected: false title: End type: end - height: 90 + height: 89 id: '1741502839759' position: - x: 8254 - y: 904 + x: 12255 + y: 916 positionAbsolute: - x: 8254 - y: 904 + x: 12255 + y: 916 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 - data: context: enabled: false @@ -1329,157 +1680,134 @@ workflow: users analyze problems - id: 2b2ad468-efcd-4bcc-aeb9-d53d2f2770ad role: user - text: '# Purpose + text: '​​# Objective​​ - Based on the polaris metrics data in each direction, + Analyze whether application {{#17430589567120.pod#}} is impacted by alert + event {{#1742807803325.alertName#}} based on anomaly thread data across + resource categories, and perform preliminary root cause attribution. - Analyze whether the application {{#1741497181784.pod#}} - is affected by the alert event {{#1742807803325.alertName#}}, and preliminarily - determine the root cause direction of the alarm. + ​​# Input Data Specifications​​ - # Note - In the input data, the data in each direction includes the thread time - consumption data in that direction and the related data in that direction. - For example, the network time consumption will bring the network RTT indicator - of the application. + ​​Per-category data​​ includes thread latency and associated North Star + metrics (e.g., network RTT for network-related latency). + + ​​Anomaly data point count​​: Number of instances where latency exceeds + 20% of the historical average for the same thread type. The average value + of the thread. - # Analysis rules + ​​# Analysis Rules​​ - 1. First see which type of data has the largest change (the significant - increase is greater than other types, and the value change is the largest). - If there is a direct, give suggestions according to the specified direction - below. - At the same time, combine the thread history P90 to analyze the changes - and confirm whether the data is in a reasonable range + ​​Identify Primary Anomaly Direction​​ - Note: P90 reflects the fluctuation within the maximum and minimum range. - Although the fluctuation may be large, in the long run, this fluctuation - is normal. When analyzing data, you need to find the real "mutation", - that is, abnormal and drastic changes that occur in a short period of - time. The definition of a ‘mutation’ is: the fluctuation value shows a - significant jump in a very short period of time (such as 1-2 time steps) - compared to the previous and next data points, and this jump is obviously - beyond the normal fluctuation pattern (for example, the change amplitude - is far greater than the average change rate, or is inconsistent with the - trend). Please ignore the regular fluctuations that are within the normal - range (within the P90 range) and only focus on abnormal mutations. + Give the average value of the abnormal thread. - If two types of change trends are found to be similar, the priority is - analyzed from high to low. + Determine the resource type with the ​​most significant latency increase​​ + (e.g., values elevated to ​​second-level magnitudes​​ instead of milliseconds). - 2. If the CPU time consumption of the application increases, it is recommended - to check whether the code is too nested. After checking the problem, you - can roll back and repair it. + Prioritize ​​thread count analysis​​: If a resource type (e.g., network/epoll) + has the highest number of anomalous threads, attribute the root cause + to that category. - 3. If the application preempts the CPU, it is recommended to log in to - the machine to check whether other applications are preempting it. + Example: 4 threads with network/epoll anomalies vs. 2 CPU threads → classify + as ​​network issue​​. - 4. If net, epoll increases, it is necessary to analyze whether the application - rtt is normal. + ​​Avoid Misclassification​​ - If rtt is abnormal, it is recommended that users check whether there is - a problem with the network; if rtt is normal, it is recommended that users - check downstream problems. + If ​​CPU​​ or ​​runQ​​ latency spikes dominate (with no concurrent network/epoll + anomalies), attribute to ​​CPU contention​​ instead of network. - 5. If the file type increases, it is recommended to check whether the - application opens too many files. + ​​Tiebreaker Priority​​ (Descending Order): + ​​CPU > Network > Epoll > File > RunQ​​. - # Output format + ​​# Root Cause Attribution & Recommendations​​ - ## Application {{#1741497181784.pod#}} - Summary of the trend of changes in the North Star indicator + ​​CPU Latency Surge​​: - - List the changes in the North Star indicator and describe it in concise - language + Check for code over-nesting; perform rollback if confirmed. - - If there is no significant change, clearly state: "No significant change - was observed." + ​​High CPU Preemption​​: - ## Preliminary root cause conclusion of the alarm event + Investigate resource contention from co-located processes. - - Summarize whether the alarm affects the application, + ​​Network/Epoll Latency Surge​​: - Combined with the North Star indicator and related indicator data of the - service, analyze the possible root cause + The net/epoll type data might include a summary about RTT. - At the same time, only one direction of advice can be given. + If RTT is abnormal → troubleshoot network; RTT normal → inspect downstream + services. - Note: If the network direction is considered to have a problem, if the - RTT is normal, the description is modified to be a downstream network - problem + ​​File Latency Increase​​: - # Input data + Audit excessive file handles. - - cpu direction data + ​​# Output Format​​ - {{#1742980933811.text#}} + ​​Application​​: {{#17430589567120.pod#}} - Historical CPU time consumption P90 + ​​North Star Metric Trends Summary​​ - {{#1743149606391.text#}} - - net direction data + Summarize significant changes per metric. - {{#1742981275937.text#}} + If no anomalies: "No observable deviations." - Historical Net time consumption P90 + ​​Preliminary Root Cause Conclusion​​ - {{#1743150910103.text#}} - - file direction data + State whether the alert impacts the application. - {{#1742981271838.text#}} + Provide ​​single-direction attribution​​ based on North Star metrics and + analysis rules. - Historical file time consumption P90 + Note: If network/epoll is suspected with normal RTT, attribute to ​​downstream + service latency​​. - {{#1743152043813.text#}} + ​​# Input Data​​ - - epoll direction data - {{#1742981278010.text#}} + ​​CPU​​: {{#17443388433580.result#}} - Historical epoll time consumption P90 + ​​Network​​: {{#17443388438160.result#}} - {{#1743152103020.text#}} + ​​File​​: {{#17443388421360.result#}} - - runq direction data + ​​Epoll​​: {{#1744290470304.result#}} - {{#1742981280434.text#}} + ​​RunQ​​: {{#17443388443000.result#}} - Historical runq time consumption P90 + ​​# Guidelines​​ - {{#1743152169252.text#}} + Use concise, non-technical language for readability. - # Notes + Avoid ambiguous terms; prioritize actionable insights. - - Use concise and clear language, avoid excessive accumulation of technical - terms, and ensure that the output is easy to understand.' + ' selected: false title: llm analysis root cause type: llm variables: [] vision: enabled: false - height: 90 + height: 89 id: '1741506766037' parentId: '1741497176064' position: - x: 2476.850022241196 - y: 495.6222275962382 + x: 3100.843852684703 + y: 613.2233202711288 positionAbsolute: - x: 6762.850022241196 - y: 1399.6222275962382 - selected: true + x: 8363.300129964788 + y: 1529.2233202711288 + selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: code: "import json\n\ndef main(arg: str) -> dict:\n data = json.loads(arg)\n\ @@ -1511,19 +1839,19 @@ workflow: - '1741597274153' - output variable: arg - height: 54 + height: 53 id: '1741509454645' position: - x: 1550 - y: 774 + x: 1545 + y: 628 positionAbsolute: - x: 1550 - y: 774 + x: 1545 + y: 628 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 - data: context: enabled: false @@ -1579,19 +1907,19 @@ workflow: variables: [] vision: enabled: false - height: 90 + height: 89 id: '1741512806512' position: - x: 7950 - y: 904 + x: 11884 + y: 916 positionAbsolute: - x: 7950 - y: 904 + x: 11884 + y: 916 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 - data: desc: '' selected: false @@ -1600,19 +1928,19 @@ workflow: title: unsupport alert type: template-transform variables: [] - height: 54 + height: 53 id: '1741592094819' position: - x: 942 - y: 586 + x: 939 + y: 444 positionAbsolute: - x: 942 - y: 586 + x: 939 + y: 444 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 - data: desc: '' outputs: @@ -1623,19 +1951,19 @@ workflow: selected: false title: End type: end - height: 90 + height: 89 id: '1741592144815' position: - x: 1246 - y: 586 + x: 1242 + y: 444 positionAbsolute: - x: 1246 - y: 586 + x: 1242 + y: 444 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 - data: desc: '' is_team_authorization: true @@ -1740,19 +2068,19 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 + height: 53 id: '1741597223833' position: - x: 942 - y: 680 + x: 939 + y: 536 positionAbsolute: - x: 942 - y: 680 + x: 939 + y: 536 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 - data: desc: '' output_type: string @@ -1766,19 +2094,19 @@ workflow: - result - - '1742629595400' - text - height: 152 + height: 150 id: '1741597274153' position: - x: 1246 - y: 743 + x: 1242 + y: 596.5 positionAbsolute: - x: 1246 - y: 743 + x: 1242 + y: 596.5 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 - data: code: "\ndef main(arg1: str, arg2: str) -> dict:\n data = {\n \"\ data\": {\n \"timeseries\": [\n {\n \ @@ -1804,19 +2132,19 @@ workflow: - '1742807803325' - namespace variable: arg2 - height: 54 + height: 53 id: '1741599658821' position: - x: 942 - y: 774 + x: 939 + y: 628 positionAbsolute: - x: 942 - y: 774 + x: 939 + y: 628 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 - data: cases: - case_id: 'true' @@ -1863,19 +2191,19 @@ workflow: selected: false title: alert instance info type: if-else - height: 248 + height: 247 id: '1742453019576' position: - x: 638 - y: 586 + x: 636 + y: 444 positionAbsolute: - x: 638 - y: 586 + x: 636 + y: 444 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 - data: classes: - id: '1742462167200' @@ -1909,20 +2237,20 @@ workflow: type: question-classifier vision: enabled: false - height: 204 + height: 203 id: '1742461755094' parentId: '1741497176064' position: x: 76.97060259216505 y: 363.9210031388636 positionAbsolute: - x: 4362.970602592165 - y: 1267.9210031388636 + x: 5339.42687987225 + y: 1279.9210031388636 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: context: @@ -1975,95 +2303,583 @@ workflow: variables: [] vision: enabled: false - height: 90 + height: 89 id: '1742468584059' parentId: '1741497176064' position: - x: 1013.1944929957504 - y: 157.34078070824808 + x: 1013.1944929957504 + y: 157.34078070824808 + positionAbsolute: + x: 6275.650770275835 + y: 1073.340780708248 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + context: + enabled: false + variable_selector: [] + desc: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + prompt_template: + - id: 893c9a67-e9e3-4c2c-8ed2-6301998d555b + role: system + text: You are an intelligent assistant in the observability field, helping + users analyze problems + - id: ccfb4eb1-f253-415d-9a60-9ecab7bd6af4 + role: user + text: 'This alert event is an event type + + affecting {{#1741497181784.pod#}}, give some suggestions' + selected: false + title: LLM 4 + type: llm + variables: [] + vision: + enabled: false + height: 89 + id: '1742468652489' + parentId: '1741497176064' + position: + x: 535.2725275358107 + y: 237.25999906213883 + positionAbsolute: + x: 5797.728804815895 + y: 1153.2599990621388 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + iteration_id: '1741497176064' + output_type: string + selected: false + title: summary + type: variable-aggregator + variables: + - - '1741506766037' + - text + - - '1742468584059' + - text + - - '1742468652489' + - text + height: 150 + id: '1742470455066' + parentId: '1741497176064' + position: + x: 6244.360125927147 + y: 216.75503228886544 + positionAbsolute: + x: 11506.81640320723 + y: 1132.7550322888656 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 + label: + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace + label: + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: Query container rtt + tool_configurations: {} + tool_label: Query container rtt + tool_name: 查询容器网络与下游RTT + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + namespace: + type: mixed + value: '{{#1741497181784.namespace#}}' + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742547917612' + parentId: '1741497176064' + position: + x: 837.913049217997 + y: 567.6173152328563 positionAbsolute: - x: 5299.19449299575 - y: 1061.340780708248 + x: 6100.369326498081 + y: 1483.6173152328563 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: - context: - enabled: false - variable_selector: [] + desc: '' + is_team_authorization: true + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified node name + ja_JP: Specified node name + pt_BR: Specified pod name + zh_Hans: 指定的主机名称 + label: + en_US: node_name + ja_JP: node_name + pt_BR: node_name + zh_Hans: node_name + llm_description: Specified pod name + max: null + min: null + name: node_name + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified Process ID + ja_JP: Specified Process ID + pt_BR: Specified Process ID + zh_Hans: 指定的进程ID + label: + en_US: pid + ja_JP: pid + pt_BR: pid + zh_Hans: pid + llm_description: Specified Process ID + max: null + min: null + name: pid + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + node_name: '' + pid: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: get pod info in node + tool_configurations: {} + tool_label: Thread Polaris Metrics Process All monitor + tool_name: originx_service_monitor + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + node_name: + type: mixed + value: '{{#1741227526517.nodeName#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742629595400' + position: + x: 939 + y: 720 + positionAbsolute: + x: 939 + y: 720 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: desc: '' isInIteration: true + is_team_authorization: true iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 893c9a67-e9e3-4c2c-8ed2-6301998d555b - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: ccfb4eb1-f253-415d-9a60-9ecab7bd6af4 - role: user - text: 'This alert event is an event type - - affecting {{#1741497181784.pod#}}, give some suggestions' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 + label: + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace + label: + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin selected: false - title: LLM 4 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742468652489' + title: Query container rtt + tool_configurations: {} + tool_label: Query container rtt + tool_name: 查询容器网络与下游RTT + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + namespace: + type: mixed + value: '{{#1741497181784.namespace#}}' + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742798505742' parentId: '1741497176064' position: - x: 592.7847463655689 - y: 258.56082085093817 + x: 838.2707565556775 + y: 677.0915533804653 positionAbsolute: - x: 4878.784746365569 - y: 1162.5608208509382 + x: 6100.727033835762 + y: 1593.0915533804653 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: + code: " \ndef get_value(data, keys): \n for key in keys: \n value = data.get(key)\ + \ \n if value is not None: \n return value \n return \"\" \n\n\ + import json \n\ndef main(arg: str) -> dict:\n data = json.loads(arg) \n\ + \ return { \n \"alertName\": get_value(data, [\"alertName\"]), \n\ + \ \"service\": get_value(data, [\"svc_name\", \"service\"]), \n \"endpoint\"\ + : get_value(data,[\"endpoint\", \"content_key\"]), \n \"pod\": get_value(data,[\"\ + pod\", \"src_pod\", \"pod_name\"]), \n \"namespace\": get_value(data,[\"\ + namespace\", \"src_namespace\"]), \n}" + code_language: python3 desc: '' - isInIteration: true - iteration_id: '1741497176064' - output_type: string + outputs: + alertName: + children: null + type: string + endpoint: + children: null + type: string + namespace: + children: null + type: string + pod: + children: null + type: string + service: + children: null + type: string selected: false - title: summary - type: variable-aggregator + title: get alert event label info + type: code variables: - - - '1741506766037' - - text - - - '1742468584059' - - text - - - '1742468652489' - - text - height: 152 - id: '1742470455066' - parentId: '1741497176064' + - value_selector: + - '1741227526517' + - params + variable: arg + height: 53 + id: '1742807803325' position: - x: 2944.360125927147 - y: 216.75503228886544 + x: 333 + y: 444 positionAbsolute: - x: 7230.360125927147 - y: 1120.7550322888656 + x: 333 + y: 444 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' isInIteration: true @@ -2075,19 +2891,19 @@ workflow: default: null form: llm human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name max: null min: null - name: pod + name: cadvisor_job_name options: [] placeholder: null precision: null @@ -2099,16 +2915,16 @@ workflow: default: null form: llm human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace max: null min: null name: namespace @@ -2123,16 +2939,40 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time - pt_BR: Data query start time + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time(Microsecond) zh_Hans: 开始时间 (微秒) label: en_US: startTime ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -2147,16 +2987,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -2168,6 +3008,7 @@ workflow: template: null type: number params: + cadvisor_job_name: '' endTime: '' namespace: '' pod: '' @@ -2176,10 +3017,12 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: Query container rtt + title: Container CPU usage rate (Containerd runtime, aggregated by container + and Pod) tool_configurations: {} - tool_label: Query container rtt - tool_name: 查询容器网络与下游RTT + tool_label: Container CPU usage rate (Containerd runtime, aggregated by container + and Pod) + tool_name: 容器CPU使用率(使用Containerd容器运行时,按容器和Pod统计) tool_parameters: endTime: type: variable @@ -2198,47 +3041,49 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742547917612' + height: 53 + id: '1742980228913' parentId: '1741497176064' position: - x: 837.913049217997 - y: 567.6173152328563 + x: 817.3433448742644 + y: 386.77445077825655 positionAbsolute: - x: 5123.9130492179975 - y: 1471.6173152328563 + x: 6079.799622154349 + y: 1302.7744507782566 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' + isInIteration: true is_team_authorization: true + iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null default: null form: llm human_description: - en_US: Specified node name - ja_JP: Specified node name - pt_BR: Specified pod name - zh_Hans: 指定的主机名称 + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 label: - en_US: node_name - ja_JP: node_name - pt_BR: node_name - zh_Hans: node_name - llm_description: Specified pod name + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name max: null min: null - name: node_name + name: cadvisor_job_name options: [] placeholder: null precision: null - required: true + required: false scope: null template: null type: string @@ -2246,19 +3091,43 @@ workflow: default: null form: llm human_description: - en_US: Specified Process ID - ja_JP: Specified Process ID - pt_BR: Specified Process ID - zh_Hans: 指定的进程ID + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 label: - en_US: pid - ja_JP: pid - pt_BR: pid - zh_Hans: pid - llm_description: Specified Process ID + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null - name: pid + name: pod options: [] placeholder: null precision: null @@ -2270,16 +3139,16 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time - pt_BR: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time(Microsecond) zh_Hans: 开始时间 (微秒) label: en_US: startTime ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -2294,16 +3163,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -2315,46 +3184,54 @@ workflow: template: null type: number params: + cadvisor_job_name: '' endTime: '' - node_name: '' - pid: '' + namespace: '' + pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: get pod info in node + title: Container disk read time per second (Containerd runtime, aggregated + by container and Pod) tool_configurations: {} - tool_label: Thread Polaris Metrics Process All monitor - tool_name: originx_service_monitor + tool_label: Container disk read time per second (Containerd runtime, aggregated + by container and Pod) + tool_name: 容器磁盘读取耗时每秒(使用Containerd,按Pod和容器统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - node_name: + namespace: type: mixed - value: '{{#1741227526517.nodeName#}}' + value: '{{#1741497181784.namespace#}}' + pod: + type: mixed + value: '{{#1741497181784.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1742629595400' + height: 53 + id: '1742980318484' + parentId: '1741497176064' position: - x: 942 - y: 868 + x: 829.6661633624499 + y: 478.0639330308825 positionAbsolute: - x: 942 - y: 868 + x: 6092.1224406425345 + y: 1394.0639330308825 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 + zIndex: 1002 - data: desc: '' isInIteration: true @@ -2366,16 +3243,16 @@ workflow: default: null form: llm human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null name: pod @@ -2390,32 +3267,8 @@ workflow: default: null form: llm human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace - label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace - max: null - min: null - name: namespace - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -2423,7 +3276,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -2438,16 +3291,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -2460,26 +3313,22 @@ workflow: type: number params: endTime: '' - namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: Query container rtt + title: thread in CPU tool_configurations: {} - tool_label: Query container rtt - tool_name: 查询容器网络与下游RTT + tool_label: 线程在CPU上的耗时折线图(按Pod统计) + tool_name: 线程在CPU上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' pod: type: mixed value: '{{#1741497181784.pod#}}' @@ -2489,69 +3338,21 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742798505742' + height: 53 + id: '1742980720651' parentId: '1741497176064' position: - x: 838.2707565556775 - y: 677.0915533804653 + x: 514.1495817191098 + y: 381.2394319656114 positionAbsolute: - x: 5124.2707565556775 - y: 1581.0915533804653 + x: 5776.605858999194 + y: 1297.2394319656114 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - - data: - code: " \ndef get_value(data, keys): \n for key in keys: \n value = data.get(key)\ - \ \n if value is not None: \n return value \n return \"\" \n\n\ - import json \n\ndef main(arg: str) -> dict:\n data = json.loads(arg) \n\ - \ return { \n \"alertName\": get_value(data, [\"alertName\"]), \n\ - \ \"service\": get_value(data, [\"svc_name\", \"service\"]), \n \"endpoint\"\ - : get_value(data,[\"endpoint\", \"content_key\"]), \n \"pod\": get_value(data,[\"\ - pod\", \"src_pod\", \"pod_name\"]), \n \"namespace\": get_value(data,[\"\ - namespace\", \"src_namespace\"]), \n}" - code_language: python3 - desc: '' - outputs: - alertName: - children: null - type: string - endpoint: - children: null - type: string - namespace: - children: null - type: string - pod: - children: null - type: string - service: - children: null - type: string - selected: false - title: get alert event label info - type: code - variables: - - value_selector: - - '1741227526517' - - params - variable: arg - height: 54 - id: '1742807803325' - position: - x: 334 - y: 586 - positionAbsolute: - x: 334 - y: 586 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - data: desc: '' isInIteration: true @@ -2563,19 +3364,19 @@ workflow: default: null form: llm human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null - name: cadvisor_job_name + name: pod options: [] placeholder: null precision: null @@ -2587,26 +3388,99 @@ workflow: default: null form: llm human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time(Microsecond) max: null min: null - name: namespace + name: startTime options: [] placeholder: null precision: null - required: false + required: true scope: null template: null - type: string + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query end time(Microsecond) + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: thread in file + tool_configurations: {} + tool_label: 线程在文件操作上的耗时折线图(按Pod统计) + tool_name: 线程在文件操作上的耗时折线图(按Pod统计) + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742980748320' + parentId: '1741497176064' + position: + x: 502.3624003022592 + y: 478.98654261939305 + positionAbsolute: + x: 5764.818677582343 + y: 1394.986542619393 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: - auto_generate: null default: null form: llm @@ -2637,7 +3511,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -2680,30 +3554,23 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' - namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: Container CPU usage rate (Containerd runtime, aggregated by container - and Pod) + title: thread in net tool_configurations: {} - tool_label: Container CPU usage rate (Containerd runtime, aggregated by container - and Pod) - tool_name: 容器CPU使用率(使用Containerd容器运行时,按容器和Pod统计) + tool_label: 线程在网络操作上的耗时折线图(按Pod统计) + tool_name: 线程在网络操作上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' pod: type: mixed value: '{{#1741497181784.pod#}}' @@ -2713,20 +3580,20 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980228913' + height: 53 + id: '1742980780865' parentId: '1741497176064' position: - x: 817.3433448742644 - y: 386.77445077825655 + x: 507.1563167397626 + y: 565.5281468443313 positionAbsolute: - x: 5103.343344874264 - y: 1290.7744507782566 + x: 5769.612594019847 + y: 1481.5281468443313 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -2735,54 +3602,6 @@ workflow: iteration_id: '1741497176064' output_schema: null paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name - max: null - min: null - name: cadvisor_job_name - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace - max: null - min: null - name: namespace - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - auto_generate: null default: null form: llm @@ -2813,7 +3632,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -2856,30 +3675,23 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' - namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: Container disk read time per second (Containerd runtime, aggregated - by container and Pod) + title: thread in epoll tool_configurations: {} - tool_label: Container disk read time per second (Containerd runtime, aggregated - by container and Pod) - tool_name: 容器磁盘读取耗时每秒(使用Containerd,按Pod和容器统计) + tool_label: 线程在Epoll操作上的耗时折线图(按Pod统计) + tool_name: 线程在Epoll操作上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' pod: type: mixed value: '{{#1741497181784.pod#}}' @@ -2889,20 +3701,20 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980318484' + height: 53 + id: '1742980837261' parentId: '1741497176064' position: - x: 829.6661633624499 - y: 478.0639330308825 + x: 513.7505744250511 + y: 675.3340235425774 positionAbsolute: - x: 5115.66616336245 - y: 1382.0639330308825 + x: 5776.206851705136 + y: 1591.3340235425774 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -2991,10 +3803,10 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: thread in CPU + title: thread in runq tool_configurations: {} - tool_label: 线程在CPU上的耗时折线图(按Pod统计) - tool_name: 线程在CPU上的耗时折线图(按Pod统计) + tool_label: 线程在运行队列上的耗时折线图(按Pod统计) + tool_name: 线程在运行队列上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable @@ -3010,20 +3822,104 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980720651' + height: 53 + id: '1742980885557' parentId: '1741497176064' position: - x: 501.0045489698464 - y: 384.9951556082583 + x: 519.4457802875913 + y: 800.367276200539 + positionAbsolute: + x: 5781.902057567676 + y: 1716.367276200539 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "\ndef main(arg1: str) -> dict:\n data = json.loads(arg1)\n return\ + \ {\n \"pod\": data.get(\"pod\", \"\"),\n \"namespace\": data.get(\"\ + namespace\", \"\")\n }\n" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + namespace: + children: null + type: string + pod: + children: null + type: string + selected: false + title: POD info + type: code + variables: + - value_selector: + - '1741509454645' + - first + variable: arg1 + height: 53 + id: '17430589567120' + position: + x: 1848 + y: 628 + positionAbsolute: + x: 1848 + y: 628 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + classes: + - id: '1742462167200' + name: 'container + + high memory' + - id: '1742463856746' + name: 'event type + + container was killed' + - id: '1742464231696' + name: unknow type + desc: '' + instruction: You are an intelligent alert classification assistant. Your task + is to classify the given alert events. + instructions: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + query_variable_selector: + - '1742807803325' + - alertName + selected: false + title: alert event cls + topics: [] + type: question-classifier + vision: + enabled: false + height: 203 + id: '17430590082510' + position: + x: 2151 + y: 628 positionAbsolute: - x: 4787.004548969846 - y: 1288.9951556082583 + x: 2151 + y: 628 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -3032,6 +3928,54 @@ workflow: iteration_id: '1741497176064' output_schema: null paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + label: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name + max: null + min: null + name: cadvisor_job_name + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + label: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -3062,7 +4006,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time + pt_BR: Data query start time(Microsecond) zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -3105,23 +4049,28 @@ workflow: template: null type: number params: + cadvisor_job_name: '' endTime: '' + namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: thread in file + title: container memory tool_configurations: {} - tool_label: 线程在文件操作上的耗时折线图(按Pod统计) - tool_name: 线程在文件操作上的耗时折线图(按Pod统计) + tool_label: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) + tool_name: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime + namespace: + type: mixed + value: '{{#1741497181784.namespace#}}' pod: type: mixed value: '{{#1741497181784.pod#}}' @@ -3131,20 +4080,20 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980748320' + height: 53 + id: '1743059090157' parentId: '1741497176064' position: - x: 502.3624003022592 - y: 478.98654261939305 + x: 544.0386199547656 + y: 125.67116500938346 positionAbsolute: - x: 4788.36240030226 - y: 1382.986542619393 + x: 5806.49489723485 + y: 1041.6711650093835 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -3153,6 +4102,54 @@ workflow: iteration_id: '1741497176064' output_schema: null paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + label: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name + max: null + min: null + name: cadvisor_job_name + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + label: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -3183,7 +4180,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time + pt_BR: Data query start time(Microsecond) zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -3226,46 +4223,187 @@ workflow: template: null type: number params: + cadvisor_job_name: '' endTime: '' + namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: thread in net + title: container memory tool_configurations: {} - tool_label: 线程在网络操作上的耗时折线图(按Pod统计) - tool_name: 线程在网络操作上的耗时折线图(按Pod统计) + tool_label: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) + tool_name: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime + namespace: + type: mixed + value: '{{#17430589567120.namespace#}}' pod: type: mixed - value: '{{#1741497181784.pod#}}' + value: '{{#17430589567120.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980780865' - parentId: '1741497176064' + height: 53 + id: '17430593614550' position: - x: 507.1563167397626 - y: 565.5281468443313 + x: 4272 + y: 628 + positionAbsolute: + x: 4272 + y: 628 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + context: + enabled: false + variable_selector: [] + desc: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + prompt_template: + - id: 25386b5d-4509-477b-bdab-d835cd12b104 + role: system + text: You are an intelligent assistant in the observability field, helping + users analyze problems + - id: 5f74b2ce-6208-423b-aa3b-f01f2cafb89b + role: user + text: '# Purpose + + + Current pod: {{#17430589567120.pod#}}) + + + Due to the increase in memory alert, it is necessary to analyze the cause + and provide a solution. + + # Output requirements + + Show the trend of memory metrics data (describe in simple language so + that people can understand it at a glance). + + Provide relevant suggestions, including: + + Check whether the code may have memory leaks. + + Practical methods such as analyzing the root cause of the problem through + logs. + + # Data source + + + Container memory data: {{#17430593614550.text#}}.' + selected: false + title: memory analysis + type: llm + variables: [] + vision: + enabled: false + height: 89 + id: '17430593816310' + position: + x: 4575 + y: 628 + positionAbsolute: + x: 4575 + y: 628 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + iteration_id: '1741497176064' + output_type: string + selected: false + title: summary1 + type: variable-aggregator + variables: + - - '17430593816310' + - text + - - '17430594510140' + - text + - - '17430596469370' + - text + height: 150 + id: '17430594012660' + position: + x: 4890 + y: 908 + positionAbsolute: + x: 4890 + y: 908 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + context: + enabled: false + variable_selector: [] + desc: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + prompt_template: + - id: 893c9a67-e9e3-4c2c-8ed2-6301998d555b + role: system + text: You are an intelligent assistant in the observability field, helping + users analyze problems + - id: ccfb4eb1-f253-415d-9a60-9ecab7bd6af4 + role: user + text: 'This alert event is an event type + + affecting {{#17430589567120.pod#}}, give some suggestions' + selected: false + title: event type + type: llm + variables: [] + vision: + enabled: false + height: 89 + id: '17430594510140' + position: + x: 4575 + y: 1144 positionAbsolute: - x: 4793.156316739763 - y: 1469.5281468443313 + x: 4575 + y: 1144 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -3354,10 +4492,10 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: thread in epoll + title: thread time consumption on CPU (by Pod) tool_configurations: {} - tool_label: 线程在Epoll操作上的耗时折线图(按Pod统计) - tool_name: 线程在Epoll操作上的耗时折线图(按Pod统计) + tool_label: 线程在CPU上的耗时折线图(按Pod统计) + tool_name: 线程在CPU上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable @@ -3366,27 +4504,26 @@ workflow: - endTime pod: type: mixed - value: '{{#1741497181784.pod#}}' + value: '{{#17430589567120.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980837261' - parentId: '1741497176064' + height: 53 + id: '17430595109950' position: - x: 513.7505744250511 - y: 675.3340235425774 + x: 2757 + y: 720 positionAbsolute: - x: 4799.750574425051 - y: 1579.3340235425774 + x: 2757 + y: 720 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -3395,6 +4532,54 @@ workflow: iteration_id: '1741497176064' output_schema: null paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + label: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name + max: null + min: null + name: cadvisor_job_name + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + label: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -3425,7 +4610,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time + pt_BR: Data query start time(Microsecond) zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -3468,46 +4653,51 @@ workflow: template: null type: number params: + cadvisor_job_name: '' endTime: '' + namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: thread in runq + title: container cpu tool_configurations: {} - tool_label: 线程在运行队列上的耗时折线图(按Pod统计) - tool_name: 线程在运行队列上的耗时折线图(按Pod统计) + tool_label: Container CPU usage rate (Containerd runtime, aggregated by container + and Pod) + tool_name: 容器CPU使用率(使用Containerd容器运行时,按容器和Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime + namespace: + type: mixed + value: '{{#17430589567120.namespace#}}' pod: type: mixed - value: '{{#1741497181784.pod#}}' + value: '{{#17430589567120.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980885557' - parentId: '1741497176064' + height: 53 + id: '17430595158080' position: - x: 519.4457802875913 - y: 800.367276200539 + x: 3060 + y: 720 positionAbsolute: - x: 4805.445780287591 - y: 1704.367276200539 + x: 3060 + y: 720 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: context: @@ -3518,439 +4708,561 @@ workflow: iteration_id: '1741497176064' model: completion_params: - temperature: 0.7 + temperature: 0.6 mode: chat name: deepseek-chat provider: langgenius/deepseek/deepseek prompt_template: - - id: 3ce935be-61a8-4ebe-ac8c-ed8039a2b3d3 + - id: cd35fff4-a037-4e72-af99-2ff8299fc5d2 role: system text: You are an intelligent assistant in the observability field, helping users analyze problems - - id: 27e985b3-1039-4a38-9f9c-f9d78d83597d + - id: 2b2ad468-efcd-4bcc-aeb9-d53d2f2770ad role: user - text: '# Purpose - - Summarize the following data to make it concise and easy to understand: + text: '​​# Objective​​ - 1. Execution time data of all application threads on CPU types + Analyze whether application {{#17430589567120.pod#}} is impacted by alert + event {{#1742807803325.alertName#}} based on anomaly thread data across + resource categories, and perform preliminary root cause attribution. - 2. CPU-related indicator data of the application + ​​# Input Data Specifications​​ - # Note - - 1. The output summary can include a description of the number of threads, - and can also give the average time change of most threads - - 2. The time unit is nanoseconds (ns), and the unit must be retained - - 3. Make sure the description is concise and easy for users to understand - - - # Data - - cpu time (unit: nanoseconds, ns): - - {{#1742980720651.text#}} - - cpu indicator: - - {{#1742980720651.text#}}' - selected: false - title: cpu analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742980933811' - parentId: '1741497176064' - position: - x: 1523.5849163475727 - y: 369.82226364108806 - positionAbsolute: - x: 5809.584916347572 - y: 1273.822263641088 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 2aacf14d-625b-435f-b564-d4882157fe1c - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: fd4d9226-6f01-4d5d-bb05-c0d1cb570ed5 - role: user - text: '# Purpose - Summarize the following data to make it concise and easy to understand: + ​​Per-category data​​ includes thread latency and associated North Star + metrics (e.g., network RTT for network-related latency). - 1. Application execution time data of all threads on file type + ​​Anomaly data point count​​: Number of instances where latency exceeds + 20% of the historical average for the same thread type. The average value + of the thread. - 2. Application read disk indicator data + ​​# Analysis Rules​​ - # Note + ​​Identify Primary Anomaly Direction​​ - 1. Output summary can include description of number of threads + Give the average value of the abnormal thread. - 2. Time consumption unit is nanosecond (ns), and the unit is retained - in the output + Determine the resource type with the ​​most significant latency increase​​ + (e.g., values elevated to ​​second-level magnitudes​​ instead of milliseconds). - 3. Make sure the description is concise and easy for users to understand + Prioritize ​​thread count analysis​​: If a resource type (e.g., network/epoll) + has the highest number of anomalous threads, attribute the root cause + to that category. + Example: 4 threads with network/epoll anomalies vs. 2 CPU threads → classify + as ​​network issue​​. - # Data + ​​Avoid Misclassification​​ - File time consumption (unit: nanosecond, ns): + If ​​CPU​​ or ​​runQ​​ latency spikes dominate (with no concurrent network/epoll + anomalies), attribute to ​​CPU contention​​ instead of network. - {{#1742980748320.text#}} + ​​Tiebreaker Priority​​ (Descending Order): + ​​CPU > Network > Epoll > File > RunQ​​. - Read disk indicator: + ​​# Root Cause Attribution & Recommendations​​ - {{#1742980318484.text#}}' - selected: false - title: file analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742981271838' - parentId: '1741497176064' - position: - x: 1558.557136936397 - y: 472.1294984224769 - positionAbsolute: - x: 5844.557136936397 - y: 1376.129498422477 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 2fcf3791-e5a8-4c5b-9f9b-73753dedd9f7 - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: 95e534cf-6856-4d33-bd3e-680aa819a13b - role: user - text: '# Purpose - Summarize the following data to make it concise and easy to understand: + ​​CPU Latency Surge​​: - 1. Execution time data of all application threads on net type + Check for code over-nesting; perform rollback if confirmed. - 2. Network RTT indicator data of the application + ​​High CPU Preemption​​: + Investigate resource contention from co-located processes. - # Note + ​​Network/Epoll Latency Surge​​: - 1. The output summary can include a description of the number of threads, - and can also give the average time change of most threads + The net/epoll type data might include a summary about RTT. - 2. The time unit is nanoseconds (ns), and the unit is retained in the - output + If RTT is abnormal → troubleshoot network; RTT normal → inspect downstream + services. - 3. The RTT indicator unit is seconds. If the value is less than 0.05 seconds, - you can add a note "Network is normal" + ​​File Latency Increase​​: - 4. Make sure the description is concise and easy for users to understand + Audit excessive file handles. + ​​# Output Format​​ - # Data + ​​Application​​: {{#17430589567120.pod#}} - Network time (unit: nanoseconds, ns): + ​​North Star Metric Trends Summary​​ - {{#1742980780865.text#}} + Summarize significant changes per metric. - Network RTT indicator (unit: seconds, if the value < 0.05, the network - is normal): + If no anomalies: "No observable deviations." - {{#1742980780865.text#}}' - selected: false - title: net analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742981275937' - parentId: '1741497176064' - position: - x: 1563.9713697080979 - y: 586.9524528027102 - positionAbsolute: - x: 5849.971369708098 - y: 1490.9524528027102 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 1f3e7592-c8f0-455a-8abb-23c74aaf5fb8 - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: 9ed18fa7-b43f-4f11-ba13-2dcd03fc16c9 - role: user - text: '# Purpose + ​​Preliminary Root Cause Conclusion​​ - Summarize the following data to make it concise and easy to understand: - 1. Execution time data of all threads of the application on the epoll - type + State whether the alert impacts the application. - 2. Network RTT indicator data of the application + Provide ​​single-direction attribution​​ based on North Star metrics and + analysis rules. + Note: If network/epoll is suspected with normal RTT, attribute to ​​downstream + service latency​​. - # Note + ​​# Input Data​​ - 1. The output summary can include a description of the number of threads, - and can also give the average time change of most threads - 2. The time unit is nanoseconds (ns), and the unit is retained in the - output + ​​CPU​​: {{#17443388433580.result#}} - 3. The RTT indicator unit is seconds. If the value is less than 0.05 seconds, - you can add a note "Network is normal" + ​​Network​​: {{#17443388438160.result#}} - 4. Make sure the description is concise and easy for users to understand + ​​File​​: {{#17443388421360.result#}} + ​​Epoll​​: {{#1744290470304.result#}} - # Data + ​​RunQ​​: {{#17443388443000.result#}} - epoll time (unit: nanoseconds, ns): + ​​# Guidelines​​ - {{#1742980837261.text#}} + Use concise, non-technical language for readability. - Network RTT indicator (unit: seconds, if the value < 0.05, the network - is normal): + Avoid ambiguous terms; prioritize actionable insights. - {{#1742798505742.text#}}' + ' selected: false - title: epoll analysis + title: llm analysis root cause type: llm variables: [] vision: enabled: false - height: 90 - id: '1742981278010' - parentId: '1741497176064' + height: 89 + id: '17430596469370' position: - x: 1536.393337231676 - y: 714.101728498571 + x: 4575 + y: 904 positionAbsolute: - x: 5822.393337231676 - y: 1618.101728498571 + x: 4575 + y: 904 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: - context: - enabled: false - variable_selector: [] desc: '' isInIteration: true + is_team_authorization: true iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: b4463776-4368-40e5-b3ea-28a179ebc11c - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: 44df105c-0a0a-4147-ae4a-7e4bda7bb3af - role: user - text: '# Purpose - - Summarize the following data to make it concise and easy to understand: - - 1. Execution time data of all application threads on runq type - - 2. CPU Throttle Time indicator data of application - - - # Note - - 1. Output summary can bring description of number of threads - - 2. Time unit is nanosecond (ns), and the unit is retained in the output - - 3. Make sure the description is concise and easy for users to understand - - - # Data - - Runq time (unit: nanosecond, ns): - - {{#1742980885557.text#}} - - - CPU Throttle Time indicator: - - {{#1741502699500.text#}}' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time(Microsecond) + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query end time(Microsecond) + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin selected: false - title: runq analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742981280434' - parentId: '1741497176064' + title: thread time consumption on File (by Pod) + tool_configurations: {} + tool_label: 线程在文件操作上的耗时折线图(按Pod统计) + tool_name: 线程在文件操作上的耗时折线图(按Pod统计) + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + pod: + type: mixed + value: '{{#17430589567120.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '17430597987060' position: - x: 1570.9420500051347 - y: 826.9814099810242 + x: 2757 + y: 812 positionAbsolute: - x: 5856.942050005135 - y: 1730.9814099810242 + x: 2757 + y: 812 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: - code: "\ndef main(arg1: str) -> dict:\n data = json.loads(arg1)\n return\ - \ {\n \"pod\": data.get(\"pod\", \"\"),\n \"namespace\": data.get(\"\ - namespace\", \"\")\n }\n" - code_language: python3 desc: '' isInIteration: true + is_team_authorization: true iteration_id: '1741497176064' - outputs: + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + label: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name + max: null + min: null + name: cadvisor_job_name + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + label: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time(Microsecond) + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time(Microsecond) + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query end time(Microsecond) + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + cadvisor_job_name: '' + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: container read disk + tool_configurations: {} + tool_label: Container disk read time per second (Containerd runtime, aggregated + by container and Pod) + tool_name: 容器磁盘读取耗时每秒(使用Containerd,按Pod和容器统计) + tool_parameters: + cadvisor_job_name: + type: mixed + value: '' + endTime: + type: variable + value: + - '1741227526517' + - endTime namespace: - children: null - type: string + type: mixed + value: '{{#17430589567120.namespace#}}' pod: - children: null - type: string - selected: false - title: POD info - type: code - variables: - - value_selector: - - '1741509454645' - - first - variable: arg1 - height: 54 - id: '17430589567120' + type: mixed + value: '{{#17430589567120.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '17430598152780' position: - x: 1854 - y: 774 + x: 3060 + y: 812 positionAbsolute: - x: 1854 - y: 774 + x: 3060 + y: 812 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: - classes: - - id: '1742462167200' - name: 'container - - high memory' - - id: '1742463856746' - name: 'event type - - container was killed' - - id: '1742464231696' - name: unknow type desc: '' - instruction: You are an intelligent alert classification assistant. Your task - is to classify the given alert events. - instructions: '' isInIteration: true + is_team_authorization: true iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - query_variable_selector: - - '1742807803325' - - alertName + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time(Microsecond) + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query end time(Microsecond) + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin selected: false - title: alert event cls - topics: [] - type: question-classifier - vision: - enabled: false - height: 204 - id: '17430590082510' + title: Thread time consumption on Net (by Pod) + tool_configurations: {} + tool_label: 线程在网络操作上的耗时折线图(按Pod统计) + tool_name: 线程在网络操作上的耗时折线图(按Pod统计) + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + pod: + type: mixed + value: '{{#17430589567120.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '17430598907140' position: - x: 2158 - y: 774 + x: 2454 + y: 904 positionAbsolute: - x: 2158 - y: 774 + x: 2454 + y: 904 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -3963,19 +5275,19 @@ workflow: default: null form: llm human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name max: null min: null - name: cadvisor_job_name + name: pod options: [] placeholder: null precision: null @@ -3987,16 +5299,16 @@ workflow: default: null form: llm human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace max: null min: null name: namespace @@ -4007,6 +5319,106 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: container rtt + tool_configurations: {} + tool_label: Query container rtt + tool_name: 查询容器网络与下游RTT + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + namespace: + type: mixed + value: '{{#17430589567120.namespace#}}' + pod: + type: mixed + value: '{{#17430589567120.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '17430598942980' + position: + x: 2757 + y: 904 + positionAbsolute: + x: 2757 + y: 904 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: - auto_generate: null default: null form: llm @@ -4037,7 +5449,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -4080,51 +5492,45 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' - namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: container memory + title: thread time consumption on Epoll (by Pod) tool_configurations: {} - tool_label: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) - tool_name: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) + tool_label: 线程在Epoll操作上的耗时折线图(按Pod统计) + tool_name: 线程在Epoll操作上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' pod: type: mixed - value: '{{#1741497181784.pod#}}' + value: '{{#17430589567120.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1743059090157' - parentId: '1741497176064' + height: 53 + id: '17430610599980' position: - x: 544.0386199547656 - y: 125.67116500938346 + x: 2454 + y: 1088 positionAbsolute: - x: 4830.038619954766 - y: 1029.6711650093835 + x: 2454 + y: 1088 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -4137,43 +5543,19 @@ workflow: default: null form: llm human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name - max: null - min: null - name: cadvisor_job_name - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 + label: + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name max: null min: null - name: namespace + name: pod options: [] placeholder: null precision: null @@ -4185,19 +5567,19 @@ workflow: default: null form: llm human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace max: null min: null - name: pod + name: namespace options: [] placeholder: null precision: null @@ -4209,16 +5591,16 @@ workflow: default: null form: llm human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time(Microsecond) + llm_description: Data query start time max: null min: null name: startTime @@ -4233,16 +5615,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query end time(Microsecond) + llm_description: Data query start time max: null min: null name: endTime @@ -4254,7 +5636,6 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' namespace: '' pod: '' @@ -4263,10 +5644,10 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: container memory + title: container rtt tool_configurations: {} - tool_label: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) - tool_name: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) + tool_label: Query container rtt + tool_name: 查询容器网络与下游RTT tool_parameters: endTime: type: variable @@ -4285,156 +5666,19 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '17430593614550' - position: - x: 3374 - y: 774 - positionAbsolute: - x: 3374 - y: 774 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 25386b5d-4509-477b-bdab-d835cd12b104 - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: 5f74b2ce-6208-423b-aa3b-f01f2cafb89b - role: user - text: '# Purpose - - - Current pod: {{#17430589567120.pod#}}) - - - Due to the increase in memory alert, it is necessary to analyze the cause - and provide a solution. - - # Output requirements - - Show the trend of memory metrics data (describe in simple language so - that people can understand it at a glance). - - Provide relevant suggestions, including: - - Check whether the code may have memory leaks. - - Practical methods such as analyzing the root cause of the problem through - logs. - - # Data source - - - Container memory data: {{#17430593614550.text#}}.' - selected: false - title: memory analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430593816310' - position: - x: 3678 - y: 774 - positionAbsolute: - x: 3678 - y: 774 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - desc: '' - isInIteration: true - iteration_id: '1741497176064' - output_type: string - selected: false - title: summary1 - type: variable-aggregator - variables: - - - '17430593816310' - - text - - - '17430594510140' - - text - - - '17430596469370' - - text - height: 152 - id: '17430594012660' - position: - x: 3982 - y: 904 - positionAbsolute: - x: 3982 - y: 904 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 893c9a67-e9e3-4c2c-8ed2-6301998d555b - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: ccfb4eb1-f253-415d-9a60-9ecab7bd6af4 - role: user - text: 'This alert event is an event type - - affecting {{#17430589567120.pod#}}, give some suggestions' - selected: false - title: event type - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430594510140' + height: 53 + id: '17430610640640' position: - x: 3678 - y: 904 + x: 2757 + y: 1088 positionAbsolute: - x: 3678 - y: 904 + x: 2757 + y: 1088 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -4523,10 +5767,10 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: thread time consumption on CPU (by Pod) + title: thread time consumption on Runq(by Pod) tool_configurations: {} - tool_label: 线程在CPU上的耗时折线图(按Pod统计) - tool_name: 线程在CPU上的耗时折线图(按Pod统计) + tool_label: 线程在运行队列上的耗时折线图(按Pod统计) + tool_name: 线程在运行队列上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable @@ -4542,19 +5786,19 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '17430595109950' + height: 53 + id: '17430610719970' position: - x: 2462 - y: 979 + x: 2757 + y: 996 positionAbsolute: - x: 2462 - y: 979 + x: 2757 + y: 996 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -4567,23 +5811,23 @@ workflow: default: null form: llm human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name max: null min: null - name: cadvisor_job_name + name: pod options: [] placeholder: null precision: null - required: false + required: true scope: null template: null type: string @@ -4591,47 +5835,23 @@ workflow: default: null form: llm human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace max: null min: null name: namespace options: [] placeholder: null precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false + required: true scope: null template: null type: string @@ -4639,16 +5859,16 @@ workflow: default: null form: llm human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time(Microsecond) + llm_description: Data query start time max: null min: null name: startTime @@ -4663,16 +5883,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query end time(Microsecond) + llm_description: Data query start time max: null min: null name: endTime @@ -4684,7 +5904,6 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' namespace: '' pod: '' @@ -4693,11 +5912,10 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: container cpu + title: Container cpu throttling tool_configurations: {} - tool_label: Container CPU usage rate (Containerd runtime, aggregated by container - and Pod) - tool_name: 容器CPU使用率(使用Containerd容器运行时,按容器和Pod统计) + tool_label: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) + tool_name: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) tool_parameters: endTime: type: variable @@ -4716,270 +5934,23 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '17430595158080' - position: - x: 2766 - y: 979 - positionAbsolute: - x: 2766 - y: 979 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 3ce935be-61a8-4ebe-ac8c-ed8039a2b3d3 - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: 27e985b3-1039-4a38-9f9c-f9d78d83597d - role: user - text: '# Purpose - - Summarize the following data to make it concise and easy to understand: - - 1. Execution time data of all application threads on CPU types - - 2. CPU-related indicator data of the application - - - # Note - - 1. The output summary can include a description of the number of threads, - and can also give the average time change of most threads - - 2. The time unit is nanoseconds (ns), and the unit must be retained - - 3. Make sure the description is concise and easy for users to understand - - - # Data - - cpu time (unit: nanoseconds, ns): - - {{#17430595109950.text#}} - - cpu indicator: - - {{#17430595158080.text#}}' - selected: false - title: cpu analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430595248160' - position: - x: 3374 - y: 959.3628878418151 - positionAbsolute: - x: 3374 - y: 959.3628878418151 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.6 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: cd35fff4-a037-4e72-af99-2ff8299fc5d2 - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: 2b2ad468-efcd-4bcc-aeb9-d53d2f2770ad - role: user - text: '# Purpose - - Based on the Polaris Metrics data in each direction, - - Analyze whether the application {{#17430589567120.pod#}} - - is affected by the alert event {{#1742807803325.alertName#}}, and preliminarily - determine the root cause direction of the alert. - - # Note - - In the input data, the data in each direction includes the thread time - consumption data in that direction and the related data in that direction. - For example, the network time consumption will bring the network RTT indicator - of the application. - - # Analysis rules - - 1. First see which type of data has the largest change (the significant - increase is greater than other types, and the value change is the largest). - If there is a direct, give suggestions according to the specified direction - below. - - At the same time, combine the thread history P90 to analyze the changes - and confirm whether the data is in a reasonable range - - Note: P90 reflects the fluctuation within the maximum and minimum range. - Although the fluctuation may be large, in the long run, this fluctuation - is normal. When analyzing data, you need to find the real "mutation", - that is, abnormal and drastic changes that occur in a short period of - time. The definition of ‘mutation’ is: compared with the previous and - next data points, the fluctuation value has a significant jump in a very - short time (such as 1-2 time steps), and this jump is obviously beyond - the normal fluctuation mode (for example, the change amplitude is far - greater than the average change rate, or it is inconsistent with the trend). - Please ignore those regular fluctuations that are within the normal range - (within the P90 range) and only focus on abnormal mutations. - - If two types of change trends are found to be similar, the priority is - analyzed from high to low - - 2. The CPU time consumption of the application increases. It is recommended - that users check whether the code is too nested. After checking the problem, - rollback and repair can be performed - - 3. The application preempts the CPU. It is recommended that users log - in to the machine to check whether other applications are preempting - - 4. If net, epoll increases, it is also necessary to analyze whether the - application rtt is normal - - Note: Network RTT indicator (unit: seconds, if the value < 0.05, the network - is normal) - - If rtt increases abnormally, it is recommended that users check whether - there is a problem with the network; if rtt is normal, it is recommended - that users check downstream service problems! - - 5. File type increases. It is recommended that users check whether the - application has opened too many files - - - # Output format - - ## Application {{#17430589567120.pod#}} - - Summary of the trend of changes in the North Star indicator - - - List the changes in the North Star indicator and describe them in concise - language - - - If there is no significant change, clearly state: "No significant change - was observed." - - ## Preliminary root cause conclusion of the alarm event - - - Summarize whether the alarm affects the application, - - Combined with the North Star indicator and related indicator data of the - service, analyze the possible root causes - - At the same time, only one direction of advice can be given. It is recommended - to refer to the analysis rules - - Note: When the network direction is considered to have a problem, if the - RTT is normal, the description is changed to a downstream network problem - - # Input data - - - cpu direction data - - {{#17430595248160.text#}} - - cpu time consumption history P90 data - - {{#1743149089034.text#}} - - - net direction data - - {{#17430598979590.text#}} - - net time consumption history P90 data - - {{#17431493623970.text#}} - - - file direction data - - {{#17430598299820.text#}} - - file time consumption history P90 data - - {{#17431493591600.text#}} - - - epoll direction data - - {{#17430610680150.text#}} - - epoll time consumption historical P90 data - - {{#17431493655610.text#}} - - - runq direction data - - {{#17430610794990.text#}} - - runq time consumption historical P90 data - - {{#17431493682530.text#}} - - - # Notes - - - In P90 related data, json key is thread id, max, min corresponds to - the maximum and minimum P90 values ​​in the past hour - - - Use concise and clear language, avoid excessive accumulation of technical - terms, and ensure that the output is easy to understand.' - selected: false - title: llm analysis root cause - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430596469370' + height: 53 + id: '17430610756270' position: - x: 3678 - y: 1239 + x: 3060 + y: 996 positionAbsolute: - x: 3678 - y: 1239 + x: 3060 + y: 996 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' - isInIteration: true is_team_authorization: true - iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -5006,6 +5977,30 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + label: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) + max: null + min: null + name: type + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -5058,14 +6053,15 @@ workflow: endTime: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: thread time consumption on File (by Pod) + title: CPU P90 tool_configurations: {} - tool_label: 线程在文件操作上的耗时折线图(按Pod统计) - tool_name: 线程在文件操作上的耗时折线图(按Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable @@ -5080,69 +6076,45 @@ workflow: value: - '1741227526517' - startTime + type: + type: mixed + value: cpu type: tool - height: 54 - id: '17430597987060' + height: 53 + id: '1743149089034' position: - x: 2462 - y: 1109 + x: 3363 + y: 720 positionAbsolute: - x: 2462 - y: 1109 + x: 3363 + y: 720 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' - isInIteration: true is_team_authorization: true - iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null default: null form: llm human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name - max: null - min: null - name: cadvisor_job_name - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null - name: namespace + name: pod options: [] placeholder: null precision: null @@ -5154,19 +6126,19 @@ workflow: default: null form: llm human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) max: null min: null - name: pod + name: type options: [] placeholder: null precision: null @@ -5180,7 +6152,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -5223,32 +6195,24 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' - namespace: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: container read disk + title: file P90 tool_configurations: {} - tool_label: Container disk read time per second (Containerd runtime, aggregated - by container and Pod) - tool_name: 容器磁盘读取耗时每秒(使用Containerd,按Pod和容器统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: - cadvisor_job_name: - type: mixed - value: '' endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#17430589567120.namespace#}}' pod: type: mixed value: '{{#17430589567120.pod#}}' @@ -5257,95 +6221,26 @@ workflow: value: - '1741227526517' - startTime + type: + type: mixed + value: file type: tool - height: 54 - id: '17430598152780' - position: - x: 2766 - y: 1109 - positionAbsolute: - x: 2766 - y: 1109 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 2aacf14d-625b-435f-b564-d4882157fe1c - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: fd4d9226-6f01-4d5d-bb05-c0d1cb570ed5 - role: user - text: '# Purpose - - Summarize the following data to make it concise and easy to understand: - - 1. Application execution time data of all threads on file type - - 2. Application read disk indicator data - - - # Note - - 1. Output summary can include description of number of threads - - 2. Time consumption unit is nanosecond (ns), and the unit is retained - in the output - - 3. Make sure the description is concise and easy for users to understand - - - # Data - - File time consumption (unit: nanosecond, ns): - - {{#17430597987060.text#}} - - - Read disk indicator: - - {{#17430598152780.text#}}' - selected: false - title: file analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430598299820' + height: 53 + id: '17431493591600' position: - x: 3374 - y: 1091 + x: 3363 + y: 812 positionAbsolute: - x: 3374 - y: 1091 + x: 3363 + y: 812 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' - isInIteration: true is_team_authorization: true - iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -5372,6 +6267,30 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + label: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) + max: null + min: null + name: type + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -5424,14 +6343,15 @@ workflow: endTime: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: Thread time consumption on Net (by Pod) + title: net P90 tool_configurations: {} - tool_label: 线程在网络操作上的耗时折线图(按Pod统计) - tool_name: 线程在网络操作上的耗时折线图(按Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable @@ -5446,42 +6366,42 @@ workflow: value: - '1741227526517' - startTime + type: + type: mixed + value: net type: tool - height: 54 - id: '17430598907140' + height: 53 + id: '17431493623970' position: - x: 2462 - y: 1239 + x: 3363 + y: 904 positionAbsolute: - x: 2462 - y: 1239 + x: 3363 + y: 904 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' - isInIteration: true is_team_authorization: true - iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null default: null form: llm human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null name: pod @@ -5496,19 +6416,19 @@ workflow: default: null form: llm human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) max: null min: null - name: namespace + name: type options: [] placeholder: null precision: null @@ -5520,8 +6440,8 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -5529,7 +6449,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -5544,16 +6464,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -5566,26 +6486,23 @@ workflow: type: number params: endTime: '' - namespace: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: container rtt + title: epoll P90 tool_configurations: {} - tool_label: Query container rtt - tool_name: 查询容器网络与下游RTT + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#17430589567120.namespace#}}' pod: type: mixed value: '{{#17430589567120.pod#}}' @@ -5594,100 +6511,26 @@ workflow: value: - '1741227526517' - startTime + type: + type: mixed + value: epoll type: tool - height: 54 - id: '17430598942980' - position: - x: 2766 - y: 1239 - positionAbsolute: - x: 2766 - y: 1239 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 2fcf3791-e5a8-4c5b-9f9b-73753dedd9f7 - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: 95e534cf-6856-4d33-bd3e-680aa819a13b - role: user - text: '# Purpose - - Summarize the following data to make it concise and easy to understand: - - 1. Execution time data of all application threads on net type - - 2. Network RTT indicator data of application - - - # Note - - 1. The output summary can include a description of the number of threads, - and can also give the average time change of most threads - - 2. The time unit is nanoseconds (ns), and the unit is retained in the - output - - 3. The RTT indicator unit is seconds. If the value is less than 0.05 seconds, - you can add a note "Network is normal" - - 4. Make sure the description is concise and easy for users to understand - - - # Data - - Network time (unit: nanoseconds, ns): - - {{#17430598907140.text#}} - - - Network RTT indicator (unit: seconds, if the value < 0.05, the network - is normal): - - {{#17430598942980.text#}}' - selected: false - title: net analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430598979590' + height: 53 + id: '17431493655610' position: - x: 3374 - y: 1221 + x: 3363 + y: 1088 positionAbsolute: - x: 3374 - y: 1221 + x: 3363 + y: 1088 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' - isInIteration: true is_team_authorization: true - iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -5699,14 +6542,38 @@ workflow: pt_BR: Pod name zh_Hans: Pod名称 label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + label: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) max: null min: null - name: pod + name: type options: [] placeholder: null precision: null @@ -5766,14 +6633,15 @@ workflow: endTime: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: thread time consumption on Epoll (by Pod) + title: Runq P90 tool_configurations: {} - tool_label: 线程在Epoll操作上的耗时折线图(按Pod统计) - tool_name: 线程在Epoll操作上的耗时折线图(按Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable @@ -5788,21 +6656,23 @@ workflow: value: - '1741227526517' - startTime + type: + type: mixed + value: runq type: tool - height: 54 - id: '17430610599980' + height: 53 + id: '17431493682530' position: - x: 2462 - y: 1369 + x: 3363 + y: 996 positionAbsolute: - x: 2462 - y: 1369 + x: 3363 + y: 996 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' isInIteration: true @@ -5814,16 +6684,16 @@ workflow: default: null form: llm human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null name: pod @@ -5838,19 +6708,19 @@ workflow: default: null form: llm human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) max: null min: null - name: namespace + name: type options: [] placeholder: null precision: null @@ -5862,8 +6732,8 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -5871,7 +6741,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -5886,16 +6756,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -5908,121 +6778,49 @@ workflow: type: number params: endTime: '' - namespace: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: container rtt + title: CPU P90 analysis tool_configurations: {} - tool_label: Query container rtt - tool_name: 查询容器网络与下游RTT + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#17430589567120.namespace#}}' pod: type: mixed - value: '{{#17430589567120.pod#}}' + value: '{{#1741497181784.pod#}}' startTime: type: variable value: - '1741227526517' - startTime + type: + type: mixed + value: cpu type: tool - height: 54 - id: '17430610640640' - position: - x: 2766 - y: 1369 - positionAbsolute: - x: 2766 - y: 1369 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 1f3e7592-c8f0-455a-8abb-23c74aaf5fb8 - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: 9ed18fa7-b43f-4f11-ba13-2dcd03fc16c9 - role: user - text: '# Purpose - - Summarize the following data (asynchronous and network summary reports) - to make them concise and easy to understand: - - 1. Application execution time data of all threads on epoll type - - 2. Application network RTT indicator data - - # Note - - 1. The output summary can include a description of the number of threads, - and can also give the average time change of most threads - - 2. The time unit is nanoseconds (ns), and the unit is retained in the - output - - 3. The RTT indicator unit is seconds. If the value is less than 0.05 seconds, - you can add a note "Network is normal" - - 4. Make sure the description is concise and easy for users to understand - - - # Data - - epoll time (unit: nanoseconds, ns): - - {{#17430610599980.text#}} - - Network RTT indicator (unit: seconds, if the value < 0.05, the network - is normal): - - {{#17430610640640.text#}}' - selected: false - title: epoll analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430610680150' + height: 53 + id: '1743149606391' + parentId: '1741497176064' position: - x: 3374 - y: 1351 + x: 1174.8261261305506 + y: 378.0882500223738 positionAbsolute: - x: 3374 - y: 1351 + x: 6437.282403410635 + y: 1294.0882500223738 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -6055,6 +6853,30 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + label: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) + max: null + min: null + name: type + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -6107,14 +6929,15 @@ workflow: endTime: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: thread time consumption on Runq(by Pod) + title: Net P90 analysis tool_configurations: {} - tool_label: 线程在运行队列上的耗时折线图(按Pod统计) - tool_name: 线程在运行队列上的耗时折线图(按Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable @@ -6123,26 +6946,30 @@ workflow: - endTime pod: type: mixed - value: '{{#17430589567120.pod#}}' + value: '{{#1741497181784.pod#}}' startTime: type: variable value: - '1741227526517' - startTime + type: + type: mixed + value: net type: tool - height: 54 - id: '17430610719970' + height: 53 + id: '1743150910103' + parentId: '1741497176064' position: - x: 2462 - y: 1499 + x: 1483.3553424127522 + y: 574.6824876720586 positionAbsolute: - x: 2462 - y: 1499 + x: 6745.811619692837 + y: 1490.6824876720586 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -6155,23 +6982,23 @@ workflow: default: null form: llm human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null name: pod options: [] placeholder: null precision: null - required: true + required: false scope: null template: null type: string @@ -6179,23 +7006,23 @@ workflow: default: null form: llm human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) max: null min: null - name: namespace + name: type options: [] placeholder: null precision: null - required: true + required: false scope: null template: null type: string @@ -6203,8 +7030,8 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -6212,7 +7039,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -6227,16 +7054,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -6249,120 +7076,55 @@ workflow: type: number params: endTime: '' - namespace: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: Container cpu throttling + title: FILE P90 analysis tool_configurations: {} - tool_label: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) - tool_name: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable value: - - '1741227526517' - - endTime - namespace: - type: mixed - value: '{{#17430589567120.namespace#}}' + - '1741227526517' + - endTime pod: type: mixed - value: '{{#17430589567120.pod#}}' + value: '{{#1741497181784.pod#}}' startTime: type: variable value: - '1741227526517' - startTime + type: + type: mixed + value: file type: tool - height: 54 - id: '17430610756270' + height: 53 + id: '1743152043813' + parentId: '1741497176064' position: - x: 2766 - y: 1499 + x: 1156.6165679157248 + y: 475.1754672301147 positionAbsolute: - x: 2766 - y: 1499 + x: 6419.072845195809 + y: 1391.1754672301147 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: - context: - enabled: false - variable_selector: [] desc: '' isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: b4463776-4368-40e5-b3ea-28a179ebc11c - role: system - text: You are an intelligent assistant in the observability field, helping - users analyze problems - - id: 44df105c-0a0a-4147-ae4a-7e4bda7bb3af - role: user - text: '# Purpose - - Summarize the following data to make it concise and easy to understand: - - 1. Execution time data of all application threads on runq type - - 2. CPU Throttle Time indicator data of application - - - # Note - - 1. Output summary can bring description of number of threads - - 2. Time unit is nanosecond (ns), and the unit is retained in the output - - 3. Make sure the description is concise and easy for users to understand - - - # Data - - Runq time (unit: nanosecond, ns): - - {{#17430610719970.text#}} - - - CPU Throttle Time indicator: - - {{#17430610756270.text#}}' - selected: false - title: runq analysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430610794990' - position: - x: 3378.945497521249 - y: 1477.703001652501 - positionAbsolute: - x: 3378.945497521249 - y: 1477.703001652501 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - desc: '' is_team_authorization: true + iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -6470,7 +7232,7 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: CPU P90 + title: EPOLL P90 analysis tool_configurations: {} tool_label: Thread Polaris Metrics P90 tool_name: 线程北极星P90数据 @@ -6482,7 +7244,7 @@ workflow: - endTime pod: type: mixed - value: '{{#17430589567120.pod#}}' + value: '{{#1741497181784.pod#}}' startTime: type: variable value: @@ -6490,24 +7252,28 @@ workflow: - startTime type: type: mixed - value: cpu + value: epoll type: tool - height: 54 - id: '1743149089034' + height: 53 + id: '1743152103020' + parentId: '1741497176064' position: - x: 3070 - y: 979 + x: 1463.2885127206846 + y: 673.674875984598 positionAbsolute: - x: 3070 - y: 979 + x: 6725.744790000769 + y: 1589.674875984598 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 + zIndex: 1002 - data: desc: '' + isInIteration: true is_team_authorization: true + iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -6615,1222 +7381,2204 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: file P90 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#17430589567120.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: file - type: tool - height: 54 - id: '17431493591600' + title: RUNQ P90 analysis + tool_configurations: {} + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: + type: mixed + value: runq + type: tool + height: 53 + id: '1743152169252' + parentId: '1741497176064' + position: + x: 1141.3922062676138 + y: 805.1816882600981 + positionAbsolute: + x: 6403.848483547698 + y: 1721.181688260098 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430595109950' + - text + variable: data_json + - value_selector: + - '1743149089034' + - text + variable: avg_json + height: 53 + id: '1744185676164' + position: + x: 3666 + y: 720 + positionAbsolute: + x: 3666 + y: 720 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430597987060' + - text + variable: data_json + - value_selector: + - '17431493591600' + - text + variable: avg_json + height: 53 + id: '17441926182400' + position: + x: 3666 + y: 812 + positionAbsolute: + x: 3666 + y: 812 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430598907140' + - text + variable: data_json + - value_selector: + - '17431493623970' + - text + variable: avg_json + height: 53 + id: '17441926217060' + position: + x: 3666 + y: 904 + positionAbsolute: + x: 3666 + y: 904 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430610599980' + - text + variable: data_json + - value_selector: + - '17431493655610' + - text + variable: avg_json + height: 53 + id: '17441926243210' + position: + x: 3666 + y: 1088 + positionAbsolute: + x: 3666 + y: 1088 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430610719970' + - text + variable: data_json + - value_selector: + - '17431493682530' + - text + variable: avg_json + height: 53 + id: '17441926286390' + position: + x: 3666 + y: 996 + positionAbsolute: + x: 3666 + y: 996 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980720651' + - text + variable: data_json + - value_selector: + - '1743149606391' + - text + variable: avg_json + height: 53 + id: '1744206107700' + parentId: '1741497176064' + position: + x: 1488.8192785924111 + y: 373.13327676062727 + positionAbsolute: + x: 6751.275555872496 + y: 1289.1332767606273 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980748320' + - text + variable: data_json + - value_selector: + - '1743152043813' + - text + variable: avg_json + height: 53 + id: '1744206199211' + parentId: '1741497176064' + position: + x: 1487.2988857309501 + y: 474.870200391917 + positionAbsolute: + x: 6749.755163011035 + y: 1390.870200391917 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980780865' + - text + variable: data_json + - value_selector: + - '1743150910103' + - text + variable: avg_json + height: 53 + id: '1744206249528' + parentId: '1741497176064' position: - x: 3070 - y: 1109 + x: 1789.9724165332118 + y: 575.9896449249493 positionAbsolute: - x: 3070 - y: 1109 + x: 7052.428693813296 + y: 1491.9896449249493 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 + zIndex: 1002 - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 desc: '' - is_team_authorization: true - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string selected: false - title: net P90 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#17430589567120.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: net - type: tool - height: 54 - id: '17431493623970' + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980837261' + - text + variable: data_json + - value_selector: + - '1743152103020' + - text + variable: avg_json + height: 53 + id: '1744206286177' + parentId: '1741497176064' + position: + x: 1789.4007677668633 + y: 673.2187341513443 + positionAbsolute: + x: 7051.857045046948 + y: 1589.2187341513443 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980885557' + - text + variable: data_json + - value_selector: + - '1743152169252' + - text + variable: avg_json + height: 53 + id: '1744206314118' + parentId: '1741497176064' + position: + x: 1465.3401312758333 + y: 804.853363697991 + positionAbsolute: + x: 6727.796408555918 + y: 1720.853363697991 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str) -> dict:\n timeseries = json.loads(data_json).get('data',\ + \ {}).get('timeseries', [])\n \n normal = 0.05\n filtered =\ + \ []\n for metric in timeseries:\n pod = metric.get('labels',\ + \ {}).get('dst_pod', '')\n if len(pod) == 0:\n pod = metric.get('labels',\ + \ {}).get('pid', '')\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/normal > 1.2:\n count += 1\n\n if\ + \ count / len(chart) >= 0.2:\n res = {\n \"chart\"\ + : chart,\n \"abnormalCount\": count,\n \"\ + dst_pod\": pod,\n \"normal\": normal\n }\n \ + \ filtered.append(res)\n\n return {\n \"result\": json.dumps(filtered)\n\ + \ }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal rtt + type: code + variables: + - value_selector: + - '17430610640640' + - text + variable: data_json + height: 53 + id: '1744255998058' + position: + x: 3060 + y: 1088 + positionAbsolute: + x: 3060 + y: 1088 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str) -> dict:\n timeseries = json.loads(data_json).get('data',\ + \ {}).get('timeseries', [])\n \n normal = 0.05\n filtered =\ + \ []\n for metric in timeseries:\n pod = metric.get('labels',\ + \ {}).get('dst_pod', '')\n if len(pod) == 0:\n pod = metric.get('labels',\ + \ {}).get('pid', '')\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/normal > 1.2:\n count += 1\n\n if\ + \ count / len(chart) >= 0.2:\n res = {\n \"chart\"\ + : chart,\n \"abnormalCount\": count,\n \"\ + dst_pod\": pod,\n \"normal\": normal\n }\n \ + \ filtered.append(res)\n\n return {\n \"result\": json.dumps(filtered)\n\ + \ }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal rtt + type: code + variables: + - value_selector: + - '17430598942980' + - text + variable: data_json + height: 53 + id: '17442560822670' + position: + x: 3060 + y: 904 + positionAbsolute: + x: 3060 + y: 904 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='epoll')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n \n if type == 'net' or type == 'epoll':\n return\ + \ net_analyze(abnormal_data=abnormal_data, proof_data=proof_data)\n elif\ + \ type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in proof_data:\n dst_pod = data.get('dst_pod',\ + \ '')\n if dst_pod == '':\n continue\n\n related.append(dst_pod)\n\ + \ \n return {\n 'abnormalAnalysis': analysis,\n 'related':\ + \ related\n }\n\ndef runq_analyze(abnormal_data: list) -> dict:\n \ + \ analysis = get_analysis_data(abnormal_data=abnormal_data)\n\n return\ + \ {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n pods = analysis.get(\"related\", [])\n if\ + \ len(pods) > 0 :\n pods_str = \", \".join(pods)\n \ + \ item_str += f\"{pods_str}. The RTT raised about 20% than 0.05s over 20%\ + \ time samples. \"\n else:\n item_str = 'The RTT is normal.'\n\ + \ else:\n item_type = 'threads'\n\n threads = analysis.get(\"\ + related\", [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n if type == 'net' or type == 'epoll':\n\ + \ related_str = item_str\n else:\n related_str\ + \ = f\"The most related {item_type} are {item_str} \"\n \n return\ + \ f\"There are {len(analysis['abnormalAnalysis'])} abnormal threads. \"\ + \ + related_str\n " + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: EPOLL analyze + type: code + variables: + - value_selector: + - '17441926243210' + - result + variable: data_json + - value_selector: + - '1744255998058' + - result + variable: proof_json + height: 53 + id: '1744287265980' position: - x: 3070 - y: 1239 + x: 3969 + y: 1088 positionAbsolute: - x: 3070 - y: 1239 + x: 3969 + y: 1088 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - - data: + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'epoll')\n return {\"result\": markdown}" + code_language: python3 desc: '' - is_team_authorization: true - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: epoll P90 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#17430589567120.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: epoll - type: tool - height: 54 - id: '17431493655610' + title: to template epoll + type: code + variables: + - value_selector: + - '1744287265980' + - result + variable: data_json + height: 53 + id: '1744290470304' position: - x: 3070 - y: 1369 + x: 4272 + y: 1088 positionAbsolute: - x: 3070 - y: 1369 + x: 4272 + y: 1088 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - - data: + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='runq')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n related_str =\ + \ ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 desc: '' - is_team_authorization: true - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string + selected: false + title: RUNQ analyze + type: code + variables: + - value_selector: + - '17441926286390' + - result + variable: data_json + - value_selector: + - '17430610756270' + - text + variable: proof_json + height: 53 + id: '17443356883380' + position: + x: 3969 + y: 996 + positionAbsolute: + x: 3969 + y: 996 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='net')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n \n if type == 'net' or type == 'epoll':\n return\ + \ net_analyze(abnormal_data=abnormal_data, proof_data=proof_data)\n elif\ + \ type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in proof_data:\n dst_pod = data.get('dst_pod',\ + \ '')\n if dst_pod == '':\n continue\n\n related.append(dst_pod)\n\ + \ \n return {\n 'abnormalAnalysis': analysis,\n 'related':\ + \ related\n }\n\ndef runq_analyze(abnormal_data: list) -> dict:\n \ + \ analysis = get_analysis_data(abnormal_data=abnormal_data)\n\n return\ + \ {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n pods = analysis.get(\"related\", [])\n if\ + \ len(pods) > 0 :\n pods_str = \", \".join(pods)\n \ + \ item_str += f\"{pods_str}. The RTT raised about 20% than 0.05s over 20%\ + \ time samples. \"\n else:\n item_str = 'The RTT is normal.'\n\ + \ else:\n item_type = 'threads'\n\n threads = analysis.get(\"\ + related\", [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n if type == 'net' or type == 'epoll':\n\ + \ related_str = item_str\n else:\n related_str\ + \ = f\"The most related {item_type} are {item_str} \"\n \n return\ + \ f\"There are {len(analysis['abnormalAnalysis'])} abnormal threads. \"\ + \ + related_str\n " + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string selected: false - title: Runq P90 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#17430589567120.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: runq - type: tool - height: 54 - id: '17431493682530' + title: NET analyze + type: code + variables: + - value_selector: + - '17441926217060' + - result + variable: data_json + - value_selector: + - '17442560822670' + - result + variable: proof_json + height: 53 + id: '17443357536900' position: - x: 3070 - y: 1499 + x: 3969 + y: 904 positionAbsolute: - x: 3070 - y: 1499 + x: 3969 + y: 904 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - - data: + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='file')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 desc: '' - isInIteration: true - is_team_authorization: true - iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string + selected: false + title: DISK analyze + type: code + variables: + - value_selector: + - '17441926182400' + - result + variable: data_json + - value_selector: + - '17430598152780' + - text + variable: proof_json + height: 53 + id: '17443357893440' + position: + x: 3969 + y: 812 + positionAbsolute: + x: 3969 + y: 812 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='cpu')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: CPU analyze + type: code + variables: + - value_selector: + - '1744185676164' + - result + variable: data_json + - value_selector: + - '17430595158080' + - text + variable: proof_json + height: 53 + id: '17443357899060' + position: + x: 3969 + y: 720 + positionAbsolute: + x: 3969 + y: 720 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'file')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: to template file + type: code + variables: + - value_selector: + - '17443357893440' + - result + variable: data_json + height: 53 + id: '17443388421360' + position: + x: 4272 + y: 812 + positionAbsolute: + x: 4272 + y: 812 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'cpu')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: to template cpu + type: code + variables: + - value_selector: + - '17443357899060' + - result + variable: data_json + height: 53 + id: '17443388433580' + position: + x: 4272 + y: 720 + positionAbsolute: + x: 4272 + y: 720 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: to template net + type: code + variables: + - value_selector: + - '17443357536900' + - result + variable: data_json + height: 53 + id: '17443388438160' + position: + x: 4272 + y: 904 + positionAbsolute: + x: 4272 + y: 904 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'runq')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: to template runq + type: code + variables: + - value_selector: + - '17443356883380' + - result + variable: data_json + height: 53 + id: '17443388443000' + position: + x: 4272 + y: 996 + positionAbsolute: + x: 4272 + y: 996 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str) -> dict:\n timeseries = json.loads(data_json).get('data',\ + \ {}).get('timeseries', [])\n \n normal = 0.05\n filtered =\ + \ []\n for metric in timeseries:\n pod = metric.get('labels',\ + \ {}).get('dst_pod', '')\n if len(pod) == 0:\n pod = metric.get('labels',\ + \ {}).get('pid', '')\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/normal > 1.2:\n count += 1\n\n if\ + \ count / len(chart) >= 0.2:\n res = {\n \"chart\"\ + : chart,\n \"abnormalCount\": count,\n \"\ + dst_pod\": pod,\n \"normal\": normal\n }\n \ + \ filtered.append(res)\n\n return {\n \"result\": json.dumps(filtered)\n\ + \ }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string selected: false - title: CPU P90 analysis - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: cpu - type: tool - height: 54 - id: '1743149606391' + title: EPOLL ABNORMAL RTT + type: code + variables: + - value_selector: + - '1742798505742' + - text + variable: data_json + height: 53 + id: '1744342068305' parentId: '1741497176064' position: - x: 1184.215435237168 - y: 391.23328277163773 + x: 1163.2885127206846 + y: 673.674875984598 positionAbsolute: - x: 5470.215435237168 - y: 1295.2332827716377 + x: 6425.744790000769 + y: 1589.674875984598 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: + code: "def main(data_json: str) -> dict:\n timeseries = json.loads(data_json).get('data',\ + \ {}).get('timeseries', [])\n \n normal = 0.05\n filtered =\ + \ []\n for metric in timeseries:\n pod = metric.get('labels',\ + \ {}).get('dst_pod', '')\n if len(pod) == 0:\n pod = metric.get('labels',\ + \ {}).get('pid', '')\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/normal > 1.2:\n count += 1\n\n if\ + \ count / len(chart) >= 0.2:\n res = {\n \"chart\"\ + : chart,\n \"abnormalCount\": count,\n \"\ + dst_pod\": pod,\n \"normal\": normal\n }\n \ + \ filtered.append(res)\n\n return {\n \"result\": json.dumps(filtered)\n\ + \ }" + code_language: python3 desc: '' isInIteration: true - is_team_authorization: true iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: Net P90 analysis - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: net - type: tool - height: 54 - id: '1743150910103' + title: NET ABNORMAL RTT + type: code + variables: + - value_selector: + - '1742547917612' + - text + variable: data_json + height: 53 + id: '1744342138380' parentId: '1741497176064' position: x: 1183.3553424127522 y: 574.6824876720586 positionAbsolute: - x: 5469.355342412752 - y: 1478.6824876720586 + x: 6445.811619692837 + y: 1490.6824876720586 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='cpu')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. cpu analyze + type: code + variables: + - value_selector: + - '1744206107700' + - result + variable: data_json + - value_selector: + - '1742980228913' + - text + variable: proof_json + height: 53 + id: '1744342244843' + parentId: '1741497176064' + position: + x: 1791.8192785924111 + y: 371.13327676062727 + positionAbsolute: + x: 7054.275555872496 + y: 1287.1332767606273 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='file')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. file analyze + type: code + variables: + - value_selector: + - '1744206199211' + - result + variable: data_json + - value_selector: + - '1742980318484' + - text + variable: proof_json + height: 53 + id: '1744342309386' + parentId: '1741497176064' + position: + x: 1790.2988857309501 + y: 474.870200391917 + positionAbsolute: + x: 7052.755163011035 + y: 1390.870200391917 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='net')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n \n if type == 'net' or type == 'epoll':\n return\ + \ net_analyze(abnormal_data=abnormal_data, proof_data=proof_data)\n elif\ + \ type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in proof_data:\n dst_pod = data.get('dst_pod',\ + \ '')\n if dst_pod == '':\n continue\n\n related.append(dst_pod)\n\ + \ \n return {\n 'abnormalAnalysis': analysis,\n 'related':\ + \ related\n }\n\ndef runq_analyze(abnormal_data: list) -> dict:\n \ + \ analysis = get_analysis_data(abnormal_data=abnormal_data)\n\n return\ + \ {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n pods = analysis.get(\"related\", [])\n if\ + \ len(pods) > 0 :\n pods_str = \", \".join(pods)\n \ + \ item_str += f\"{pods_str}. The RTT raised about 20% than 0.05s over 20%\ + \ time samples. \"\n else:\n item_str = 'The RTT is normal.'\n\ + \ else:\n item_type = 'threads'\n\n threads = analysis.get(\"\ + related\", [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n if type == 'net' or type == 'epoll':\n\ + \ related_str = item_str\n else:\n related_str\ + \ = f\"The most related {item_type} are {item_str} \"\n \n return\ + \ f\"There are {len(analysis['abnormalAnalysis'])} abnormal threads. \"\ + \ + related_str\n " + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. net analyze + type: code + variables: + - value_selector: + - '1744206249528' + - result + variable: data_json + - value_selector: + - '1744342138380' + - result + variable: proof_json + height: 53 + id: '1744342372882' + parentId: '1741497176064' + position: + x: 2092.972416533212 + y: 575.9896449249493 + positionAbsolute: + x: 7355.428693813296 + y: 1491.9896449249493 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='epoll')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n \n if type == 'net' or type == 'epoll':\n return\ + \ net_analyze(abnormal_data=abnormal_data, proof_data=proof_data)\n elif\ + \ type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in proof_data:\n dst_pod = data.get('dst_pod',\ + \ '')\n if dst_pod == '':\n continue\n\n related.append(dst_pod)\n\ + \ \n return {\n 'abnormalAnalysis': analysis,\n 'related':\ + \ related\n }\n\ndef runq_analyze(abnormal_data: list) -> dict:\n \ + \ analysis = get_analysis_data(abnormal_data=abnormal_data)\n\n return\ + \ {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n pods = analysis.get(\"related\", [])\n if\ + \ len(pods) > 0 :\n pods_str = \", \".join(pods)\n \ + \ item_str += f\"{pods_str}. The RTT raised about 20% than 0.05s over 20%\ + \ time samples. \"\n else:\n item_str = 'The RTT is normal.'\n\ + \ else:\n item_type = 'threads'\n\n threads = analysis.get(\"\ + related\", [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n if type == 'net' or type == 'epoll':\n\ + \ related_str = item_str\n else:\n related_str\ + \ = f\"The most related {item_type} are {item_str} \"\n \n return\ + \ f\"There are {len(analysis['abnormalAnalysis'])} abnormal threads. \"\ + \ + related_str\n " + code_language: python3 desc: '' isInIteration: true - is_team_authorization: true iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: FILE P90 analysis - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: file - type: tool - height: 54 - id: '1743152043813' + title: it. epoll analyze + type: code + variables: + - value_selector: + - '1744206286177' + - result + variable: data_json + - value_selector: + - '1744342068305' + - result + variable: proof_json + height: 53 + id: '1744342426374' parentId: '1741497176064' position: - x: 1156.6165679157248 - y: 475.1754672301147 + x: 2092.4007677668633 + y: 673.2187341513443 positionAbsolute: - x: 5442.616567915725 - y: 1379.1754672301147 - selected: false + x: 7354.857045046948 + y: 1589.2187341513443 + selected: true sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='cpu')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 desc: '' isInIteration: true - is_team_authorization: true iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: EPOLL P90 analysis - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: epoll - type: tool - height: 54 - id: '1743152103020' + title: it. runq analyze + type: code + variables: + - value_selector: + - '1744206314118' + - result + variable: data_json + - value_selector: + - '17430610756270' + - text + variable: proof_json + height: 53 + id: '1744342478278' parentId: '1741497176064' position: - x: 1180.802273988861 - y: 721.6803898302928 + x: 1768.3401312758333 + y: 804.853363697991 positionAbsolute: - x: 5466.802273988861 - y: 1625.6803898302928 + x: 7030.796408555918 + y: 1720.853363697991 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'runq')\n return {\"result\": markdown}" + code_language: python3 desc: '' isInIteration: true - is_team_authorization: true iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: RUNQ P90 analysis - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: runq - type: tool - height: 54 - id: '1743152169252' + title: it. to template runq + type: code + variables: + - value_selector: + - '1744342478278' + - result + variable: data_json + height: 53 + id: '1744342609856' + parentId: '1741497176064' + position: + x: 2071.3401312758333 + y: 804.853363697991 + positionAbsolute: + x: 7333.796408555918 + y: 1720.853363697991 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. to template epoll + type: code + variables: + - value_selector: + - '1744342426374' + - result + variable: data_json + height: 53 + id: '1744342800777' + parentId: '1741497176064' + position: + x: 2396.2516631873705 + y: 671.1408594726702 + positionAbsolute: + x: 7658.707940467455 + y: 1587.1408594726702 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. to template net + type: code + variables: + - value_selector: + - '1744342372882' + - result + variable: data_json + height: 53 + id: '1744342846753' + parentId: '1741497176064' + position: + x: 2397.0575190597137 + y: 576.2913937324586 + positionAbsolute: + x: 7659.513796339798 + y: 1492.2913937324586 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. to template file + type: code + variables: + - value_selector: + - '1744342309386' + - result + variable: data_json + height: 53 + id: '1744342890395' + parentId: '1741497176064' + position: + x: 2298.297497136483 + y: 475.73311174167225 + positionAbsolute: + x: 7560.7537744165675 + y: 1391.7331117416722 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. to template cpu + type: code + variables: + - value_selector: + - '1744342244843' + - result + variable: data_json + height: 53 + id: '1744342920172' parentId: '1741497176064' position: - x: 1185.1766094380573 - y: 848.576845109292 + x: 2291.073286368818 + y: 355.5973351437458 positionAbsolute: - x: 5471.176609438057 - y: 1752.576845109292 + x: 7553.529563648903 + y: 1271.5973351437458 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 viewport: - x: -1030.9368931273648 - y: 30.939897838551644 - zoom: 0.25 + x: -1671.1109248685862 + y: -226.66015559610764 + zoom: 0.3298769776932242 diff --git a/api/init_data/workflows/zh/告警简单根因分析.yml b/api/init_data/workflows/zh/告警简单根因分析.yml index a0196ca4c4..78340f9e9f 100644 --- a/api/init_data/workflows/zh/告警简单根因分析.yml +++ b/api/init_data/workflows/zh/告警简单根因分析.yml @@ -287,6 +287,7 @@ workflow: sourceType: code targetType: question-classifier id: 1741497181784-source-1742461755094-target + selected: false source: '1741497181784' sourceHandle: source target: '1742461755094' @@ -299,6 +300,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980720651-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980720651' @@ -311,6 +313,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980748320-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980748320' @@ -323,6 +326,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980780865-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980780865' @@ -335,6 +339,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980837261-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980837261' @@ -347,6 +352,7 @@ workflow: sourceType: question-classifier targetType: tool id: 1742461755094-1742464231696-1742980885557-target + selected: false source: '1742461755094' sourceHandle: '1742464231696' target: '1742980885557' @@ -359,6 +365,7 @@ workflow: sourceType: tool targetType: tool id: 1742980720651-source-1742980228913-target + selected: false source: '1742980720651' sourceHandle: source target: '1742980228913' @@ -371,6 +378,7 @@ workflow: sourceType: tool targetType: tool id: 1742980748320-source-1742980318484-target + selected: false source: '1742980748320' sourceHandle: source target: '1742980318484' @@ -383,6 +391,7 @@ workflow: sourceType: tool targetType: tool id: 1742980780865-source-1742547917612-target + selected: false source: '1742980780865' sourceHandle: source target: '1742547917612' @@ -395,6 +404,7 @@ workflow: sourceType: tool targetType: tool id: 1742980837261-source-1742798505742-target + selected: false source: '1742980837261' sourceHandle: source target: '1742798505742' @@ -407,100 +417,32 @@ workflow: sourceType: tool targetType: tool id: 1742980885557-source-1741502699500-target + selected: false source: '1742980885557' sourceHandle: source target: '1741502699500' targetHandle: target type: custom zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742980933811-source-1741506766037-target - source: '1742980933811' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742981271838-source-1741506766037-target - source: '1742981271838' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742981275937-source-1741506766037-target - source: '1742981275937' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742981278010-source-1741506766037-target - source: '1742981278010' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - - data: - isInIteration: true - iteration_id: '1741497176064' - sourceType: llm - targetType: llm - id: 1742981280434-source-1741506766037-target - source: '1742981280434' - sourceHandle: source - target: '1741506766037' - targetHandle: target - type: custom - zIndex: 1002 - data: isInIteration: false sourceType: code targetType: code id: 1741509454645-source-17430589567120-target + selected: false source: '1741509454645' sourceHandle: source target: '17430589567120' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: code - targetType: question-classifier - id: 17430589567120-source-17430590082510-target - source: '17430589567120' - sourceHandle: source - target: '17430590082510' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: true iteration_id: '1741497176064' sourceType: question-classifier targetType: tool id: 1742461755094-1742462167200-1743059090157-target + selected: false source: '1742461755094' sourceHandle: '1742462167200' target: '1743059090157' @@ -513,6 +455,7 @@ workflow: sourceType: tool targetType: llm id: 1743059090157-source-1742468584059-target + selected: false source: '1743059090157' sourceHandle: source target: '1742468584059' @@ -524,6 +467,7 @@ workflow: sourceType: question-classifier targetType: tool id: 17430590082510-1742462167200-17430593614550-target + selected: false source: '17430590082510' sourceHandle: '1742462167200' target: '17430593614550' @@ -535,6 +479,7 @@ workflow: sourceType: tool targetType: llm id: 17430593614550-source-17430593816310-target + selected: false source: '17430593614550' sourceHandle: source target: '17430593816310' @@ -546,6 +491,7 @@ workflow: sourceType: llm targetType: variable-aggregator id: 17430593816310-source-17430594012660-target + selected: false source: '17430593816310' sourceHandle: source target: '17430594012660' @@ -557,171 +503,79 @@ workflow: sourceType: question-classifier targetType: llm id: 17430590082510-1742463856746-17430594510140-target + selected: false source: '17430590082510' sourceHandle: '1742463856746' target: '17430594510140' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: variable-aggregator - id: 17430594510140-source-17430594012660-target - source: '17430594510140' - sourceHandle: source - target: '17430594012660' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: variable-aggregator targetType: iteration id: 17430594012660-source-1741497176064-target + selected: false source: '17430594012660' sourceHandle: source target: '1741497176064' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: question-classifier - targetType: tool - id: 17430590082510-1742464231696-17430595109950-target - source: '17430590082510' - sourceHandle: '1742464231696' - target: '17430595109950' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: tool targetType: tool id: 17430595109950-source-17430595158080-target + selected: false source: '17430595109950' sourceHandle: source target: '17430595158080' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430595248160-source-17430596469370-target - source: '17430595248160' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: llm targetType: variable-aggregator id: 17430596469370-source-17430594012660-target + selected: false source: '17430596469370' sourceHandle: source target: '17430594012660' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: question-classifier - targetType: tool - id: 17430590082510-1742464231696-17430597987060-target - source: '17430590082510' - sourceHandle: '1742464231696' - target: '17430597987060' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: tool targetType: tool id: 17430597987060-source-17430598152780-target + selected: false source: '17430597987060' sourceHandle: source target: '17430598152780' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430598299820-source-17430596469370-target - source: '17430598299820' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: tool targetType: tool id: 17430598907140-source-17430598942980-target + selected: false source: '17430598907140' sourceHandle: source target: '17430598942980' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430598979590-source-17430596469370-target - source: '17430598979590' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - - data: - isInIteration: false - sourceType: question-classifier - targetType: tool - id: 17430590082510-1742464231696-17430598907140-target - source: '17430590082510' - sourceHandle: '1742464231696' - target: '17430598907140' - targetHandle: target - type: custom - zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430610680150-source-17430596469370-target - source: '17430610680150' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - - data: - isInIteration: false - sourceType: llm - targetType: llm - id: 17430610794990-source-17430596469370-target - source: '17430610794990' - sourceHandle: source - target: '17430596469370' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: question-classifier targetType: tool id: 17430590082510-1742464231696-17430610599980-target + selected: false source: '17430590082510' sourceHandle: '1742464231696' target: '17430610599980' @@ -733,28 +587,19 @@ workflow: sourceType: tool targetType: tool id: 17430610599980-source-17430610640640-target + selected: false source: '17430610599980' sourceHandle: source target: '17430610640640' targetHandle: target type: custom zIndex: 0 - - data: - isInIteration: false - sourceType: question-classifier - targetType: tool - id: 17430590082510-1742464231696-17430610719970-target - source: '17430590082510' - sourceHandle: '1742464231696' - target: '17430610719970' - targetHandle: target - type: custom - zIndex: 0 - data: isInIteration: false sourceType: tool targetType: tool id: 17430610719970-source-17430610756270-target + selected: false source: '17430610719970' sourceHandle: source target: '17430610756270' @@ -766,6 +611,7 @@ workflow: sourceType: tool targetType: tool id: 17430595158080-source-1743149089034-target + selected: false source: '17430595158080' sourceHandle: source target: '1743149089034' @@ -775,11 +621,12 @@ workflow: - data: isInIteration: false sourceType: tool - targetType: llm - id: 1743149089034-source-17430595248160-target - source: '1743149089034' + targetType: tool + id: 17430610756270-source-17431493682530-target + selected: false + source: '17430610756270' sourceHandle: source - target: '17430595248160' + target: '17431493682530' targetHandle: target type: custom zIndex: 0 @@ -787,135 +634,147 @@ workflow: isInIteration: false sourceType: tool targetType: tool - id: 17430610756270-source-17431493682530-target - source: '17430610756270' + id: 17430598152780-source-17431493591600-target + selected: false + source: '17430598152780' sourceHandle: source - target: '17431493682530' + target: '17431493591600' targetHandle: target type: custom zIndex: 0 - data: - isInIteration: false + isInIteration: true + iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 17431493682530-source-17430610794990-target - source: '17431493682530' + targetType: tool + id: 1742980228913-source-1743149606391-target + selected: false + source: '1742980228913' sourceHandle: source - target: '17430610794990' + target: '1743149606391' targetHandle: target type: custom - zIndex: 0 + zIndex: 1002 - data: - isInIteration: false + isInIteration: true + iteration_id: '1741497176064' sourceType: tool targetType: tool - id: 17430610640640-source-17431493655610-target - source: '17430610640640' + id: 1742980318484-source-1743152043813-target + selected: false + source: '1742980318484' sourceHandle: source - target: '17431493655610' + target: '1743152043813' targetHandle: target type: custom - zIndex: 0 + zIndex: 1002 - data: - isInIteration: false + isInIteration: true + iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 17431493655610-source-17430610680150-target - source: '17431493655610' + targetType: tool + id: 1741502699500-source-1743152169252-target + selected: false + source: '1741502699500' sourceHandle: source - target: '17430610680150' + target: '1743152169252' targetHandle: target type: custom - zIndex: 0 + zIndex: 1002 - data: isInIteration: false - sourceType: tool - targetType: tool - id: 17430598942980-source-17431493623970-target - source: '17430598942980' + sourceType: code + targetType: question-classifier + id: 17430589567120-source-17430590082510-target + selected: false + source: '17430589567120' sourceHandle: source - target: '17431493623970' + target: '17430590082510' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false - sourceType: tool - targetType: llm - id: 17431493623970-source-17430598979590-target - source: '17431493623970' + sourceType: llm + targetType: variable-aggregator + id: 17430594510140-source-17430594012660-target + selected: false + source: '17430594510140' sourceHandle: source - target: '17430598979590' + target: '17430594012660' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false sourceType: tool - targetType: tool - id: 17430598152780-source-17431493591600-target - source: '17430598152780' + targetType: code + id: 1743149089034-source-1744185676164-target + selected: false + source: '1743149089034' sourceHandle: source - target: '17431493591600' + target: '1744185676164' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false sourceType: tool - targetType: llm - id: 17431493591600-source-17430598299820-target + targetType: code + id: 17431493591600-source-17441926182400-target + selected: false source: '17431493591600' sourceHandle: source - target: '17430598299820' + target: '17441926182400' targetHandle: target type: custom zIndex: 0 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool - targetType: tool - id: 1742980228913-source-1743149606391-target - source: '1742980228913' + targetType: code + id: 17431493623970-source-17441926217060-target + selected: false + source: '17431493623970' sourceHandle: source - target: '1743149606391' + target: '17441926217060' targetHandle: target type: custom - zIndex: 1002 + zIndex: 0 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool - targetType: llm - id: 1743149606391-source-1742980933811-target - source: '1743149606391' + targetType: code + id: 17431493655610-source-17441926243210-target + selected: false + source: '17431493655610' sourceHandle: source - target: '1742980933811' + target: '17441926243210' targetHandle: target type: custom - zIndex: 1002 + zIndex: 0 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool - targetType: tool - id: 1742547917612-source-1743150910103-target - source: '1742547917612' + targetType: code + id: 17431493682530-source-17441926286390-target + selected: false + source: '17431493682530' sourceHandle: source - target: '1743150910103' + target: '17441926286390' targetHandle: target type: custom - zIndex: 1002 + zIndex: 0 - data: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 1743150910103-source-1742981275937-target - source: '1743150910103' + targetType: code + id: 1743149606391-source-1744206107700-target + selected: false + source: '1743149606391' sourceHandle: source - target: '1742981275937' + target: '1744206107700' targetHandle: target type: custom zIndex: 1002 @@ -923,11 +782,12 @@ workflow: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: tool - id: 1742980318484-source-1743152043813-target - source: '1742980318484' + targetType: code + id: 1743152043813-source-1744206199211-target + selected: false + source: '1743152043813' sourceHandle: source - target: '1743152043813' + target: '1744206199211' targetHandle: target type: custom zIndex: 1002 @@ -935,11 +795,12 @@ workflow: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 1743152043813-source-1742981271838-target - source: '1743152043813' + targetType: code + id: 1743150910103-source-1744206249528-target + selected: false + source: '1743150910103' sourceHandle: source - target: '1742981271838' + target: '1744206249528' targetHandle: target type: custom zIndex: 1002 @@ -947,11 +808,12 @@ workflow: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: tool - id: 1742798505742-source-1743152103020-target - source: '1742798505742' + targetType: code + id: 1743152103020-source-1744206286177-target + selected: false + source: '1743152103020' sourceHandle: source - target: '1743152103020' + target: '1744206286177' targetHandle: target type: custom zIndex: 1002 @@ -959,1008 +821,2315 @@ workflow: isInIteration: true iteration_id: '1741497176064' sourceType: tool - targetType: llm - id: 1743152103020-source-1742981278010-target - source: '1743152103020' + targetType: code + id: 1743152169252-source-1744206314118-target + selected: false + source: '1743152169252' sourceHandle: source - target: '1742981278010' + target: '1744206314118' targetHandle: target type: custom zIndex: 1002 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool + targetType: code + id: 17430610640640-source-1744255998058-target + selected: false + source: '17430610640640' + sourceHandle: source + target: '1744255998058' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code targetType: tool - id: 1741502699500-source-1743152169252-target - source: '1741502699500' + id: 1744255998058-source-17431493655610-target + selected: false + source: '1744255998058' sourceHandle: source - target: '1743152169252' + target: '17431493655610' targetHandle: target type: custom - zIndex: 1002 + zIndex: 0 - data: - isInIteration: true - iteration_id: '1741497176064' + isInIteration: false sourceType: tool - targetType: llm - id: 1743152169252-source-1742981280434-target - source: '1743152169252' + targetType: code + id: 17430598942980-source-17442560822670-target + selected: false + source: '17430598942980' sourceHandle: source - target: '1742981280434' + target: '17442560822670' targetHandle: target type: custom - zIndex: 1002 - nodes: + zIndex: 0 - data: - desc: '' - selected: false - title: start - type: start - variables: - - label: startTime - max_length: 48 - options: [] - required: true - type: number - variable: startTime - - label: endTime - max_length: 48 - options: [] - required: true - type: number - variable: endTime - - label: params - max_length: 9999999 - options: [] - required: false - type: paragraph - variable: params - - label: nodeName - max_length: 256 - options: [] - required: false - type: text-input - variable: nodeName - - label: nodeIp - max_length: 48 - options: [] - required: false - type: text-input - variable: nodeIp - height: 194 - id: '1741227526517' - position: - x: 30 - y: 586 - positionAbsolute: - x: 30 - y: 586 + isInIteration: false + sourceType: code + targetType: tool + id: 17442560822670-source-17431493623970-target selected: false - sourcePosition: right - targetPosition: left + source: '17442560822670' + sourceHandle: source + target: '17431493623970' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - desc: '' - error_handle_mode: terminated - height: 1408 - is_parallel: false - iterator_selector: - - '1741509454645' - - monitor - output_selector: - - '1742470455066' - - output - output_type: array[string] - parallel_nums: 10 - selected: false - start_node_id: 1741497176064start - title: 迭代分析 - type: iteration - width: 3603.817693995864 - height: 1408 - id: '1741497176064' - position: - x: 4286 - y: 904 - positionAbsolute: - x: 4286 - y: 904 + isInIteration: false + sourceType: code + targetType: code + id: 17441926243210-source-1744287265980-target selected: false - sourcePosition: right - targetPosition: left + source: '17441926243210' + sourceHandle: source + target: '1744287265980' + targetHandle: target type: custom - width: 3604 - zIndex: 1 + zIndex: 0 - data: - desc: '' - isInIteration: true - selected: false - title: '' - type: iteration-start - draggable: false - height: 48 - id: 1741497176064start - parentId: '1741497176064' - position: - x: 24 - y: 68 - positionAbsolute: - x: 4310 - y: 972 - selectable: false + isInIteration: false + sourceType: code + targetType: code + id: 1744287265980-source-1744290470304-target selected: false - sourcePosition: right - targetPosition: left - type: custom-iteration-start - width: 44 - zIndex: 1002 + source: '1744287265980' + sourceHandle: source + target: '1744290470304' + targetHandle: target + type: custom + zIndex: 0 - data: - code: "\ndef main(arg1: str) -> dict:\n data = json.loads(arg1)\n return\ - \ {\n \"pod\": data.get(\"pod\", \"\"),\n \"namespace\": data.get(\"\ - namespace\", \"\")\n }\n" - code_language: python3 - desc: '' - isInIteration: true - iteration_id: '1741497176064' - outputs: - namespace: - children: null - type: string - pod: - children: null - type: string - selected: false - title: get instance info - type: code - variables: - - value_selector: - - '1741497176064' - - item - variable: arg1 - height: 54 - id: '1741497181784' - parentId: '1741497176064' - position: - x: 247.70722025930104 - y: 65 - positionAbsolute: - x: 4533.707220259301 - y: 969 + isInIteration: false + sourceType: question-classifier + targetType: tool + id: 17430590082510-1742464231696-17430595109950-target selected: false - sourcePosition: right - targetPosition: left + source: '17430590082510' + sourceHandle: '1742464231696' + target: '17430595109950' + targetHandle: target type: custom - width: 244 - zIndex: 1002 + zIndex: 0 - data: - desc: '' - isInIteration: true - is_team_authorization: true - iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 - label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace - label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace - max: null - min: null - name: namespace - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time - ja_JP: Data query start time - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query start time - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - namespace: '' - pod: '' - startTime: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin - selected: false - title: Container CPU throttling duration (when using Containerd container - runtime, statistics by container and Pod) - tool_configurations: {} - tool_label: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) - tool_name: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: tool - height: 54 - id: '1741502699500' - parentId: '1741497176064' - position: - x: 844.0068118865438 - y: 800.2561082923241 - positionAbsolute: - x: 5130.006811886544 - y: 1704.2561082923241 + isInIteration: false + sourceType: question-classifier + targetType: tool + id: 17430590082510-1742464231696-17430597987060-target selected: false - sourcePosition: right - targetPosition: left + source: '17430590082510' + sourceHandle: '1742464231696' + target: '17430597987060' + targetHandle: target type: custom - width: 244 - zIndex: 1002 + zIndex: 0 - data: - desc: '' - outputs: - - value_selector: - - '1741512806512' - - text - variable: text - - value_selector: [] - variable: '' - selected: false - title: 结束 - type: end - height: 90 - id: '1741502839759' - position: - x: 8254 - y: 904 - positionAbsolute: - x: 8254 - y: 904 + isInIteration: false + sourceType: question-classifier + targetType: tool + id: 17430590082510-1742464231696-17430598907140-target selected: false - sourcePosition: right - targetPosition: left + source: '17430590082510' + sourceHandle: '1742464231696' + target: '17430598907140' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.6 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: cd35fff4-a037-4e72-af99-2ff8299fc5d2 - role: system - text: 你是一个可观性领域的智能助手,帮助用户分析问题 - - id: 2b2ad468-efcd-4bcc-aeb9-d53d2f2770ad - role: user - text: "# 目的\n根据各方向上的北极星指标数据\n分析应用 {{#1741497181784.pod#}} \n是否受到告警事件 {{#1742807803325.alertName#}}的影响,并初步判断告警的根因方向。\n\ - # 输入数据说明\n\n各方向数据包含线程耗时及相关指标,例如:网络耗时会附带应用程序的网络 RTT 指标。\n# 分析规则\n识别主要变化方向\n\ - 找出变化最大的数据类型(显著升高且幅度远超其他类型)。\n如果 CPU 或 runQ 耗时显著升高(且 net、epoll 无明显变化),则定位为\ - \ CPU 方向问题,避免误判为网络问题。\n结合线程历史 P90 数据,判断变化是否超出合理区间。\nP90 定义:反映最大最小范围内的正常波动。需关注短时间内(1-2\ - \ 个时间步)的异常突变(显著跳跃,超出平均变化率或趋势),忽略 P90 范围内的常规波动。\n若多种类型变化趋势接近,按以下优先级分析(从高到低)。\n\ - 根因方向及建议\nCPU 耗时升高:建议检查代码是否存在过多嵌套,确认问题后可回滚修复。\nCPU 抢占高:建议登录机器,检查是否有其他应用程序抢占资源。\n\ - Net 或 epoll 耗时显著升高:\n检查网络 RTT(单位:秒,< 0.05 为正常)。\nRTT 异常:建议排查网络问题;RTT 正常:建议检查下游服务。\n\ - File 耗时升高:建议检查应用程序是否打开过多文件。\n# 输出格式 \n## 应用 {{#1741497181784.pod#}} \n\ - 北极星指标变化趋势的总结\n - 列出北极星指标 的变化情况,用简洁语言描述\n- 如果无显著变化,明确说明:“未观察到明显变化”。\n##\ - \ 告警事件初步根因结论 \n- 总结告警 是否影响应用,\n结合服务的北极星指标和相关指标数据,分析可能的根因\n同时只能给一个方向的建议。\n\ - 注:认为网络方向有问题时,如果RTT正常,则描述修改为是下游方向网络问题\n# 输入数据 \n- cpu方向数据\n{{#1742980933811.text#}}\n\ - 历史CPU耗时P90\n{{#1743149606391.text#}}\n- net 方向数据\n{{#1742981275937.text#}}\n\ - 历史Net耗时P90\n{{#1743150910103.text#}}\n- file 方向数据\n{{#1742981271838.text#}}\n\ - 历史file 耗时 P90\n{{#1743152043813.text#}}\n- epoll方向数据\n{{#1742981278010.text#}}\n\ - 历史epoll耗时P90\n{{#1743152103020.text#}}\n- runq方向数据\n{{#1742981280434.text#}}\n\ - 历史runq耗时P90\n{{#1743152169252.text#}}\n\n# 注意事项\nP90 数据中,JSON 键包括线程 ID,max\ - \ 和 min 表示过去 1 小时的最大最小 P90 值。\n输出语言需简洁清晰,避免过多技术术语,确保易读。" - selected: true - title: llm analysis root cause - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1741506766037' - parentId: '1741497176064' - position: - x: 2472.850022241196 - y: 495.6222275962382 - positionAbsolute: - x: 6758.850022241196 - y: 1399.6222275962382 - selected: true - sourcePosition: right - targetPosition: left + isInIteration: false + sourceType: question-classifier + targetType: tool + id: 17430590082510-1742464231696-17430610719970-target + selected: false + source: '17430590082510' + sourceHandle: '1742464231696' + target: '17430610719970' + targetHandle: target type: custom - width: 244 - zIndex: 1002 + zIndex: 0 - data: - code: "import json\n\ndef main(arg: str) -> dict:\n data = json.loads(arg)\n\ - \ timeseries = data[\"data\"][\"timeseries\"]\n \n seen = set()\n\ - \ pod_info = []\n first_pod = None\n \n for item in timeseries:\n\ - \ labels = item[\"labels\"]\n namespace = labels.get(\"namespace\"\ - , \"\")\n pod = labels.get(\"pod\", \"\")\n \n unique_key\ - \ = (namespace, pod)\n \n if unique_key not in seen:\n \ - \ seen.add(unique_key)\n info = {\n \"\ - namespace\": namespace,\n \"pod\": pod\n }\n \ - \ if first_pod is None:\n first_pod = json.dumps(info)\n\ - \ else:\n pod_info.append(json.dumps(info))\n \ - \ \n return {\n \"first\": first_pod,\n \"monitor\"\ - : pod_info,\n }" - code_language: python3 - desc: '' - outputs: - first: - children: null - type: string - monitor: - children: null - type: array[string] - selected: false - title: 遍历 - type: code - variables: - - value_selector: - - '1741597274153' - - output - variable: arg - height: 54 - id: '1741509454645' - position: - x: 1550 - y: 774 - positionAbsolute: - x: 1550 - y: 774 + isInIteration: false + sourceType: code + targetType: code + id: 17441926286390-source-17443356883380-target selected: false - sourcePosition: right - targetPosition: left + source: '17441926286390' + sourceHandle: source + target: '17443356883380' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - context: - enabled: false - variable_selector: [] - desc: '' - model: - completion_params: - temperature: 0.6 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 169877de-aa4a-44db-90ef-2cc8f68882c4 - role: system - text: You are an intelligent assistant in the field of observability - - id: c9d29276-dfa5-4042-b1c6-562260f9cc7c - role: user - text: "# 目的 \n将结论数据中关于Pod的情况按服务级别汇总,输出服务级别概览。 \n每个Pod的具体情况需清晰易懂,便于理解。 \n\ - 移除关于futex相关的建议。 \n# 注意 \n1. 在结论中,若CPU相关问题的影响更为显著(结合告警事件),建议用户优先解决CPU问题。\ - \ \n2. 优化输出格式,确保服务级别汇总和Pod详情层次分明、易于阅读。 \n4. 北极星指标(如CPU、epoll、net、other/runq)的名词不得更改。\n\ - 5. 结论输出时,只和某一个方向有关即可,不要联想到其他问题(如GC和锁)\n6. 如果net耗时增加,但是RTT正常,则建议用户排查下游问题\n\ - # 结论数据\n{{#17430594012660.output#}}\n{{#1741497176064.output#}}\n" - selected: false - title: 汇总数据 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1741512806512' - position: - x: 7950 - y: 904 - positionAbsolute: - x: 7950 - y: 904 + isInIteration: false + sourceType: code + targetType: code + id: 17441926217060-source-17443357536900-target selected: false - sourcePosition: right - targetPosition: left + source: '17441926217060' + sourceHandle: source + target: '17443357536900' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - desc: '' - selected: false - template: 无关联的pod信息,且服务和节点信息均为空,信息不足暂时无法分析根因。 - title: unsupport alert - type: template-transform - variables: [] - height: 54 - id: '1741592094819' - position: - x: 942 - y: 586 - positionAbsolute: - x: 942 - y: 586 + isInIteration: false + sourceType: code + targetType: code + id: 17441926182400-source-17443357893440-target selected: false - sourcePosition: right - targetPosition: left + source: '17441926182400' + sourceHandle: source + target: '17443357893440' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - desc: '' - outputs: - - value_selector: - - '1741592094819' - - output - variable: output - selected: false - title: 结束 - type: end - height: 90 - id: '1741592144815' - position: - x: 1246 - y: 586 - positionAbsolute: - x: 1246 - y: 586 + isInIteration: false + sourceType: code + targetType: code + id: 1744185676164-source-17443357899060-target selected: false - sourcePosition: right - targetPosition: left + source: '1744185676164' + sourceHandle: source + target: '17443357899060' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - desc: '' - is_team_authorization: true - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Specified service name - ja_JP: Specified service name - pt_BR: Specified service name - zh_Hans: 指定的服务名 - label: - en_US: service_name - ja_JP: service_name - pt_BR: service_name - zh_Hans: service_name - llm_description: Specified service name - max: null - min: null - name: service_name - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time - ja_JP: Data query start time - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query start time - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - service_name: '' - startTime: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin - selected: false - title: 查询服务对应POD实例 - tool_configurations: {} - tool_label: 列出该服务下的所有实例 - tool_name: originx_service_instance - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - service_name: - type: mixed - value: '{{#1742807803325.service#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: tool - height: 54 - id: '1741597223833' - position: - x: 942 - y: 680 - positionAbsolute: - x: 942 - y: 680 + isInIteration: false + sourceType: code + targetType: code + id: 17443357899060-source-17443388433580-target selected: false - sourcePosition: right - targetPosition: left + source: '17443357899060' + sourceHandle: source + target: '17443388433580' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - desc: '' - output_type: string - selected: false - title: 实例汇总 - type: variable-aggregator - variables: - - - '1741597223833' - - text - - - '1741599658821' - - result - - - '1742629595400' - - text - height: 152 - id: '1741597274153' - position: - x: 1246 - y: 743 - positionAbsolute: - x: 1246 - y: 743 + isInIteration: false + sourceType: code + targetType: llm + id: 17443388433580-source-17430596469370-target selected: false - sourcePosition: right - targetPosition: left + source: '17443388433580' + sourceHandle: source + target: '17430596469370' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - code: "\ndef main(arg1: str, arg2: str) -> dict:\n data = {\n \"\ - data\": {\n \"timeseries\": [\n {\n \ - \ \"labels\": {\n \"namespace\": arg2,\n\ - \ \"pod\": arg1,\n }\n \ - \ }\n ]\n }\n }\n return {\n \"result\"\ - : json.dumps(data),\n }\n" - code_language: python3 - desc: '' - outputs: - result: - children: null - type: string - selected: false - title: 获取POD信息 - type: code - variables: - - value_selector: - - '1742807803325' - - pod - variable: arg1 - - value_selector: - - '1742807803325' - - namespace - variable: arg2 - height: 54 - id: '1741599658821' - position: - x: 942 - y: 774 - positionAbsolute: - x: 942 - y: 774 + isInIteration: false + sourceType: code + targetType: code + id: 17443357893440-source-17443388421360-target selected: false - sourcePosition: right - targetPosition: left + source: '17443357893440' + sourceHandle: source + target: '17443388421360' + targetHandle: target type: custom - width: 244 + zIndex: 0 - data: - cases: - - case_id: 'true' - conditions: - - comparison_operator: not empty - id: 22866ae7-2bfa-47e9-9c19-d31e8b63001f - value: '' - varType: string - variable_selector: - - '1742807803325' - - pod - - comparison_operator: not empty - id: add89997-787b-4d71-a187-3e9f8e8f25a3 - value: '' - varType: string - variable_selector: - - '1742807803325' - - namespace - id: 'true' - logical_operator: and - - case_id: 2949ad86-bdc0-4b1d-bd84-6e01f41915eb - conditions: - - comparison_operator: not empty - id: 4dbbe62a-669f-4549-9028-c4ccd6c8175c - value: '' - varType: string - variable_selector: - - '1742807803325' - - service - id: 2949ad86-bdc0-4b1d-bd84-6e01f41915eb - logical_operator: and - - case_id: 74dc1f70-729f-47e1-a6c8-9f0a1d2a6ad9 - conditions: - - comparison_operator: not empty - id: a2f849d6-0c4f-40f0-9c91-f37cf81eb3f5 - value: '' - varType: string - variable_selector: - - '1741227526517' - - nodeName - id: 74dc1f70-729f-47e1-a6c8-9f0a1d2a6ad9 - logical_operator: and - desc: '' - selected: false - title: 告警关联实例信息 - type: if-else - height: 248 - id: '1742453019576' - position: - x: 638 - y: 586 - positionAbsolute: - x: 638 - y: 586 + isInIteration: false + sourceType: code + targetType: llm + id: 17443388421360-source-17430596469370-target selected: false - sourcePosition: right - targetPosition: left + source: '17443388421360' + sourceHandle: source + target: '17430596469370' + targetHandle: target type: custom - width: 244 + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 17443357536900-source-17443388438160-target + selected: false + source: '17443357536900' + sourceHandle: source + target: '17443388438160' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: llm + id: 17443388438160-source-17430596469370-target + selected: false + source: '17443388438160' + sourceHandle: source + target: '17430596469370' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: code + id: 17443356883380-source-17443388443000-target + selected: false + source: '17443356883380' + sourceHandle: source + target: '17443388443000' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: llm + id: 17443388443000-source-17430596469370-target + selected: false + source: '17443388443000' + sourceHandle: source + target: '17430596469370' + targetHandle: target + type: custom + zIndex: 0 + - data: + isInIteration: false + sourceType: code + targetType: llm + id: 1744290470304-source-17430596469370-target + selected: false + source: '1744290470304' + sourceHandle: source + target: '17430596469370' + targetHandle: target + type: custom + zIndex: 0 - data: - classes: - - id: '1742462167200' - name: 内存相关 - - id: '1742463856746' - name: '事件类型 - - 容器被killed,重启' - - id: '1742464231696' - name: 未知类型 - desc: '' - instruction: 你是一个智能告警分类助手,任务是根据给定的告警事件并对其进行分类 - instructions: '' isInIteration: true iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - query_variable_selector: - - '1742807803325' - - alertName - selected: false - title: alert event - topics: [] - type: question-classifier - vision: - enabled: false - height: 204 - id: '1742461755094' - parentId: '1741497176064' - position: - x: 76.97060259216505 - y: 363.9210031388636 - positionAbsolute: - x: 4362.970602592165 - y: 1267.9210031388636 + sourceType: tool + targetType: code + id: 1742798505742-source-1744342068305-target selected: false - sourcePosition: right - targetPosition: left + source: '1742798505742' + sourceHandle: source + target: '1744342068305' + targetHandle: target type: custom - width: 244 zIndex: 1002 - data: - context: - enabled: false - variable_selector: [] - desc: '' isInIteration: true iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 25386b5d-4509-477b-bdab-d835cd12b104 - role: system - text: 你是一个可观性领域的智能助手,帮助用户分析问题 - - id: 5f74b2ce-6208-423b-aa3b-f01f2cafb89b - role: user - text: '# 目的 - - - 当前 pod:{{#1741497181784.pod#}}) - - - 由于内存告警升高,需要分析其原因并提供解决方案。 - - # 输出要求 - - 展示内存指标数据的变化趋势(用简单语言描述,让人一看就懂)。 - - 提供相关建议,包括: - - 检查代码是否可能存在内存泄漏。 - - 通过日志分析问题根源等实用方法。 - - # 数据来源 - - - 容器内存数据:{{#1743059090157.text#}}。' - selected: false - title: memory anlysis - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742468584059' - parentId: '1741497176064' - position: - x: 1013.1944929957504 - y: 157.34078070824808 - positionAbsolute: - x: 5299.19449299575 - y: 1061.340780708248 + sourceType: code + targetType: tool + id: 1744342068305-source-1743152103020-target selected: false - sourcePosition: right - targetPosition: left + source: '1744342068305' + sourceHandle: source + target: '1743152103020' + targetHandle: target type: custom - width: 244 zIndex: 1002 - data: - context: - enabled: false - variable_selector: [] - desc: '' isInIteration: true iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 893c9a67-e9e3-4c2c-8ed2-6301998d555b - role: system - text: 你是一个可观性领域的智能助手,帮助用户分析问题 - - id: ccfb4eb1-f253-415d-9a60-9ecab7bd6af4 - role: user - text: '该告警事件是一个事件类型 - - 影响了{{#1741497181784.pod#}},给出一些建议' - selected: false - title: LLM 4 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742468652489' - parentId: '1741497176064' - position: - x: 592.7847463655689 - y: 258.56082085093817 - positionAbsolute: - x: 4878.784746365569 - y: 1162.5608208509382 + sourceType: tool + targetType: code + id: 1742547917612-source-1744342138380-target selected: false - sourcePosition: right - targetPosition: left + source: '1742547917612' + sourceHandle: source + target: '1744342138380' + targetHandle: target type: custom - width: 244 zIndex: 1002 - data: - desc: '' isInIteration: true iteration_id: '1741497176064' - output_type: string - selected: false - title: 结果汇总 - type: variable-aggregator - variables: - - - '1741506766037' - - text - - - '1742468584059' - - text - - - '1742468652489' - - text - height: 152 - id: '1742470455066' - parentId: '1741497176064' - position: - x: 2944.360125927147 - y: 216.75503228886544 - positionAbsolute: - x: 7230.360125927147 - y: 1120.7550322888656 + sourceType: code + targetType: tool + id: 1744342138380-source-1743150910103-target selected: false - sourcePosition: right - targetPosition: left + source: '1744342138380' + sourceHandle: source + target: '1743150910103' + targetHandle: target type: custom - width: 244 zIndex: 1002 - data: - desc: '' isInIteration: true - is_team_authorization: true iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 - label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace - label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace + sourceType: code + targetType: code + id: 1744206107700-source-1744342244843-target + selected: false + source: '1744206107700' + sourceHandle: source + target: '1744342244843' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744206199211-source-1744342309386-target + selected: false + source: '1744206199211' + sourceHandle: source + target: '1744342309386' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744206249528-source-1744342372882-target + selected: false + source: '1744206249528' + sourceHandle: source + target: '1744342372882' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744206286177-source-1744342426374-target + selected: false + source: '1744206286177' + sourceHandle: source + target: '1744342426374' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744206314118-source-1744342478278-target + source: '1744206314118' + sourceHandle: source + target: '1744342478278' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342478278-source-1744342609856-target + source: '1744342478278' + sourceHandle: source + target: '1744342609856' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342609856-source-1741506766037-target + source: '1744342609856' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342426374-source-1744342800777-target + source: '1744342426374' + sourceHandle: source + target: '1744342800777' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342800777-source-1741506766037-target + source: '1744342800777' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342372882-source-1744342846753-target + source: '1744342372882' + sourceHandle: source + target: '1744342846753' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342846753-source-1741506766037-target + source: '1744342846753' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342309386-source-1744342890395-target + source: '1744342309386' + sourceHandle: source + target: '1744342890395' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342890395-source-1741506766037-target + source: '1744342890395' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: code + id: 1744342244843-source-1744342920172-target + source: '1744342244843' + sourceHandle: source + target: '1744342920172' + targetHandle: target + type: custom + zIndex: 1002 + - data: + isInIteration: true + iteration_id: '1741497176064' + sourceType: code + targetType: llm + id: 1744342920172-source-1741506766037-target + source: '1744342920172' + sourceHandle: source + target: '1741506766037' + targetHandle: target + type: custom + zIndex: 1002 + nodes: + - data: + desc: '' + selected: false + title: start + type: start + variables: + - label: startTime + max_length: 48 + options: [] + required: true + type: number + variable: startTime + - label: endTime + max_length: 48 + options: [] + required: true + type: number + variable: endTime + - label: params + max_length: 9999999 + options: [] + required: false + type: paragraph + variable: params + - label: nodeName + max_length: 256 + options: [] + required: false + type: text-input + variable: nodeName + - label: nodeIp + max_length: 48 + options: [] + required: false + type: text-input + variable: nodeIp + height: 193 + id: '1741227526517' + position: + x: 30 + y: 444 + positionAbsolute: + x: 30 + y: 444 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + desc: '' + error_handle_mode: terminated + height: 1408 + is_parallel: false + iterator_selector: + - '1741509454645' + - monitor + output_selector: + - '1742470455066' + - output + output_type: array[string] + parallel_nums: 10 + selected: false + start_node_id: 1741497176064start + title: iteration + type: iteration + width: 6503.360125927147 + height: 1408 + id: '1741497176064' + position: + x: 5262.456277280085 + y: 916 + positionAbsolute: + x: 5262.456277280085 + y: 916 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 6503 + zIndex: 1 + - data: + desc: '' + isInIteration: true + selected: false + title: '' + type: iteration-start + draggable: false + height: 48 + id: 1741497176064start + parentId: '1741497176064' + position: + x: 24 + y: 68 + positionAbsolute: + x: 5286.456277280085 + y: 984 + selectable: false + selected: false + sourcePosition: right + targetPosition: left + type: custom-iteration-start + width: 44 + zIndex: 1002 + - data: + code: "\ndef main(arg1: str) -> dict:\n data = json.loads(arg1)\n return\ + \ {\n \"pod\": data.get(\"pod\", \"\"),\n \"namespace\": data.get(\"\ + namespace\", \"\")\n }\n" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + namespace: + children: null + type: string + pod: + children: null + type: string + selected: false + title: get instance info + type: code + variables: + - value_selector: + - '1741497176064' + - item + variable: arg1 + height: 53 + id: '1741497181784' + parentId: '1741497176064' + position: + x: 247.70722025930104 + y: 65 + positionAbsolute: + x: 5510.163497539385 + y: 981 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 + label: + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace + label: + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: Container CPU throttling duration (when using Containerd container + runtime, statistics by container and Pod) + tool_configurations: {} + tool_label: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) + tool_name: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + namespace: + type: mixed + value: '{{#1741497181784.namespace#}}' + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1741502699500' + parentId: '1741497176064' + position: + x: 844.0068118865438 + y: 800.2561082923241 + positionAbsolute: + x: 6106.463089166628 + y: 1716.2561082923241 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + outputs: + - value_selector: + - '1741512806512' + - text + variable: text + - value_selector: [] + variable: '' + selected: false + title: End + type: end + height: 89 + id: '1741502839759' + position: + x: 12255 + y: 916 + positionAbsolute: + x: 12255 + y: 916 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + context: + enabled: false + variable_selector: [] + desc: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.6 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + prompt_template: + - id: cd35fff4-a037-4e72-af99-2ff8299fc5d2 + role: system + text: 你是可观测性领域的智能助手,协助用户分析解决问题。 + - id: 2b2ad468-efcd-4bcc-aeb9-d53d2f2770ad + role: user + text: "# 分析目标 \n基于跨资源类别的异常线程数据,判断应用实例 {{#1741497181784.pod#}}是否受告警事件 {{#1742807803325.alertName#}}\ + \ 影响,并进行初步根因定位。 \n\n# 输入数据规范 \n- **分资源类别数据**:线程延迟及关联的北极星指标(如网络类延迟对应网络RTT)。\ + \ \n- **异常数据点计数**:延迟超过同类型线程历史均值20%的实例数,需标注线程延迟均值。 \n\n# 分析规则 \n1. **主异常方向判定**\ + \ \n - 标注异常线程的延迟均值。 \n - 识别延迟增幅最显著的资源类型(如延迟从毫秒级跃升至秒级)。 \n - **线程数量优先原则**:若某资源类型(如网络/epoll)的异常线程数量最多,则归因至该类别。\ + \ \n *示例:网络/epoll类异常线程4条 vs CPU类2条 → 归因为网络问题。* \n\n2. **误判规避** \ + \ \n - 若CPU或运行队列(RunQ)延迟突增且无并发网络/epoll异常,优先归因为CPU资源争用。 \n\n3. **决胜优先级(降序)**\ + \ \n `CPU > 网络 > Epoll > 文件 > RunQ` \n\n# 根因归因与建议 \n- **CPU延迟突增**:检查代码过度嵌套问题,确认后执行版本回滚。\ + \ \n- **CPU抢占过高**:排查同节点进程的资源争用。 \n- **网络/Epoll延迟突增**: \n - 若RTT异常\ + \ → 网络链路问题; \n - 若RTT正常 → 下游服务延迟问题。 \n- **文件操作延迟升高**:审计文件句柄泄漏。 \n\n\ + # 输出格式 \n**应用实例**: {{#1741497181784.pod#}}\n**北极星指标趋势摘要** \n- 按指标维度描述显著变化,若无异常标注\"\ + 未观测到显著偏离\"。 \n\n**初步根因结论** \n- 明确告警事件对应用的影响状态。 \n- 基于北极星指标与分析规则输出单一归因结论。\ + \ \n *注:若网络/Epoll类异常但RTT正常,归因为下游服务延迟。* \n\n# 输入数据 \n- CPU:{{#1744342920172.result#}}\n\ + - 网络:{{#1744342846753.result#}}\n- 文件:{{#1744342890395.result#}} \n- Epoll:{{#1744342800777.result#}}\ + \ \n- RunQ:{{#1744342609856.result#}} \n\n# 输出准则 \n- 使用简洁的非技术表述,避免歧义。\ + \ \n- 结论需聚焦可执行建议(如\"检查代码嵌套\"而非\"可能存在性能问题\")。" + selected: false + title: llm analysis root cause + type: llm + variables: [] + vision: + enabled: false + height: 89 + id: '1741506766037' + parentId: '1741497176064' + position: + x: 3100.843852684703 + y: 613.2233202711288 + positionAbsolute: + x: 8363.300129964788 + y: 1529.2233202711288 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\ndef main(arg: str) -> dict:\n data = json.loads(arg)\n\ + \ timeseries = data[\"data\"][\"timeseries\"]\n \n seen = set()\n\ + \ pod_info = []\n first_pod = None\n \n for item in timeseries:\n\ + \ labels = item[\"labels\"]\n namespace = labels.get(\"namespace\"\ + , \"\")\n pod = labels.get(\"pod\", \"\")\n \n unique_key\ + \ = (namespace, pod)\n \n if unique_key not in seen:\n \ + \ seen.add(unique_key)\n info = {\n \"\ + namespace\": namespace,\n \"pod\": pod\n }\n \ + \ if first_pod is None:\n first_pod = json.dumps(info)\n\ + \ else:\n pod_info.append(json.dumps(info))\n \ + \ \n return {\n \"first\": first_pod,\n \"monitor\"\ + : pod_info,\n }" + code_language: python3 + desc: '' + outputs: + first: + children: null + type: string + monitor: + children: null + type: array[string] + selected: false + title: ' get pod info array' + type: code + variables: + - value_selector: + - '1741597274153' + - output + variable: arg + height: 53 + id: '1741509454645' + position: + x: 1545 + y: 628 + positionAbsolute: + x: 1545 + y: 628 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + context: + enabled: false + variable_selector: [] + desc: '' + model: + completion_params: + temperature: 0.6 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + prompt_template: + - id: 169877de-aa4a-44db-90ef-2cc8f68882c4 + role: system + text: 你是可观测性领域的智能助手,协助用户分析解决问题。 + - id: c9d29276-dfa5-4042-b1c6-562260f9cc7c + role: user + text: '# 目的 + + 基于服务层级聚合Pod信息并输出服务级概览报告。需确保各Pod具体运行状态的可视化呈现清晰直观。删除所有与futex锁相关的优化建议。 + + + # 注意事项 + + 1. 结论中若CPU相关告警事件综合影响系数较高,应优先指导处理CPU资源瓶颈 + + 2. 采用树状层级化输出格式,服务级汇总指标与Pod明细指标需通过缩进形成清晰继承关系 + + 3. 核心黄金指标(CPU、epoll、net、other/runq)命名严格保持原始形态 + + 4. 故障归因分析需保持单一维度,禁止构建跨维度关联(如GC与锁竞争) + + 5. 当网络栈耗时(net)异常增高但往返时延(RTT)处于基线范围时,需重点提示检查下游依赖服务 + + 6. 如果网络耗时增加,但 RTT 正常,建议用户检查下游问题 + + + # 结论数据源 + + {{#17430594012660.output#}} + + {{#1741497176064.output#}} + + ' + selected: false + title: summary data + type: llm + variables: [] + vision: + enabled: false + height: 89 + id: '1741512806512' + position: + x: 11884 + y: 916 + positionAbsolute: + x: 11884 + y: 916 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + desc: '' + selected: false + template: 服务名和节点均为空,无法分析根因。 + title: unsupport alert + type: template-transform + variables: [] + height: 53 + id: '1741592094819' + position: + x: 939 + y: 444 + positionAbsolute: + x: 939 + y: 444 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + desc: '' + outputs: + - value_selector: + - '1741592094819' + - output + variable: output + selected: false + title: End + type: end + height: 89 + id: '1741592144815' + position: + x: 1242 + y: 444 + positionAbsolute: + x: 1242 + y: 444 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + desc: '' + is_team_authorization: true + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified service name + ja_JP: Specified service name + pt_BR: Specified service name + zh_Hans: 指定的服务名 + label: + en_US: service_name + ja_JP: service_name + pt_BR: service_name + zh_Hans: service_name + llm_description: Specified service name + max: null + min: null + name: service_name + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + service_name: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: query pod info by service + tool_configurations: {} + tool_label: 列出该服务下的所有实例 + tool_name: originx_service_instance + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + service_name: + type: mixed + value: '{{#1742807803325.service#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1741597223833' + position: + x: 939 + y: 536 + positionAbsolute: + x: 939 + y: 536 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + desc: '' + output_type: string + selected: false + title: summary instance + type: variable-aggregator + variables: + - - '1741597223833' + - text + - - '1741599658821' + - result + - - '1742629595400' + - text + height: 150 + id: '1741597274153' + position: + x: 1242 + y: 596.5 + positionAbsolute: + x: 1242 + y: 596.5 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "\ndef main(arg1: str, arg2: str) -> dict:\n data = {\n \"\ + data\": {\n \"timeseries\": [\n {\n \ + \ \"labels\": {\n \"namespace\": arg2,\n\ + \ \"pod\": arg1,\n }\n \ + \ }\n ]\n }\n }\n return {\n \"result\"\ + : json.dumps(data),\n }\n" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: get pod info + type: code + variables: + - value_selector: + - '1742807803325' + - pod + variable: arg1 + - value_selector: + - '1742807803325' + - namespace + variable: arg2 + height: 53 + id: '1741599658821' + position: + x: 939 + y: 628 + positionAbsolute: + x: 939 + y: 628 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + cases: + - case_id: 'true' + conditions: + - comparison_operator: not empty + id: 22866ae7-2bfa-47e9-9c19-d31e8b63001f + value: '' + varType: string + variable_selector: + - '1742807803325' + - pod + - comparison_operator: not empty + id: add89997-787b-4d71-a187-3e9f8e8f25a3 + value: '' + varType: string + variable_selector: + - '1742807803325' + - namespace + id: 'true' + logical_operator: and + - case_id: 2949ad86-bdc0-4b1d-bd84-6e01f41915eb + conditions: + - comparison_operator: not empty + id: 4dbbe62a-669f-4549-9028-c4ccd6c8175c + value: '' + varType: string + variable_selector: + - '1742807803325' + - service + id: 2949ad86-bdc0-4b1d-bd84-6e01f41915eb + logical_operator: and + - case_id: 74dc1f70-729f-47e1-a6c8-9f0a1d2a6ad9 + conditions: + - comparison_operator: not empty + id: a2f849d6-0c4f-40f0-9c91-f37cf81eb3f5 + value: '' + varType: string + variable_selector: + - '1741227526517' + - nodeName + id: 74dc1f70-729f-47e1-a6c8-9f0a1d2a6ad9 + logical_operator: and + desc: '' + selected: false + title: alert instance info + type: if-else + height: 247 + id: '1742453019576' + position: + x: 636 + y: 444 + positionAbsolute: + x: 636 + y: 444 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + classes: + - id: '1742462167200' + name: 'container + + memory' + - id: '1742463856746' + name: 'event type + + container was killed' + - id: '1742464231696' + name: unknow + desc: '' + instruction: You are an intelligent alert classification assistant. Your task + is to classify the given alert events. + instructions: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + query_variable_selector: + - '1742807803325' + - alertName + selected: false + title: alert event + topics: [] + type: question-classifier + vision: + enabled: false + height: 203 + id: '1742461755094' + parentId: '1741497176064' + position: + x: 76.97060259216505 + y: 363.9210031388636 + positionAbsolute: + x: 5339.42687987225 + y: 1279.9210031388636 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + context: + enabled: false + variable_selector: [] + desc: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + prompt_template: + - id: 25386b5d-4509-477b-bdab-d835cd12b104 + role: system + text: 你是可观测性领域的智能助手,协助用户分析解决问题。 + - id: 5f74b2ce-6208-423b-aa3b-f01f2cafb89b + role: user + text: "# 目的\n\n当前容器:{{#1741497181784.pod#}}\n\n由于内存增高产生告警,需分析原因并提供解决方案。\n\ + \n# 输出要求\n\n展示内存指标数据的趋势(使用简洁语言描述,便于快速理解)。 \n提供相关建议,包括: \n- 检查代码是否存在内存泄漏。\ + \ \n- 通过日志分析问题根因等实用方法。 \n\n# 数据来源\n\n容器内存数据:{{#1743059090157.text#}}" + selected: false + title: memory anlysis + type: llm + variables: [] + vision: + enabled: false + height: 89 + id: '1742468584059' + parentId: '1741497176064' + position: + x: 1003.8883599154669 + y: 136.40198127761005 + positionAbsolute: + x: 6266.3446371955515 + y: 1052.40198127761 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + context: + enabled: false + variable_selector: [] + desc: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + prompt_template: + - id: 893c9a67-e9e3-4c2c-8ed2-6301998d555b + role: system + text: 你是可观测性领域的智能助手,协助用户分析解决问题。 + - id: ccfb4eb1-f253-415d-9a60-9ecab7bd6af4 + role: user + text: 此告警事件属于event类型,影响 {{#1741497181784.pod#}}, 请给出一些建议。 + selected: false + title: LLM 4 + type: llm + variables: [] + vision: + enabled: false + height: 89 + id: '1742468652489' + parentId: '1741497176064' + position: + x: 535.2725275358107 + y: 237.25999906213883 + positionAbsolute: + x: 5797.728804815895 + y: 1153.2599990621388 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + iteration_id: '1741497176064' + output_type: string + selected: false + title: summary + type: variable-aggregator + variables: + - - '1741506766037' + - text + - - '1742468584059' + - text + - - '1742468652489' + - text + height: 150 + id: '1742470455066' + parentId: '1741497176064' + position: + x: 6244.360125927147 + y: 216.75503228886544 + positionAbsolute: + x: 11506.81640320723 + y: 1132.7550322888656 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 + label: + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace + label: + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: Query container rtt + tool_configurations: {} + tool_label: Query container rtt + tool_name: 查询容器网络与下游RTT + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + namespace: + type: mixed + value: '{{#1741497181784.namespace#}}' + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742547917612' + parentId: '1741497176064' + position: + x: 837.913049217997 + y: 567.6173152328563 + positionAbsolute: + x: 6100.369326498081 + y: 1483.6173152328563 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + is_team_authorization: true + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified node name + ja_JP: Specified node name + pt_BR: Specified pod name + zh_Hans: 指定的主机名称 + label: + en_US: node_name + ja_JP: node_name + pt_BR: node_name + zh_Hans: node_name + llm_description: Specified pod name + max: null + min: null + name: node_name + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified Process ID + ja_JP: Specified Process ID + pt_BR: Specified Process ID + zh_Hans: 指定的进程ID + label: + en_US: pid + ja_JP: pid + pt_BR: pid + zh_Hans: pid + llm_description: Specified Process ID + max: null + min: null + name: pid + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + node_name: '' + pid: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: get pod info in node + tool_configurations: {} + tool_label: Thread Polaris Metrics Process All monitor + tool_name: originx_service_monitor + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + node_name: + type: mixed + value: '{{#1741227526517.nodeName#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742629595400' + position: + x: 939 + y: 720 + positionAbsolute: + x: 939 + y: 720 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 + label: + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace + label: + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: Query container rtt + tool_configurations: {} + tool_label: Query container rtt + tool_name: 查询容器网络与下游RTT + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + namespace: + type: mixed + value: '{{#1741497181784.namespace#}}' + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742798505742' + parentId: '1741497176064' + position: + x: 838.2707565556775 + y: 677.0915533804653 + positionAbsolute: + x: 6100.727033835762 + y: 1593.0915533804653 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: " \ndef get_value(data, keys): \n for key in keys: \n value = data.get(key)\ + \ \n if value is not None: \n return value \n return \"\" \n\n\ + import json \n\ndef main(arg: str) -> dict:\n data = json.loads(arg) \n\ + \ return { \n \"alertName\": get_value(data, [\"alertName\"]), \n\ + \ \"service\": get_value(data, [\"svc_name\", \"service\"]), \n \"endpoint\"\ + : get_value(data,[\"endpoint\", \"content_key\"]), \n \"pod\": get_value(data,[\"\ + pod\", \"src_pod\", \"pod_name\"]), \n \"namespace\": get_value(data,[\"\ + namespace\", \"src_namespace\"]), \n}" + code_language: python3 + desc: '' + outputs: + alertName: + children: null + type: string + endpoint: + children: null + type: string + namespace: + children: null + type: string + pod: + children: null + type: string + service: + children: null + type: string + selected: false + title: get alert event label info + type: code + variables: + - value_selector: + - '1741227526517' + - params + variable: arg + height: 53 + id: '1742807803325' + position: + x: 333 + y: 444 + positionAbsolute: + x: 333 + y: 444 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + label: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name + max: null + min: null + name: cadvisor_job_name + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + label: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time(Microsecond) + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time(Microsecond) + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query end time(Microsecond) + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + cadvisor_job_name: '' + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: Container CPU usage rate (Containerd runtime, aggregated by container + and Pod) + tool_configurations: {} + tool_label: Container CPU usage rate (Containerd runtime, aggregated by container + and Pod) + tool_name: 容器CPU使用率(使用Containerd容器运行时,按容器和Pod统计) + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + namespace: + type: mixed + value: '{{#1741497181784.namespace#}}' + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742980228913' + parentId: '1741497176064' + position: + x: 817.3433448742644 + y: 386.77445077825655 + positionAbsolute: + x: 6079.799622154349 + y: 1302.7744507782566 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + label: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name + max: null + min: null + name: cadvisor_job_name + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + label: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time(Microsecond) + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time(Microsecond) + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query end time(Microsecond) + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + cadvisor_job_name: '' + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: Container disk read time per second (Containerd runtime, aggregated + by container and Pod) + tool_configurations: {} + tool_label: Container disk read time per second (Containerd runtime, aggregated + by container and Pod) + tool_name: 容器磁盘读取耗时每秒(使用Containerd,按Pod和容器统计) + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + namespace: + type: mixed + value: '{{#1741497181784.namespace#}}' + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742980318484' + parentId: '1741497176064' + position: + x: 829.6661633624499 + y: 478.0639330308825 + positionAbsolute: + x: 6092.1224406425345 + y: 1394.0639330308825 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null - name: namespace + name: pod options: [] placeholder: null precision: null @@ -1972,8 +3141,8 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -1981,7 +3150,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -1996,16 +3165,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -2018,26 +3187,22 @@ workflow: type: number params: endTime: '' - namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: Query container rtt + title: thread in CPU tool_configurations: {} - tool_label: Query container rtt - tool_name: 查询容器网络与下游RTT + tool_label: 线程在CPU上的耗时折线图(按Pod统计) + tool_name: 线程在CPU上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' pod: type: mixed value: '{{#1741497181784.pod#}}' @@ -2047,67 +3212,45 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742547917612' + height: 53 + id: '1742980720651' parentId: '1741497176064' position: - x: 837.913049217997 - y: 567.6173152328563 + x: 514.1495817191098 + y: 381.2394319656114 positionAbsolute: - x: 5123.9130492179975 - y: 1471.6173152328563 + x: 5776.605858999194 + y: 1297.2394319656114 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' + isInIteration: true is_team_authorization: true + iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null default: null form: llm human_description: - en_US: Specified node name - ja_JP: Specified node name - pt_BR: Specified pod name - zh_Hans: 指定的主机名称 - label: - en_US: node_name - ja_JP: node_name - pt_BR: node_name - zh_Hans: node_name - llm_description: Specified pod name - max: null - min: null - name: node_name - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Specified Process ID - ja_JP: Specified Process ID - pt_BR: Specified Process ID - zh_Hans: 指定的进程ID + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: pid - ja_JP: pid - pt_BR: pid - zh_Hans: pid - llm_description: Specified Process ID + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null - name: pid + name: pod options: [] placeholder: null precision: null @@ -2119,8 +3262,8 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -2128,7 +3271,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -2143,16 +3286,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -2165,45 +3308,46 @@ workflow: type: number params: endTime: '' - node_name: '' - pid: '' + pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 节点上监控的POD实例 + title: thread in file tool_configurations: {} - tool_label: Thread Polaris Metrics Process All monitor - tool_name: originx_service_monitor + tool_label: 线程在文件操作上的耗时折线图(按Pod统计) + tool_name: 线程在文件操作上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - node_name: + pod: type: mixed - value: '{{#1741227526517.nodeName#}}' + value: '{{#1741497181784.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1742629595400' + height: 53 + id: '1742980748320' + parentId: '1741497176064' position: - x: 942 - y: 868 + x: 502.3624003022592 + y: 478.98654261939305 positionAbsolute: - x: 942 - y: 868 + x: 5764.818677582343 + y: 1394.986542619393 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 + zIndex: 1002 - data: desc: '' isInIteration: true @@ -2215,16 +3359,16 @@ workflow: default: null form: llm human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null name: pod @@ -2239,32 +3383,8 @@ workflow: default: null form: llm human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace - label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace - max: null - min: null - name: namespace - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -2272,7 +3392,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -2287,16 +3407,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -2309,98 +3429,46 @@ workflow: type: number params: endTime: '' - namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: Query container rtt + title: thread in net tool_configurations: {} - tool_label: Query container rtt - tool_name: 查询容器网络与下游RTT + tool_label: 线程在网络操作上的耗时折线图(按Pod统计) + tool_name: 线程在网络操作上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: tool - height: 54 - id: '1742798505742' - parentId: '1741497176064' - position: - x: 838.2707565556775 - y: 677.0915533804653 - positionAbsolute: - x: 5124.2707565556775 - y: 1581.0915533804653 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - code: " \ndef get_value(data, keys): \n for key in keys: \n value = data.get(key)\ - \ \n if value is not None: \n return value \n return \"\" \n\n\ - import json \n\ndef main(arg: str) -> dict:\n data = json.loads(arg) \n\ - \ return { \n \"alertName\": get_value(data, [\"alertName\"]), \n\ - \ \"service\": get_value(data, [\"svc_name\", \"service\"]), \n \"endpoint\"\ - : get_value(data,[\"endpoint\", \"content_key\"]), \n \"pod\": get_value(data,[\"\ - pod\", \"src_pod\", \"pod_name\"]), \n \"namespace\": get_value(data,[\"\ - namespace\", \"src_namespace\"]), \n}" - code_language: python3 - desc: '' - outputs: - alertName: - children: null - type: string - endpoint: - children: null - type: string - namespace: - children: null - type: string pod: - children: null - type: string - service: - children: null - type: string - selected: false - title: 获取告警事件标签 - type: code - variables: - - value_selector: - - '1741227526517' - - params - variable: arg - height: 54 - id: '1742807803325' + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '1742980780865' + parentId: '1741497176064' position: - x: 334 - y: 586 + x: 507.1563167397626 + y: 565.5281468443313 positionAbsolute: - x: 334 - y: 586 + x: 5769.612594019847 + y: 1481.5281468443313 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 + zIndex: 1002 - data: desc: '' isInIteration: true @@ -2408,54 +3476,6 @@ workflow: iteration_id: '1741497176064' output_schema: null paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name - max: null - min: null - name: cadvisor_job_name - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace - max: null - min: null - name: namespace - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - auto_generate: null default: null form: llm @@ -2486,7 +3506,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -2529,30 +3549,23 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' - namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: Container CPU usage rate (Containerd runtime, aggregated by container - and Pod) + title: thread in epoll tool_configurations: {} - tool_label: Container CPU usage rate (Containerd runtime, aggregated by container - and Pod) - tool_name: 容器CPU使用率(使用Containerd容器运行时,按容器和Pod统计) + tool_label: 线程在Epoll操作上的耗时折线图(按Pod统计) + tool_name: 线程在Epoll操作上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' pod: type: mixed value: '{{#1741497181784.pod#}}' @@ -2562,20 +3575,20 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980228913' + height: 53 + id: '1742980837261' parentId: '1741497176064' position: - x: 817.3433448742644 - y: 386.77445077825655 + x: 513.7505744250511 + y: 675.3340235425774 positionAbsolute: - x: 5103.343344874264 - y: 1290.7744507782566 + x: 5776.206851705136 + y: 1591.3340235425774 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -2584,54 +3597,6 @@ workflow: iteration_id: '1741497176064' output_schema: null paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name - max: null - min: null - name: cadvisor_job_name - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace - max: null - min: null - name: namespace - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - auto_generate: null default: null form: llm @@ -2662,7 +3627,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -2705,30 +3670,23 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' - namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: Container disk read time per second (Containerd runtime, aggregated - by container and Pod) + title: thread in runq tool_configurations: {} - tool_label: Container disk read time per second (Containerd runtime, aggregated - by container and Pod) - tool_name: 容器磁盘读取耗时每秒(使用Containerd,按Pod和容器统计) + tool_label: 线程在运行队列上的耗时折线图(按Pod统计) + tool_name: 线程在运行队列上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' pod: type: mixed value: '{{#1741497181784.pod#}}' @@ -2738,20 +3696,103 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980318484' + height: 53 + id: '1742980885557' parentId: '1741497176064' position: - x: 829.6661633624499 - y: 478.0639330308825 + x: 519.4457802875913 + y: 800.367276200539 + positionAbsolute: + x: 5781.902057567676 + y: 1716.367276200539 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "\ndef main(arg1: str) -> dict:\n data = json.loads(arg1)\n return\ + \ {\n \"pod\": data.get(\"pod\", \"\"),\n \"namespace\": data.get(\"\ + namespace\", \"\")\n }\n" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + namespace: + children: null + type: string + pod: + children: null + type: string + selected: false + title: POD info + type: code + variables: + - value_selector: + - '1741509454645' + - first + variable: arg1 + height: 53 + id: '17430589567120' + position: + x: 1848 + y: 628 + positionAbsolute: + x: 1848 + y: 628 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + classes: + - id: '1742462167200' + name: 'container + + high memory' + - id: '1742463856746' + name: 'event type + + container was killed' + - id: '1742464231696' + name: unknow type + desc: '' + instruction: 你是一个智能告警分类助手。你的任务是对给定的警报事件进行分类。 + instructions: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + query_variable_selector: + - '1742807803325' + - alertName + selected: false + title: alert event cls + topics: [] + type: question-classifier + vision: + enabled: false + height: 203 + id: '17430590082510' + position: + x: 2151 + y: 628 positionAbsolute: - x: 5115.66616336245 - y: 1382.0639330308825 + x: 2151 + y: 628 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -2760,6 +3801,54 @@ workflow: iteration_id: '1741497176064' output_schema: null paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + label: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name + max: null + min: null + name: cadvisor_job_name + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + label: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -2790,7 +3879,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time + pt_BR: Data query start time(Microsecond) zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -2833,23 +3922,28 @@ workflow: template: null type: number params: + cadvisor_job_name: '' endTime: '' + namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 线程在CPU上的耗时折线图(按Pod统计) + title: it. container memory tool_configurations: {} - tool_label: 线程在CPU上的耗时折线图(按Pod统计) - tool_name: 线程在CPU上的耗时折线图(按Pod统计) + tool_label: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) + tool_name: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime + namespace: + type: mixed + value: '{{#1741497181784.namespace#}}' pod: type: mixed value: '{{#1741497181784.pod#}}' @@ -2859,20 +3953,20 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980720651' + height: 53 + id: '1743059090157' parentId: '1741497176064' position: - x: 501.0045489698464 - y: 384.9951556082583 + x: 544.0386199547656 + y: 125.67116500938346 positionAbsolute: - x: 4787.004548969846 - y: 1288.9951556082583 + x: 5806.49489723485 + y: 1041.6711650093835 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -2885,19 +3979,19 @@ workflow: default: null form: llm human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name max: null min: null - name: pod + name: cadvisor_job_name options: [] placeholder: null precision: null @@ -2909,99 +4003,26 @@ workflow: default: null form: llm human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace max: null min: null - name: endTime + name: namespace options: [] placeholder: null precision: null - required: true + required: false scope: null template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin - selected: false - title: 线程在文件操作上的耗时折线图(按Pod统计) - tool_configurations: {} - tool_label: 线程在文件操作上的耗时折线图(按Pod统计) - tool_name: 线程在文件操作上的耗时折线图(按Pod统计) - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: tool - height: 54 - id: '1742980748320' - parentId: '1741497176064' - position: - x: 502.3624003022592 - y: 478.98654261939305 - positionAbsolute: - x: 4788.36240030226 - y: 1382.986542619393 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - desc: '' - isInIteration: true - is_team_authorization: true - iteration_id: '1741497176064' - output_schema: null - paramSchemas: + type: string - auto_generate: null default: null form: llm @@ -3032,7 +4053,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time + pt_BR: Data query start time(Microsecond) zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -3075,46 +4096,163 @@ workflow: template: null type: number params: + cadvisor_job_name: '' endTime: '' + namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 线程在网络操作上的耗时折线图(按Pod统计) + title: container memory tool_configurations: {} - tool_label: 线程在网络操作上的耗时折线图(按Pod统计) - tool_name: 线程在网络操作上的耗时折线图(按Pod统计) + tool_label: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) + tool_name: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime + namespace: + type: mixed + value: '{{#17430589567120.namespace#}}' pod: type: mixed - value: '{{#1741497181784.pod#}}' + value: '{{#17430589567120.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980780865' - parentId: '1741497176064' + height: 53 + id: '17430593614550' position: - x: 507.1563167397626 - y: 565.5281468443313 + x: 4272 + y: 628 + positionAbsolute: + x: 4272 + y: 628 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + context: + enabled: false + variable_selector: [] + desc: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + prompt_template: + - id: 25386b5d-4509-477b-bdab-d835cd12b104 + role: system + text: 你是可观测性领域的智能助手,协助用户分析解决问题。 + - id: 5f74b2ce-6208-423b-aa3b-f01f2cafb89b + role: user + text: "# 目的\n\n当前容器:{{#17430589567120.pod#}}\n\n由于内存增高产生告警,需分析原因并提供解决方案。\n\ + \n# 输出要求\n\n展示内存指标数据的趋势(使用简洁语言描述,便于快速理解)。 \n提供相关建议,包括: \n- 检查代码是否存在内存泄漏。\ + \ \n- 通过日志分析问题根因等实用方法。 \n\n# 数据来源\n\n容器内存数据:{{#17430593614550.text#}}" + selected: false + title: memory analysis + type: llm + variables: [] + vision: + enabled: false + height: 89 + id: '17430593816310' + position: + x: 4575 + y: 628 + positionAbsolute: + x: 4575 + y: 628 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + iteration_id: '1741497176064' + output_type: string + selected: false + title: summary1 + type: variable-aggregator + variables: + - - '17430593816310' + - text + - - '17430594510140' + - text + - - '17430596469370' + - text + height: 150 + id: '17430594012660' + position: + x: 4890 + y: 908 + positionAbsolute: + x: 4890 + y: 908 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + context: + enabled: false + variable_selector: [] + desc: '' + isInIteration: true + iteration_id: '1741497176064' + model: + completion_params: + temperature: 0.7 + mode: chat + name: deepseek-chat + provider: langgenius/deepseek/deepseek + prompt_template: + - id: 893c9a67-e9e3-4c2c-8ed2-6301998d555b + role: system + text: 你是可观测性领域的智能助手,协助用户分析解决问题。 + - id: ccfb4eb1-f253-415d-9a60-9ecab7bd6af4 + role: user + text: '此告警事件属于event类型, + + 影响{{#17430589567120.pod#}},请给出一些建议' + selected: false + title: event type + type: llm + variables: [] + vision: + enabled: false + height: 89 + id: '17430594510140' + position: + x: 4575 + y: 1144 positionAbsolute: - x: 4793.156316739763 - y: 1469.5281468443313 + x: 4575 + y: 1144 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -3203,10 +4341,10 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: 线程在Epoll操作上的耗时折线图(按Pod统计) + title: thread time consumption on CPU (by Pod) tool_configurations: {} - tool_label: 线程在Epoll操作上的耗时折线图(按Pod统计) - tool_name: 线程在Epoll操作上的耗时折线图(按Pod统计) + tool_label: 线程在CPU上的耗时折线图(按Pod统计) + tool_name: 线程在CPU上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable @@ -3215,27 +4353,26 @@ workflow: - endTime pod: type: mixed - value: '{{#1741497181784.pod#}}' + value: '{{#17430589567120.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980837261' - parentId: '1741497176064' + height: 53 + id: '17430595109950' position: - x: 513.7505744250511 - y: 675.3340235425774 + x: 2757 + y: 720 positionAbsolute: - x: 4799.750574425051 - y: 1579.3340235425774 + x: 2757 + y: 720 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -3244,6 +4381,54 @@ workflow: iteration_id: '1741497176064' output_schema: null paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + label: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name + max: null + min: null + name: cadvisor_job_name + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + label: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -3274,7 +4459,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time + pt_BR: Data query start time(Microsecond) zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -3317,181 +4502,51 @@ workflow: template: null type: number params: + cadvisor_job_name: '' endTime: '' + namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 线程在运行队列上的耗时折线图(按Pod统计) + title: container cpu tool_configurations: {} - tool_label: 线程在运行队列上的耗时折线图(按Pod统计) - tool_name: 线程在运行队列上的耗时折线图(按Pod统计) + tool_label: Container CPU usage rate (Containerd runtime, aggregated by container + and Pod) + tool_name: 容器CPU使用率(使用Containerd容器运行时,按容器和Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime + namespace: + type: mixed + value: '{{#17430589567120.namespace#}}' pod: type: mixed - value: '{{#1741497181784.pod#}}' + value: '{{#17430589567120.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1742980885557' - parentId: '1741497176064' - position: - x: 517.7154434927047 - y: 802.0976129954249 - positionAbsolute: - x: 4803.715443492705 - y: 1706.097612995425 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 3ce935be-61a8-4ebe-ac8c-ed8039a2b3d3 - role: system - text: 你是一个可观测性领域的智能助手 - - id: 27e985b3-1039-4a38-9f9c-f9d78d83597d - role: user - text: '# 目的 - - 总结以下数据,使其简洁易懂: - - 1. 应用所有线程在 CPU 类型上的执行耗时数据 - - 2. 应用的 CPU 相关指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述,还可给出大部分线程的平均值耗时变化 - - 2. 耗时单位为纳秒(ns),需保留单位 - - 3. 确保描述简洁且用户易于理解 - - - # 数据 - - cpu耗时(单位:纳秒,ns): - - {{#1742980720651.text#}} - - cpu指标: - - {{#1742980720651.text#}}' - selected: false - title: cpu 分析 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742980933811' - parentId: '1741497176064' - position: - x: 1523.5849163475727 - y: 369.82226364108806 - positionAbsolute: - x: 5809.584916347572 - y: 1273.822263641088 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 2aacf14d-625b-435f-b564-d4882157fe1c - role: system - text: 你是一个可观测性领域的智能助手 - - id: fd4d9226-6f01-4d5d-bb05-c0d1cb570ed5 - role: user - text: '# 目的 - - 总结以下数据,使其简洁易懂: - - 1. 应用所有线程在 file 类型上的执行耗时数据 - - 2. 应用的 read disk 指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述 - - 2. 耗时单位为纳秒(ns),输出中保留单位 - - 3. 确保描述简洁且用户易于理解 - - - # 数据 - - file 耗时(单位:纳秒,ns): - - {{#1742980748320.text#}} - - - read disk 指标: - - {{#1742980318484.text#}}' - selected: false - title: file分析 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742981271838' - parentId: '1741497176064' + height: 53 + id: '17430595158080' position: - x: 1558.557136936397 - y: 472.1294984224769 + x: 3060 + y: 720 positionAbsolute: - x: 5844.557136936397 - y: 1376.129498422477 + x: 3060 + y: 720 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: context: @@ -3502,283 +4557,468 @@ workflow: iteration_id: '1741497176064' model: completion_params: - temperature: 0.7 + temperature: 0.6 mode: chat name: deepseek-chat provider: langgenius/deepseek/deepseek prompt_template: - - id: 2fcf3791-e5a8-4c5b-9f9b-73753dedd9f7 + - id: cd35fff4-a037-4e72-af99-2ff8299fc5d2 role: system - text: 你是一个可观测性领域的智能助手 - - id: 95e534cf-6856-4d33-bd3e-680aa819a13b + text: 你是可观测性领域的智能助手,协助用户分析解决问题。 + - id: 2b2ad468-efcd-4bcc-aeb9-d53d2f2770ad role: user - text: '# 目的 - - 总结以下数据,使其简洁易懂: - - 1. 应用所有线程在 net 类型上的执行耗时数据 - - 2. 应用的网络 RTT 指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述,还可给出大部分线程的平均值耗时变化 - - 2. 耗时单位为纳秒(ns),输出中保留单位 - - 3. RTT 指标单位为秒,若值小于 0.05 秒,则可附带说明“网络正常” - - 4. 确保描述简洁且用户易于理解 - - - # 数据 - - net 耗时(单位:纳秒,ns): - - {{#1742980780865.text#}} - - - 网络 RTT 指标(单位:秒,若值 < 0.05 则网络正常): - - {{#1742980780865.text#}}' + text: "# 分析目标 \n基于跨资源类别的异常线程数据,判断应用实例 {{#17430589567120.pod#}} 是否受告警事件\ + \ {{#1742807803325.alertName#}} 影响,并进行初步根因定位。 \n\n# 输入数据规范 \n- **分资源类别数据**:线程延迟及关联的北极星指标(如网络类延迟对应网络RTT)。\ + \ \n- **异常数据点计数**:延迟超过同类型线程历史均值20%的实例数,需标注线程延迟均值。 \n\n# 分析规则 \n1. **主异常方向判定**\ + \ \n - 标注异常线程的延迟均值。 \n - 识别延迟增幅最显著的资源类型(如延迟从毫秒级跃升至秒级)。 \n - **线程数量优先原则**:若某资源类型(如网络/epoll)的异常线程数量最多,则归因至该类别。\ + \ \n *示例:网络/epoll类异常线程4条 vs CPU类2条 → 归因为网络问题。* \n\n2. **误判规避** \ + \ \n - 若CPU或运行队列(RunQ)延迟突增且无并发网络/epoll异常,优先归因为CPU资源争用。 \n\n3. **决胜优先级(降序)**\ + \ \n `CPU > 网络 > Epoll > 文件 > RunQ` \n\n# 根因归因与建议 \n- **CPU延迟突增**:检查代码过度嵌套问题,确认后执行版本回滚。\ + \ \n- **CPU抢占过高**:排查同节点进程的资源争用。 \n- **网络/Epoll延迟突增**: \n - 若RTT异常\ + \ → 网络链路问题; \n - 若RTT正常 → 下游服务延迟问题。 \n- **文件操作延迟升高**:审计文件句柄泄漏。 \n\n\ + # 输出格式 \n**应用实例**: {{#17430589567120.pod#}} \n**北极星指标趋势摘要** \n- 按指标维度描述显著变化,若无异常标注\"\ + 未观测到显著偏离\"。 \n\n**初步根因结论** \n- 明确告警事件对应用的影响状态。 \n- 基于北极星指标与分析规则输出单一归因结论。\ + \ \n *注:若网络/Epoll类异常但RTT正常,归因为下游服务延迟。* \n\n# 输入数据 \n- CPU:{{#17443388433580.result#}}\ + \ \n- 网络:{{#17443388438160.result#}} \n- 文件:{{#17443388421360.result#}}\ + \ \n- Epoll:{{#1744290470304.result#}} \n- RunQ:{{#17443388443000.result#}}\ + \ \n\n# 输出准则 \n- 使用简洁的非技术表述,避免歧义。 \n- 结论需聚焦可执行建议(如\"检查代码嵌套\"而非\"可能存在性能问题\"\ + )。" selected: false - title: 网络分析 + title: llm analysis root cause type: llm variables: [] vision: enabled: false - height: 90 - id: '1742981275937' - parentId: '1741497176064' + height: 89 + id: '17430596469370' position: - x: 1563.9713697080979 - y: 586.9524528027102 + x: 4575 + y: 904 positionAbsolute: - x: 5849.971369708098 - y: 1490.9524528027102 + x: 4575 + y: 904 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: - context: - enabled: false - variable_selector: [] desc: '' isInIteration: true + is_team_authorization: true iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 1f3e7592-c8f0-455a-8abb-23c74aaf5fb8 - role: system - text: 你是一个可观测性领域的智能助手 - - id: 9ed18fa7-b43f-4f11-ba13-2dcd03fc16c9 - role: user - text: '# 目的 - - 总结以下数据,使其简洁易懂: - - 1. 应用所有线程在 epoll 类型上的执行耗时数据 - - 2. 应用的网络 RTT 指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述,还可给出大部分线程的平均值耗时变化 - - 2. 耗时单位为纳秒(ns),输出中保留单位 - - 3. RTT 指标单位为秒,若值小于 0.05 秒,则可附带说明“网络正常” - - 4. 确保描述简洁且用户易于理解 - - - # 数据 - - epoll 耗时(单位:纳秒,ns): - - {{#1742980837261.text#}} - - - 网络 RTT 指标(单位:秒,若值 < 0.05 则网络正常): - - {{#1742798505742.text#}}' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time(Microsecond) + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query end time(Microsecond) + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin selected: false - title: epoll分析 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742981278010' - parentId: '1741497176064' + title: thread time consumption on File (by Pod) + tool_configurations: {} + tool_label: 线程在文件操作上的耗时折线图(按Pod统计) + tool_name: 线程在文件操作上的耗时折线图(按Pod统计) + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + pod: + type: mixed + value: '{{#17430589567120.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '17430597987060' position: - x: 1536.393337231676 - y: 714.101728498571 + x: 2757 + y: 812 positionAbsolute: - x: 5822.393337231676 - y: 1618.101728498571 + x: 2757 + y: 812 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: - context: - enabled: false - variable_selector: [] desc: '' isInIteration: true + is_team_authorization: true iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: b4463776-4368-40e5-b3ea-28a179ebc11c - role: system - text: 你是一个可观测性领域的智能助手 - - id: 44df105c-0a0a-4147-ae4a-7e4bda7bb3af - role: user - text: '# 目的 - - 总结以下数据,使其简洁易懂: - - 1. 应用所有线程在 runq 类型上的执行耗时数据 - - 2. 应用的 CPU Throttle Time 指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述 - - 2. 耗时单位为纳秒(ns),输出中保留单位 - - 3. 确保描述简洁且用户易于理解 - - - # 数据 - - runq 耗时(单位:纳秒,ns): - - {{#1742980885557.text#}} - - - CPU Throttle Time 指标: - - {{#1741502699500.text#}}' + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + label: + en_US: cAdvisor job name + ja_JP: cAdvisor job name + pt_BR: cAdvisor job name + zh_Hans: cAdvisor任务名称 + llm_description: cAdvisor job name + max: null + min: null + name: cadvisor_job_name + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + label: + en_US: Namespace + ja_JP: Namespace + pt_BR: Namespace + zh_Hans: 命名空间 + llm_description: Namespace + max: null + min: null + name: namespace + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time(Microsecond) + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time(Microsecond) + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query end time(Microsecond) + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + cadvisor_job_name: '' + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin selected: false - title: runq分析 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '1742981280434' - parentId: '1741497176064' - position: - x: 1522.4926197483228 - y: 809.6780420321629 - positionAbsolute: - x: 5808.492619748323 - y: 1713.678042032163 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - code: "\ndef main(arg1: str) -> dict:\n data = json.loads(arg1)\n return\ - \ {\n \"pod\": data.get(\"pod\", \"\"),\n \"namespace\": data.get(\"\ - namespace\", \"\")\n }\n" - code_language: python3 - desc: '' - isInIteration: true - iteration_id: '1741497176064' - outputs: + title: container read disk + tool_configurations: {} + tool_label: Container disk read time per second (Containerd runtime, aggregated + by container and Pod) + tool_name: 容器磁盘读取耗时每秒(使用Containerd,按Pod和容器统计) + tool_parameters: + cadvisor_job_name: + type: mixed + value: '' + endTime: + type: variable + value: + - '1741227526517' + - endTime namespace: - children: null - type: string + type: mixed + value: '{{#17430589567120.namespace#}}' pod: - children: null - type: string - selected: false - title: POD信息提取 - type: code - variables: - - value_selector: - - '1741509454645' - - first - variable: arg1 - height: 54 - id: '17430589567120' + type: mixed + value: '{{#17430589567120.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '17430598152780' position: - x: 1854 - y: 774 + x: 3060 + y: 812 positionAbsolute: - x: 1854 - y: 774 + x: 3060 + y: 812 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: - classes: - - id: '1742462167200' - name: 内存相关 - - id: '1742463856746' - name: 容器重启事件 - - id: '1742464231696' - name: 未知类型 desc: '' - instruction: 你是一个智能告警分类助手,任务是根据给定的告警事件并对其进行分类 - instructions: '' isInIteration: true + is_team_authorization: true iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - query_variable_selector: - - '1742807803325' - - alertName + output_schema: null + paramSchemas: + - auto_generate: null + default: null + form: llm + human_description: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + label: + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name + max: null + min: null + name: pod + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time(Microsecond) + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query end time(Microsecond) + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin selected: false - title: 告警事件分类 - topics: [] - type: question-classifier - vision: - enabled: false - height: 204 - id: '17430590082510' + title: Thread time consumption on Net (by Pod) + tool_configurations: {} + tool_label: 线程在网络操作上的耗时折线图(按Pod统计) + tool_name: 线程在网络操作上的耗时折线图(按Pod统计) + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + pod: + type: mixed + value: '{{#17430589567120.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '17430598907140' position: - x: 2158 - y: 774 + x: 2454 + y: 904 positionAbsolute: - x: 2158 - y: 774 + x: 2454 + y: 904 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -3791,19 +5031,19 @@ workflow: default: null form: llm human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name max: null min: null - name: cadvisor_job_name + name: pod options: [] placeholder: null precision: null @@ -3815,16 +5055,16 @@ workflow: default: null form: llm human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace max: null min: null name: namespace @@ -3835,6 +5075,106 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time + zh_Hans: 开始时间 (微秒) + label: + en_US: startTime + ja_JP: startTime + pt_BR: startTime + zh_Hans: startTime + llm_description: Data query start time + max: null + min: null + name: startTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + - auto_generate: null + default: null + form: llm + human_description: + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time + zh_Hans: 结束时间 (微秒) + label: + en_US: endTime + ja_JP: endTime + pt_BR: endTime + zh_Hans: endTime + llm_description: Data query start time + max: null + min: null + name: endTime + options: [] + placeholder: null + precision: null + required: true + scope: null + template: null + type: number + params: + endTime: '' + namespace: '' + pod: '' + startTime: '' + provider_id: apo_select + provider_name: apo_select + provider_type: builtin + selected: false + title: container rtt + tool_configurations: {} + tool_label: Query container rtt + tool_name: 查询容器网络与下游RTT + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + namespace: + type: mixed + value: '{{#17430589567120.namespace#}}' + pod: + type: mixed + value: '{{#17430589567120.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: tool + height: 53 + id: '17430598942980' + position: + x: 2757 + y: 904 + positionAbsolute: + x: 2757 + y: 904 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: - auto_generate: null default: null form: llm @@ -3865,7 +5205,7 @@ workflow: human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -3908,51 +5248,45 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' - namespace: '' pod: '' startTime: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) + title: thread time consumption on Epoll (by Pod) tool_configurations: {} - tool_label: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) - tool_name: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) + tool_label: 线程在Epoll操作上的耗时折线图(按Pod统计) + tool_name: 线程在Epoll操作上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#1741497181784.namespace#}}' pod: type: mixed - value: '{{#1741497181784.pod#}}' + value: '{{#17430589567120.pod#}}' startTime: type: variable value: - '1741227526517' - startTime type: tool - height: 54 - id: '1743059090157' - parentId: '1741497176064' + height: 53 + id: '17430610599980' position: - x: 544.0386199547656 - y: 125.67116500938346 + x: 2454 + y: 1088 positionAbsolute: - x: 4830.038619954766 - y: 1029.6711650093835 + x: 2454 + y: 1088 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -3965,19 +5299,19 @@ workflow: default: null form: llm human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name max: null min: null - name: cadvisor_job_name + name: pod options: [] placeholder: null precision: null @@ -3989,16 +5323,16 @@ workflow: default: null form: llm human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace max: null min: null name: namespace @@ -4013,40 +5347,16 @@ workflow: default: null form: llm human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time(Microsecond) + llm_description: Data query start time max: null min: null name: startTime @@ -4061,16 +5371,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query end time(Microsecond) + llm_description: Data query start time max: null min: null name: endTime @@ -4082,7 +5392,6 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' namespace: '' pod: '' @@ -4091,10 +5400,10 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) (1) + title: container rtt tool_configurations: {} - tool_label: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) - tool_name: 容器内存使用字节数(使用Containerd容器运行时,按容器和Pod统计) + tool_label: Query container rtt + tool_name: 查询容器网络与下游RTT tool_parameters: endTime: type: variable @@ -4113,151 +5422,19 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '17430593614550' - position: - x: 3374 - y: 774 - positionAbsolute: - x: 3374 - y: 774 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 25386b5d-4509-477b-bdab-d835cd12b104 - role: system - text: 你是一个可观性领域的智能助手,帮助用户分析问题 - - id: 5f74b2ce-6208-423b-aa3b-f01f2cafb89b - role: user - text: '# 目的 - - - 当前 pod:{{#17430589567120.pod#}}) - - - 由于内存告警升高,需要分析其原因并提供解决方案。 - - # 输出要求 - - 展示内存指标数据的变化趋势(用简单语言描述,让人一看就懂)。 - - 提供相关建议,包括: - - 检查代码是否可能存在内存泄漏。 - - 通过日志分析问题根源等实用方法。 - - # 数据来源 - - - 容器内存数据:{{#17430593614550.text#}}。' - selected: false - title: 内存问题分析 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430593816310' - position: - x: 3678 - y: 774 - positionAbsolute: - x: 3678 - y: 774 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - desc: '' - isInIteration: true - iteration_id: '1741497176064' - output_type: string - selected: false - title: 结果汇总1 - type: variable-aggregator - variables: - - - '17430593816310' - - text - - - '17430594510140' - - text - - - '17430596469370' - - text - height: 152 - id: '17430594012660' - position: - x: 3982 - y: 904 - positionAbsolute: - x: 3982 - y: 904 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 893c9a67-e9e3-4c2c-8ed2-6301998d555b - role: system - text: 你是一个可观性领域的智能助手,帮助用户分析问题 - - id: ccfb4eb1-f253-415d-9a60-9ecab7bd6af4 - role: user - text: '该告警事件是一个事件类型 - - 影响了{{#17430589567120.pod#}},给出一些建议' - selected: false - title: 事件类型 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430594510140' + height: 53 + id: '17430610640640' position: - x: 3678 - y: 904 + x: 2757 + y: 1088 positionAbsolute: - x: 3678 - y: 904 + x: 2757 + y: 1088 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -4346,10 +5523,10 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: 线程在CPU上的耗时折线图(按Pod统计) (1) + title: thread time consumption on Runq(by Pod) tool_configurations: {} - tool_label: 线程在CPU上的耗时折线图(按Pod统计) - tool_name: 线程在CPU上的耗时折线图(按Pod统计) + tool_label: 线程在运行队列上的耗时折线图(按Pod统计) + tool_name: 线程在运行队列上的耗时折线图(按Pod统计) tool_parameters: endTime: type: variable @@ -4363,74 +5540,50 @@ workflow: type: variable value: - '1741227526517' - - startTime - type: tool - height: 54 - id: '17430595109950' - position: - x: 2462 - y: 979 - positionAbsolute: - x: 2462 - y: 979 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - desc: '' - isInIteration: true - is_team_authorization: true - iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name - max: null - min: null - name: cadvisor_job_name - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string + - startTime + type: tool + height: 53 + id: '17430610719970' + position: + x: 2757 + y: 996 + positionAbsolute: + x: 2757 + y: 996 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + desc: '' + isInIteration: true + is_team_authorization: true + iteration_id: '1741497176064' + output_schema: null + paramSchemas: - auto_generate: null default: null form: llm human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 + en_US: Specified pod name + ja_JP: Specified pod name + pt_BR: Specified pod name + zh_Hans: 指定的容器POD名称 label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace + en_US: pod + ja_JP: pod + pt_BR: pod + zh_Hans: pod + llm_description: Specified pod name max: null min: null - name: namespace + name: pod options: [] placeholder: null precision: null - required: false + required: true scope: null template: null type: string @@ -4438,23 +5591,23 @@ workflow: default: null form: llm human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 + en_US: Specified namespace + ja_JP: Specified namespace + pt_BR: Specified namespace + zh_Hans: 指定的容器所在Namespace label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name + en_US: namespace + ja_JP: namespace + pt_BR: namespace + zh_Hans: namespace + llm_description: Specified namespace max: null min: null - name: pod + name: namespace options: [] placeholder: null precision: null - required: false + required: true scope: null template: null type: string @@ -4462,16 +5615,16 @@ workflow: default: null form: llm human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + en_US: Data query start time + ja_JP: Data query start time + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time(Microsecond) + llm_description: Data query start time max: null min: null name: startTime @@ -4486,16 +5639,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) + en_US: Data query end time + ja_JP: Data query end time + pt_BR: Data query end time zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query end time(Microsecond) + llm_description: Data query start time max: null min: null name: endTime @@ -4507,7 +5660,6 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' namespace: '' pod: '' @@ -4516,11 +5668,10 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: 容器 CPU 使用率 + title: Container cpu throttling tool_configurations: {} - tool_label: Container CPU usage rate (Containerd runtime, aggregated by container - and Pod) - tool_name: 容器CPU使用率(使用Containerd容器运行时,按容器和Pod统计) + tool_label: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) + tool_name: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) tool_parameters: endTime: type: variable @@ -4539,147 +5690,23 @@ workflow: - '1741227526517' - startTime type: tool - height: 54 - id: '17430595158080' - position: - x: 2766 - y: 979 - positionAbsolute: - x: 2766 - y: 979 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 3ce935be-61a8-4ebe-ac8c-ed8039a2b3d3 - role: system - text: 你是一个可观测性领域的智能助手 - - id: 27e985b3-1039-4a38-9f9c-f9d78d83597d - role: user - text: '# 目的 - - 总结以下数据,使其简洁易懂: - - 1. 应用所有线程在 CPU 类型上的执行耗时数据 - - 2. 应用的 CPU 相关指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述,还可给出大部分线程的平均值耗时变化 - - 2. 耗时单位为纳秒(ns),需保留单位 - - 3. 确保描述简洁且用户易于理解 - - - # 数据 - - cpu耗时(单位:纳秒,ns): - - {{#17430595109950.text#}} - - cpu指标: - - {{#17430595158080.text#}}' - selected: false - title: cpu 分析 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430595248160' - position: - x: 3374 - y: 961 - positionAbsolute: - x: 3374 - y: 961 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.6 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: cd35fff4-a037-4e72-af99-2ff8299fc5d2 - role: system - text: 你是一个可观性领域的智能助手,帮助用户分析问题 - - id: 2b2ad468-efcd-4bcc-aeb9-d53d2f2770ad - role: user - text: "# 目的\n根据各方向的北极星指标数据,分析应用 {{#17430589567120.pod#}} 是否受到告警事件 {{#1742807803325.alertName#}}\ - \ 的影响,并初步判断告警的根因方向。\n# 输入数据说明\n\n各方向数据包含线程耗时及相关指标,例如:网络耗时会附带应用程序的网络 RTT\ - \ 指标。\n# 分析规则\n识别主要变化方向\n找出变化最大的数据类型(显著升高且幅度远超其他类型)。\n如果 CPU 或 runQ 耗时显著升高(且\ - \ net、epoll 无明显变化),则定位为 CPU 方向问题,避免误判为网络问题。\n结合线程历史 P90 数据,判断变化是否超出合理区间。\n\ - P90 定义:反映最大最小范围内的正常波动。需关注短时间内(1-2 个时间步)的异常突变(显著跳跃,超出平均变化率或趋势),忽略 P90 范围内的常规波动。\n\ - 若多种类型变化趋势接近,按以下优先级分析(从高到低)。\n根因方向及建议\nCPU 耗时升高:建议检查代码是否存在过多嵌套,确认问题后可回滚修复。\n\ - CPU 抢占高:建议登录机器,检查是否有其他应用程序抢占资源。\nNet 或 epoll 耗时显著升高:\n检查网络 RTT(单位:秒,<\ - \ 0.05 为正常)。\nRTT 异常:建议排查网络问题;RTT 正常:建议检查下游服务。\nFile 耗时升高:建议检查应用程序是否打开过多文件。\n\ - # 输出格式\n应用 {{#17430589567120.pod#}}\n北极星指标变化趋势总结\n简述各北极星指标变化情况。\n若无显著变化,明确说明:“未观察到明显变化”。\n\ - 告警事件初步根因结论\n说明告警是否影响应用。\n结合北极星指标及相关数据,分析可能的根因,并给出单一方向建议(参考分析规则)。\n注:若怀疑网络或\ - \ epoll 问题,且 RTT 正常,则定位为下游服务网络问题。\n# 输入数据 \n- cpu方向数据\n{{#17430595248160.text#}}\n\ - cpu耗时历史P90数据\n{{#1743149089034.text#}}\n- net 方向数据\n{{#17430598979590.text#}}\n\ - net耗时历史P90数据\n{{#17431493623970.text#}}\n- file 方向数据\n{{#17430598299820.text#}}\n\ - file耗时历史P90数据\n{{#17431493591600.text#}}\n- epoll方向数据\n{{#17430610680150.text#}}\n\ - epoll耗时历史P90数据\n{{#17431493655610.text#}}\n- runq方向数据\n{{#17430610794990.text#}}\n\ - runq耗时历史P90数据\n{{#17431493682530.text#}}\n\n# 注意事项\nP90 数据中,JSON 键包括线程\ - \ ID,max 和 min 表示过去 1 小时的最大最小 P90 值。\n输出语言需简洁清晰,避免过多技术术语,确保易读。" - selected: false - title: llm analysis root cause - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430596469370' + height: 53 + id: '17430610756270' position: - x: 3678 - y: 1239 + x: 3060 + y: 996 positionAbsolute: - x: 3678 - y: 1239 + x: 3060 + y: 996 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' - isInIteration: true is_team_authorization: true - iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -4706,6 +5733,30 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + label: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) + max: null + min: null + name: type + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -4758,14 +5809,15 @@ workflow: endTime: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 线程在文件操作上的耗时折线图(按Pod统计) (1) + title: CPU P90 tool_configurations: {} - tool_label: 线程在文件操作上的耗时折线图(按Pod统计) - tool_name: 线程在文件操作上的耗时折线图(按Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable @@ -4780,76 +5832,28 @@ workflow: value: - '1741227526517' - startTime + type: + type: mixed + value: cpu type: tool - height: 54 - id: '17430597987060' + height: 53 + id: '1743149089034' position: - x: 2462 - y: 1109 + x: 3363 + y: 720 positionAbsolute: - x: 2462 - y: 1109 + x: 3363 + y: 720 selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - desc: '' - isInIteration: true - is_team_authorization: true - iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - label: - en_US: cAdvisor job name - ja_JP: cAdvisor job name - pt_BR: cAdvisor job name - zh_Hans: cAdvisor任务名称 - llm_description: cAdvisor job name - max: null - min: null - name: cadvisor_job_name - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - label: - en_US: Namespace - ja_JP: Namespace - pt_BR: Namespace - zh_Hans: 命名空间 - llm_description: Namespace - max: null - min: null - name: namespace - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + desc: '' + is_team_authorization: true + output_schema: null + paramSchemas: - auto_generate: null default: null form: llm @@ -4874,13 +5878,37 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + label: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) + max: null + min: null + name: type + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm human_description: en_US: Data query start time(Microsecond) ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time(Microsecond) + pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: en_US: startTime @@ -4923,32 +5951,24 @@ workflow: template: null type: number params: - cadvisor_job_name: '' endTime: '' - namespace: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 容器读磁盘耗时 + title: file P90 tool_configurations: {} - tool_label: Container disk read time per second (Containerd runtime, aggregated - by container and Pod) - tool_name: 容器磁盘读取耗时每秒(使用Containerd,按Pod和容器统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: - cadvisor_job_name: - type: mixed - value: '' endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#17430589567120.namespace#}}' pod: type: mixed value: '{{#17430589567120.pod#}}' @@ -4957,93 +5977,26 @@ workflow: value: - '1741227526517' - startTime + type: + type: mixed + value: file type: tool - height: 54 - id: '17430598152780' - position: - x: 2766 - y: 1109 - positionAbsolute: - x: 2766 - y: 1109 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 2aacf14d-625b-435f-b564-d4882157fe1c - role: system - text: 你是一个可观测性领域的智能助手 - - id: fd4d9226-6f01-4d5d-bb05-c0d1cb570ed5 - role: user - text: '# 目的 - - 总结以下数据,使其简洁易懂: - - 1. 应用所有线程在 file 类型上的执行耗时数据 - - 2. 应用的 read disk 指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述 - - 2. 耗时单位为纳秒(ns),输出中保留单位 - - 3. 确保描述简洁且用户易于理解 - - - # 数据 - - file 耗时(单位:纳秒,ns): - - {{#17430597987060.text#}} - - - read disk 指标: - - {{#17430598152780.text#}}' - selected: false - title: file分析 - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430598299820' + height: 53 + id: '17431493591600' position: - x: 3374 - y: 1091 + x: 3363 + y: 812 positionAbsolute: - x: 3374 - y: 1091 + x: 3363 + y: 812 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' - isInIteration: true is_team_authorization: true - iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -5070,6 +6023,30 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + label: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) + max: null + min: null + name: type + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -5122,14 +6099,15 @@ workflow: endTime: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 线程在网络操作上的耗时折线图(按Pod统计) (1) + title: net P90 tool_configurations: {} - tool_label: 线程在网络操作上的耗时折线图(按Pod统计) - tool_name: 线程在网络操作上的耗时折线图(按Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable @@ -5144,42 +6122,42 @@ workflow: value: - '1741227526517' - startTime + type: + type: mixed + value: net type: tool - height: 54 - id: '17430598907140' + height: 53 + id: '17431493623970' position: - x: 2462 - y: 1239 + x: 3363 + y: 904 positionAbsolute: - x: 2462 - y: 1239 + x: 3363 + y: 904 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' - isInIteration: true is_team_authorization: true - iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null default: null form: llm human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null name: pod @@ -5194,19 +6172,19 @@ workflow: default: null form: llm human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) max: null min: null - name: namespace + name: type options: [] placeholder: null precision: null @@ -5218,8 +6196,8 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -5227,7 +6205,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -5242,16 +6220,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -5264,123 +6242,51 @@ workflow: type: number params: endTime: '' - namespace: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 容器网络RTT + title: epoll P90 tool_configurations: {} - tool_label: Query container rtt - tool_name: 查询容器网络与下游RTT + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#17430589567120.namespace#}}' pod: type: mixed - value: '{{#17430589567120.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: tool - height: 54 - id: '17430598942980' - position: - x: 2766 - y: 1239 - positionAbsolute: - x: 2766 - y: 1239 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 2fcf3791-e5a8-4c5b-9f9b-73753dedd9f7 - role: system - text: 你是一个可观测性领域的智能助手 - - id: 95e534cf-6856-4d33-bd3e-680aa819a13b - role: user - text: '# 目的 - - 总结以下数据,使其简洁易懂: - - 1. 应用所有线程在 net 类型上的执行耗时数据 - - 2. 应用的网络 RTT 指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述,还可给出大部分线程的平均值耗时变化 - - 2. 耗时单位为纳秒(ns),输出中保留单位 - - 3. RTT 指标单位为秒,若值小于 0.05 秒,则可附带说明“网络正常” - - 4. 确保描述简洁且用户易于理解 - - - # 数据 - - net 耗时(单位:纳秒,ns): - - {{#17430598907140.text#}} - - - 网络 RTT 指标(单位:秒,若值 < 0.05 则网络正常): - - {{#17430598942980.text#}}' - selected: false - title: 网络分析 (1) - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430598979590' + value: '{{#17430589567120.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: + type: mixed + value: epoll + type: tool + height: 53 + id: '17431493655610' position: - x: 3374 - y: 1221 + x: 3363 + y: 1088 positionAbsolute: - x: 3374 - y: 1221 + x: 3363 + y: 1088 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' - isInIteration: true is_team_authorization: true - iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -5407,6 +6313,30 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + label: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) + max: null + min: null + name: type + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -5459,14 +6389,15 @@ workflow: endTime: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 线程在Epoll操作上的耗时折线图(按Pod统计) (1) + title: Runq P90 tool_configurations: {} - tool_label: 线程在Epoll操作上的耗时折线图(按Pod统计) - tool_name: 线程在Epoll操作上的耗时折线图(按Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable @@ -5481,21 +6412,23 @@ workflow: value: - '1741227526517' - startTime + type: + type: mixed + value: runq type: tool - height: 54 - id: '17430610599980' + height: 53 + id: '17431493682530' position: - x: 2462 - y: 1369 + x: 3363 + y: 996 positionAbsolute: - x: 2462 - y: 1369 + x: 3363 + y: 996 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - zIndex: 1002 + width: 243 - data: desc: '' isInIteration: true @@ -5507,16 +6440,16 @@ workflow: default: null form: llm human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null name: pod @@ -5531,19 +6464,19 @@ workflow: default: null form: llm human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) max: null min: null - name: namespace + name: type options: [] placeholder: null precision: null @@ -5555,8 +6488,8 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -5564,7 +6497,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -5579,16 +6512,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -5601,116 +6534,49 @@ workflow: type: number params: endTime: '' - namespace: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 容器网络RTT + title: CPU P90 analysis tool_configurations: {} - tool_label: Query container rtt - tool_name: 查询容器网络与下游RTT + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#17430589567120.namespace#}}' pod: type: mixed - value: '{{#17430589567120.pod#}}' + value: '{{#1741497181784.pod#}}' startTime: type: variable value: - '1741227526517' - startTime + type: + type: mixed + value: cpu type: tool - height: 54 - id: '17430610640640' - position: - x: 2766 - y: 1369 - positionAbsolute: - x: 2766 - y: 1369 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - context: - enabled: false - variable_selector: [] - desc: '' - isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: 1f3e7592-c8f0-455a-8abb-23c74aaf5fb8 - role: system - text: 你是一个可观测性领域的智能助手 - - id: 9ed18fa7-b43f-4f11-ba13-2dcd03fc16c9 - role: user - text: '# 目的 - - 总结以下数据(异步与网络总结报告),使其简洁易懂: - - 1. 应用所有线程在 epoll 类型上的执行耗时数据 - - 2. 应用的网络 RTT 指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述,还可给出大部分线程的平均值耗时变化 - - 2. 耗时单位为纳秒(ns),输出中保留单位 - - 3. RTT 指标单位为秒,若值小于 0.05 秒,则可附带说明“网络正常” - - 4. 确保描述简洁且用户易于理解 - - - # 数据 - - epoll 耗时(单位:纳秒,ns): - - {{#17430610599980.text#}} - - 网络 RTT 指标(单位:秒,若值 < 0.05 则网络正常): - - {{#17430610640640.text#}}' - selected: false - title: epoll分析 (1) - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430610680150' + height: 53 + id: '1743149606391' + parentId: '1741497176064' position: - x: 3374 - y: 1351 + x: 1174.8261261305506 + y: 378.0882500223738 positionAbsolute: - x: 3374 - y: 1351 + x: 6437.282403410635 + y: 1294.0882500223738 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -5743,6 +6609,30 @@ workflow: scope: null template: null type: string + - auto_generate: null + default: null + form: llm + human_description: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + label: + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) + max: null + min: null + name: type + options: [] + placeholder: null + precision: null + required: false + scope: null + template: null + type: string - auto_generate: null default: null form: llm @@ -5795,14 +6685,15 @@ workflow: endTime: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 线程在运行队列上的耗时折线图(按Pod统计) (1) + title: Net P90 analysis tool_configurations: {} - tool_label: 线程在运行队列上的耗时折线图(按Pod统计) - tool_name: 线程在运行队列上的耗时折线图(按Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable @@ -5811,26 +6702,30 @@ workflow: - endTime pod: type: mixed - value: '{{#17430589567120.pod#}}' + value: '{{#1741497181784.pod#}}' startTime: type: variable value: - '1741227526517' - startTime + type: + type: mixed + value: net type: tool - height: 54 - id: '17430610719970' + height: 53 + id: '1743150910103' + parentId: '1741497176064' position: - x: 2462 - y: 1499 + x: 1483.3553424127522 + y: 574.6824876720586 positionAbsolute: - x: 2462 - y: 1499 + x: 6745.811619692837 + y: 1490.6824876720586 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: desc: '' @@ -5843,23 +6738,23 @@ workflow: default: null form: llm human_description: - en_US: Specified pod name - ja_JP: Specified pod name - pt_BR: Specified pod name - zh_Hans: 指定的容器POD名称 + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 label: - en_US: pod - ja_JP: pod - pt_BR: pod - zh_Hans: pod - llm_description: Specified pod name + en_US: Pod name + ja_JP: Pod name + pt_BR: Pod name + zh_Hans: Pod名称 + llm_description: Pod name max: null min: null name: pod options: [] placeholder: null precision: null - required: true + required: false scope: null template: null type: string @@ -5867,23 +6762,23 @@ workflow: default: null form: llm human_description: - en_US: Specified namespace - ja_JP: Specified namespace - pt_BR: Specified namespace - zh_Hans: 指定的容器所在Namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) label: - en_US: namespace - ja_JP: namespace - pt_BR: namespace - zh_Hans: namespace - llm_description: Specified namespace + en_US: Type (cpu,net,file,epoll,runq) + ja_JP: Type (cpu,net,file,epoll,runq) + pt_BR: Type (cpu,net,file,epoll,runq) + zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) + llm_description: Type (cpu,net,file,epoll,runq) max: null min: null - name: namespace + name: type options: [] placeholder: null precision: null - required: true + required: false scope: null template: null type: string @@ -5891,8 +6786,8 @@ workflow: default: null form: llm human_description: - en_US: Data query start time - ja_JP: Data query start time + en_US: Data query start time(Microsecond) + ja_JP: Data query start time(Microsecond) pt_BR: Data query start time zh_Hans: 开始时间 (微秒) label: @@ -5900,7 +6795,7 @@ workflow: ja_JP: startTime pt_BR: startTime zh_Hans: startTime - llm_description: Data query start time + llm_description: Data query start time(Microsecond) max: null min: null name: startTime @@ -5915,16 +6810,16 @@ workflow: default: null form: llm human_description: - en_US: Data query end time - ja_JP: Data query end time - pt_BR: Data query end time + en_US: Data query end time(Microsecond) + ja_JP: Data query end time(Microsecond) + pt_BR: Data query end time(Microsecond) zh_Hans: 结束时间 (微秒) label: en_US: endTime ja_JP: endTime pt_BR: endTime zh_Hans: endTime - llm_description: Data query start time + llm_description: Data query end time(Microsecond) max: null min: null name: endTime @@ -5937,119 +6832,55 @@ workflow: type: number params: endTime: '' - namespace: '' pod: '' startTime: '' + type: '' provider_id: apo_select provider_name: apo_select provider_type: builtin selected: false - title: 容器CPU节流时间 + title: FILE P90 analysis tool_configurations: {} - tool_label: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) - tool_name: 容器CPU节流时长(使用Containerd容器运行时,按容器和Pod统计) + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 tool_parameters: endTime: type: variable value: - '1741227526517' - endTime - namespace: - type: mixed - value: '{{#17430589567120.namespace#}}' pod: type: mixed - value: '{{#17430589567120.pod#}}' + value: '{{#1741497181784.pod#}}' startTime: type: variable value: - '1741227526517' - startTime + type: + type: mixed + value: file type: tool - height: 54 - id: '17430610756270' + height: 53 + id: '1743152043813' + parentId: '1741497176064' position: - x: 2766 - y: 1499 + x: 1156.6165679157248 + y: 475.1754672301147 positionAbsolute: - x: 2766 - y: 1499 + x: 6419.072845195809 + y: 1391.1754672301147 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: - context: - enabled: false - variable_selector: [] desc: '' isInIteration: true - iteration_id: '1741497176064' - model: - completion_params: - temperature: 0.7 - mode: chat - name: deepseek-chat - provider: langgenius/deepseek/deepseek - prompt_template: - - id: b4463776-4368-40e5-b3ea-28a179ebc11c - role: system - text: 你是一个可观测性领域的智能助手 - - id: 44df105c-0a0a-4147-ae4a-7e4bda7bb3af - role: user - text: '# 目的 - - 总结以下数据,使其简洁易懂: - - 1. 应用所有线程在 runq 类型上的执行耗时数据 - - 2. 应用的 CPU Throttle Time 指标数据 - - - # 注意 - - 1. 输出总结可以带上线程数量相关描述 - - 2. 耗时单位为纳秒(ns),输出中保留单位 - - 3. 确保描述简洁且用户易于理解 - - - # 数据 - - runq 耗时(单位:纳秒,ns): - - {{#17430610719970.text#}} - - - CPU Throttle Time 指标: - - {{#17430610756270.text#}}' - selected: false - title: runq分析 (1) - type: llm - variables: [] - vision: - enabled: false - height: 90 - id: '17430610794990' - position: - x: 3374 - y: 1481 - positionAbsolute: - x: 3374 - y: 1481 - selected: false - sourcePosition: right - targetPosition: left - type: custom - width: 244 - zIndex: 1002 - - data: - desc: '' is_team_authorization: true + iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -6157,7 +6988,7 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: CPU P90 + title: EPOLL P90 analysis tool_configurations: {} tool_label: Thread Polaris Metrics P90 tool_name: 线程北极星P90数据 @@ -6169,7 +7000,7 @@ workflow: - endTime pod: type: mixed - value: '{{#17430589567120.pod#}}' + value: '{{#1741497181784.pod#}}' startTime: type: variable value: @@ -6177,24 +7008,28 @@ workflow: - startTime type: type: mixed - value: cpu + value: epoll type: tool - height: 54 - id: '1743149089034' + height: 53 + id: '1743152103020' + parentId: '1741497176064' position: - x: 3070 - y: 979 + x: 1463.2885127206846 + y: 673.674875984598 positionAbsolute: - x: 3070 - y: 979 + x: 6725.744790000769 + y: 1589.674875984598 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 + zIndex: 1002 - data: desc: '' + isInIteration: true is_team_authorization: true + iteration_id: '1741497176064' output_schema: null paramSchemas: - auto_generate: null @@ -6302,1222 +7137,2204 @@ workflow: provider_name: apo_select provider_type: builtin selected: false - title: file P90 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#17430589567120.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: file - type: tool - height: 54 - id: '17431493591600' + title: RUNQ P90 analysis + tool_configurations: {} + tool_label: Thread Polaris Metrics P90 + tool_name: 线程北极星P90数据 + tool_parameters: + endTime: + type: variable + value: + - '1741227526517' + - endTime + pod: + type: mixed + value: '{{#1741497181784.pod#}}' + startTime: + type: variable + value: + - '1741227526517' + - startTime + type: + type: mixed + value: runq + type: tool + height: 53 + id: '1743152169252' + parentId: '1741497176064' + position: + x: 1141.3922062676138 + y: 805.1816882600981 + positionAbsolute: + x: 6403.848483547698 + y: 1721.181688260098 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430595109950' + - text + variable: data_json + - value_selector: + - '1743149089034' + - text + variable: avg_json + height: 53 + id: '1744185676164' + position: + x: 3666 + y: 720 + positionAbsolute: + x: 3666 + y: 720 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430597987060' + - text + variable: data_json + - value_selector: + - '17431493591600' + - text + variable: avg_json + height: 53 + id: '17441926182400' + position: + x: 3666 + y: 812 + positionAbsolute: + x: 3666 + y: 812 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430598907140' + - text + variable: data_json + - value_selector: + - '17431493623970' + - text + variable: avg_json + height: 53 + id: '17441926217060' + position: + x: 3666 + y: 904 + positionAbsolute: + x: 3666 + y: 904 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430610599980' + - text + variable: data_json + - value_selector: + - '17431493655610' + - text + variable: avg_json + height: 53 + id: '17441926243210' + position: + x: 3666 + y: 1088 + positionAbsolute: + x: 3666 + y: 1088 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get abnormal data + type: code + variables: + - value_selector: + - '17430610719970' + - text + variable: data_json + - value_selector: + - '17431493682530' + - text + variable: avg_json + height: 53 + id: '17441926286390' + position: + x: 3666 + y: 996 + positionAbsolute: + x: 3666 + y: 996 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980720651' + - text + variable: data_json + - value_selector: + - '1743149606391' + - text + variable: avg_json + height: 53 + id: '1744206107700' + parentId: '1741497176064' + position: + x: 1488.8192785924111 + y: 373.13327676062727 + positionAbsolute: + x: 6751.275555872496 + y: 1289.1332767606273 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980748320' + - text + variable: data_json + - value_selector: + - '1743152043813' + - text + variable: avg_json + height: 53 + id: '1744206199211' + parentId: '1741497176064' + position: + x: 1487.2988857309501 + y: 474.870200391917 + positionAbsolute: + x: 6749.755163011035 + y: 1390.870200391917 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980780865' + - text + variable: data_json + - value_selector: + - '1743150910103' + - text + variable: avg_json + height: 53 + id: '1744206249528' + parentId: '1741497176064' position: - x: 3070 - y: 1109 + x: 1789.9724165332118 + y: 575.9896449249493 positionAbsolute: - x: 3070 - y: 1109 + x: 7052.428693813296 + y: 1491.9896449249493 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 + zIndex: 1002 - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 desc: '' - is_team_authorization: true - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980837261' + - text + variable: data_json + - value_selector: + - '1743152103020' + - text + variable: avg_json + height: 53 + id: '1744206286177' + parentId: '1741497176064' + position: + x: 1789.4007677668633 + y: 673.2187341513443 + positionAbsolute: + x: 7051.857045046948 + y: 1589.2187341513443 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str, avg_json: str) -> dict:\n data = json.loads(data_json)\n\ + \ timeseries = data.get('data', {}).get('timeseries', [])\n \n \ + \ if len(timeseries) == 0:\n return {\n \"result\": \"\ + []\"\n }\n unit = data.get('unit', '')\n parsed_avg = json.loads(avg_json)\n\ + \ \n try:\n avgs = json.loads(parsed_avg.get(\"data\", \"{}\"\ + ))\n except json.JSONDecodeError:\n avgs = {}\n\n filtered\ + \ = []\n for metric in timeseries:\n tid = metric['labels']['tid']\n\ + \ avg = avgs.get(tid, {}).get('avg', 0)\n if avg == 0 :\n\ + \ continue\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/avg > 1.2:\n count += 1\n\n if count\ + \ / len(chart) >= 0.2:\n res = {\n \"chart\":\ + \ chart,\n \"abnormalCount\": count,\n \"\ + tid\": tid,\n \"avg\": avg,\n \"unit\": unit\n\ + \ }\n filtered.append(res)\n\n return {\n \ + \ \"result\": json.dumps(filtered)\n }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. Get abnormal data + type: code + variables: + - value_selector: + - '1742980885557' + - text + variable: data_json + - value_selector: + - '1743152169252' + - text + variable: avg_json + height: 53 + id: '1744206314118' + parentId: '1741497176064' + position: + x: 1465.3401312758333 + y: 804.853363697991 + positionAbsolute: + x: 6727.796408555918 + y: 1720.853363697991 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str) -> dict:\n timeseries = json.loads(data_json).get('data',\ + \ {}).get('timeseries', [])\n \n normal = 0.05\n filtered =\ + \ []\n for metric in timeseries:\n pod = metric.get('labels',\ + \ {}).get('dst_pod', '')\n if len(pod) == 0:\n pod = metric.get('labels',\ + \ {}).get('pid', '')\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/normal > 1.2:\n count += 1\n\n if\ + \ count / len(chart) >= 0.2:\n res = {\n \"chart\"\ + : chart,\n \"abnormalCount\": count,\n \"\ + dst_pod\": pod,\n \"normal\": normal\n }\n \ + \ filtered.append(res)\n\n return {\n \"result\": json.dumps(filtered)\n\ + \ }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get epoll abnormal rtt + type: code + variables: + - value_selector: + - '17430610640640' + - text + variable: data_json + height: 53 + id: '1744255998058' + position: + x: 3060 + y: 1088 + positionAbsolute: + x: 3060 + y: 1088 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str) -> dict:\n timeseries = json.loads(data_json).get('data',\ + \ {}).get('timeseries', [])\n \n normal = 0.05\n filtered =\ + \ []\n for metric in timeseries:\n pod = metric.get('labels',\ + \ {}).get('dst_pod', '')\n if len(pod) == 0:\n pod = metric.get('labels',\ + \ {}).get('pid', '')\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/normal > 1.2:\n count += 1\n\n if\ + \ count / len(chart) >= 0.2:\n res = {\n \"chart\"\ + : chart,\n \"abnormalCount\": count,\n \"\ + dst_pod\": pod,\n \"normal\": normal\n }\n \ + \ filtered.append(res)\n\n return {\n \"result\": json.dumps(filtered)\n\ + \ }" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: Get net abnormal rtt + type: code + variables: + - value_selector: + - '17430598942980' + - text + variable: data_json + height: 53 + id: '17442560822670' + position: + x: 3060 + y: 904 + positionAbsolute: + x: 3060 + y: 904 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='epoll')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n \n if type == 'net' or type == 'epoll':\n return\ + \ net_analyze(abnormal_data=abnormal_data, proof_data=proof_data)\n elif\ + \ type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in proof_data:\n dst_pod = data.get('dst_pod',\ + \ '')\n if dst_pod == '':\n continue\n\n related.append(dst_pod)\n\ + \ \n return {\n 'abnormalAnalysis': analysis,\n 'related':\ + \ related\n }\n\ndef runq_analyze(abnormal_data: list) -> dict:\n \ + \ analysis = get_analysis_data(abnormal_data=abnormal_data)\n\n return\ + \ {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n pods = analysis.get(\"related\", [])\n if\ + \ len(pods) > 0 :\n pods_str = \", \".join(pods)\n \ + \ item_str += f\"{pods_str}. The RTT raised about 20% than 0.05s over 20%\ + \ time samples. \"\n else:\n item_str = 'The RTT is normal.'\n\ + \ else:\n item_type = 'threads'\n\n threads = analysis.get(\"\ + related\", [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n if type == 'net' or type == 'epoll':\n\ + \ related_str = item_str\n else:\n related_str\ + \ = f\"The most related {item_type} are {item_str} \"\n \n return\ + \ f\"There are {len(analysis['abnormalAnalysis'])} abnormal threads. \"\ + \ + related_str\n " + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: EPOLL analyze + type: code + variables: + - value_selector: + - '17441926243210' + - result + variable: data_json + - value_selector: + - '1744255998058' + - result + variable: proof_json + height: 53 + id: '1744287265980' + position: + x: 3969 + y: 1088 + positionAbsolute: + x: 3969 + y: 1088 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'epoll')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: to template epoll + type: code + variables: + - value_selector: + - '1744287265980' + - result + variable: data_json + height: 53 + id: '1744290470304' + position: + x: 4272 + y: 1088 + positionAbsolute: + x: 4272 + y: 1088 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='runq')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n related_str =\ + \ ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string selected: false - title: net P90 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#17430589567120.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: net - type: tool - height: 54 - id: '17431493623970' + title: RUNQ analyze + type: code + variables: + - value_selector: + - '17441926286390' + - result + variable: data_json + - value_selector: + - '17430610756270' + - text + variable: proof_json + height: 53 + id: '17443356883380' position: - x: 3070 - y: 1239 + x: 3969 + y: 996 positionAbsolute: - x: 3070 - y: 1239 + x: 3969 + y: 996 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - - data: + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='net')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n \n if type == 'net' or type == 'epoll':\n return\ + \ net_analyze(abnormal_data=abnormal_data, proof_data=proof_data)\n elif\ + \ type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in proof_data:\n dst_pod = data.get('dst_pod',\ + \ '')\n if dst_pod == '':\n continue\n\n related.append(dst_pod)\n\ + \ \n return {\n 'abnormalAnalysis': analysis,\n 'related':\ + \ related\n }\n\ndef runq_analyze(abnormal_data: list) -> dict:\n \ + \ analysis = get_analysis_data(abnormal_data=abnormal_data)\n\n return\ + \ {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n pods = analysis.get(\"related\", [])\n if\ + \ len(pods) > 0 :\n pods_str = \", \".join(pods)\n \ + \ item_str += f\"{pods_str}. The RTT raised about 20% than 0.05s over 20%\ + \ time samples. \"\n else:\n item_str = 'The RTT is normal.'\n\ + \ else:\n item_type = 'threads'\n\n threads = analysis.get(\"\ + related\", [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n if type == 'net' or type == 'epoll':\n\ + \ related_str = item_str\n else:\n related_str\ + \ = f\"The most related {item_type} are {item_str} \"\n \n return\ + \ f\"There are {len(analysis['abnormalAnalysis'])} abnormal threads. \"\ + \ + related_str\n " + code_language: python3 desc: '' - is_team_authorization: true - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: epoll P90 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#17430589567120.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: epoll - type: tool - height: 54 - id: '17431493655610' + title: NET analyze + type: code + variables: + - value_selector: + - '17441926217060' + - result + variable: data_json + - value_selector: + - '17442560822670' + - result + variable: proof_json + height: 53 + id: '17443357536900' + position: + x: 3969 + y: 904 + positionAbsolute: + x: 3969 + y: 904 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='file')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: DISK analyze + type: code + variables: + - value_selector: + - '17441926182400' + - result + variable: data_json + - value_selector: + - '17430598152780' + - text + variable: proof_json + height: 53 + id: '17443357893440' + position: + x: 3969 + y: 812 + positionAbsolute: + x: 3969 + y: 812 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='cpu')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: CPU analyze + type: code + variables: + - value_selector: + - '1744185676164' + - result + variable: data_json + - value_selector: + - '17430595158080' + - text + variable: proof_json + height: 53 + id: '17443357899060' + position: + x: 3969 + y: 720 + positionAbsolute: + x: 3969 + y: 720 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'file')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: to template file + type: code + variables: + - value_selector: + - '17443357893440' + - result + variable: data_json + height: 53 + id: '17443388421360' + position: + x: 4272 + y: 812 + positionAbsolute: + x: 4272 + y: 812 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'cpu')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + outputs: + result: + children: null + type: string + selected: false + title: to template cpu + type: code + variables: + - value_selector: + - '17443357899060' + - result + variable: data_json + height: 53 + id: '17443388433580' position: - x: 3070 - y: 1369 + x: 4272 + y: 720 positionAbsolute: - x: 3070 - y: 1369 + x: 4272 + y: 720 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - - data: + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 desc: '' - is_team_authorization: true - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: Runq P90 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#17430589567120.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: runq - type: tool - height: 54 - id: '17431493682530' + title: to template net + type: code + variables: + - value_selector: + - '17443357536900' + - result + variable: data_json + height: 53 + id: '17443388438160' position: - x: 3070 - y: 1499 + x: 4272 + y: 904 positionAbsolute: - x: 3070 - y: 1499 + x: 4272 + y: 904 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 - - data: + width: 243 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'runq')\n return {\"result\": markdown}" + code_language: python3 desc: '' - isInIteration: true - is_team_authorization: true - iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: CPU P90分析 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: cpu - type: tool - height: 54 - id: '1743149606391' + title: to template runq + type: code + variables: + - value_selector: + - '17443356883380' + - result + variable: data_json + height: 53 + id: '17443388443000' + position: + x: 4272 + y: 996 + positionAbsolute: + x: 4272 + y: 996 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + - data: + code: "def main(data_json: str) -> dict:\n timeseries = json.loads(data_json).get('data',\ + \ {}).get('timeseries', [])\n \n normal = 0.05\n filtered =\ + \ []\n for metric in timeseries:\n pod = metric.get('labels',\ + \ {}).get('dst_pod', '')\n if len(pod) == 0:\n pod = metric.get('labels',\ + \ {}).get('pid', '')\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/normal > 1.2:\n count += 1\n\n if\ + \ count / len(chart) >= 0.2:\n res = {\n \"chart\"\ + : chart,\n \"abnormalCount\": count,\n \"\ + dst_pod\": pod,\n \"normal\": normal\n }\n \ + \ filtered.append(res)\n\n return {\n \"result\": json.dumps(filtered)\n\ + \ }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: EPOLL ABNORMAL RTT + type: code + variables: + - value_selector: + - '1742798505742' + - text + variable: data_json + height: 53 + id: '1744342068305' + parentId: '1741497176064' + position: + x: 1163.2885127206846 + y: 673.674875984598 + positionAbsolute: + x: 6425.744790000769 + y: 1589.674875984598 + selected: true + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "def main(data_json: str) -> dict:\n timeseries = json.loads(data_json).get('data',\ + \ {}).get('timeseries', [])\n \n normal = 0.05\n filtered =\ + \ []\n for metric in timeseries:\n pod = metric.get('labels',\ + \ {}).get('dst_pod', '')\n if len(pod) == 0:\n pod = metric.get('labels',\ + \ {}).get('pid', '')\n\n chart = metric.get('chart', {}).get('chartData',\ + \ {})\n count = 0\n for _, value in chart.items():\n \ + \ if value/normal > 1.2:\n count += 1\n\n if\ + \ count / len(chart) >= 0.2:\n res = {\n \"chart\"\ + : chart,\n \"abnormalCount\": count,\n \"\ + dst_pod\": pod,\n \"normal\": normal\n }\n \ + \ filtered.append(res)\n\n return {\n \"result\": json.dumps(filtered)\n\ + \ }" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: NET ABNORMAL RTT + type: code + variables: + - value_selector: + - '1742547917612' + - text + variable: data_json + height: 53 + id: '1744342138380' parentId: '1741497176064' position: - x: 1184.215435237168 - y: 391.23328277163773 + x: 1183.3553424127522 + y: 574.6824876720586 positionAbsolute: - x: 5470.215435237168 - y: 1295.2332827716377 + x: 6445.811619692837 + y: 1490.6824876720586 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='cpu')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 desc: '' isInIteration: true - is_team_authorization: true iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: Net P90分析 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: net - type: tool - height: 54 - id: '1743150910103' + title: it. cpu analyze + type: code + variables: + - value_selector: + - '1744206107700' + - result + variable: data_json + - value_selector: + - '1742980228913' + - text + variable: proof_json + height: 53 + id: '1744342244843' + parentId: '1741497176064' + position: + x: 1791.8192785924111 + y: 371.13327676062727 + positionAbsolute: + x: 7054.275555872496 + y: 1287.1332767606273 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='file')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. file analyze + type: code + variables: + - value_selector: + - '1744206199211' + - result + variable: data_json + - value_selector: + - '1742980318484' + - text + variable: proof_json + height: 53 + id: '1744342309386' + parentId: '1741497176064' + position: + x: 1790.2988857309501 + y: 474.870200391917 + positionAbsolute: + x: 7052.755163011035 + y: 1390.870200391917 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='net')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n \n if type == 'net' or type == 'epoll':\n return\ + \ net_analyze(abnormal_data=abnormal_data, proof_data=proof_data)\n elif\ + \ type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in proof_data:\n dst_pod = data.get('dst_pod',\ + \ '')\n if dst_pod == '':\n continue\n\n related.append(dst_pod)\n\ + \ \n return {\n 'abnormalAnalysis': analysis,\n 'related':\ + \ related\n }\n\ndef runq_analyze(abnormal_data: list) -> dict:\n \ + \ analysis = get_analysis_data(abnormal_data=abnormal_data)\n\n return\ + \ {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n pods = analysis.get(\"related\", [])\n if\ + \ len(pods) > 0 :\n pods_str = \", \".join(pods)\n \ + \ item_str += f\"{pods_str}. The RTT raised about 20% than 0.05s over 20%\ + \ time samples. \"\n else:\n item_str = 'The RTT is normal.'\n\ + \ else:\n item_type = 'threads'\n\n threads = analysis.get(\"\ + related\", [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n if type == 'net' or type == 'epoll':\n\ + \ related_str = item_str\n else:\n related_str\ + \ = f\"The most related {item_type} are {item_str} \"\n \n return\ + \ f\"There are {len(analysis['abnormalAnalysis'])} abnormal threads. \"\ + \ + related_str\n " + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. net analyze + type: code + variables: + - value_selector: + - '1744206249528' + - result + variable: data_json + - value_selector: + - '1744342138380' + - result + variable: proof_json + height: 53 + id: '1744342372882' parentId: '1741497176064' position: - x: 1183.3553424127522 - y: 574.6824876720586 + x: 2092.972416533212 + y: 575.9896449249493 positionAbsolute: - x: 5469.355342412752 - y: 1478.6824876720586 + x: 7355.428693813296 + y: 1491.9896449249493 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='epoll')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n \n if type == 'net' or type == 'epoll':\n return\ + \ net_analyze(abnormal_data=abnormal_data, proof_data=proof_data)\n elif\ + \ type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in proof_data:\n dst_pod = data.get('dst_pod',\ + \ '')\n if dst_pod == '':\n continue\n\n related.append(dst_pod)\n\ + \ \n return {\n 'abnormalAnalysis': analysis,\n 'related':\ + \ related\n }\n\ndef runq_analyze(abnormal_data: list) -> dict:\n \ + \ analysis = get_analysis_data(abnormal_data=abnormal_data)\n\n return\ + \ {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n pods = analysis.get(\"related\", [])\n if\ + \ len(pods) > 0 :\n pods_str = \", \".join(pods)\n \ + \ item_str += f\"{pods_str}. The RTT raised about 20% than 0.05s over 20%\ + \ time samples. \"\n else:\n item_str = 'The RTT is normal.'\n\ + \ else:\n item_type = 'threads'\n\n threads = analysis.get(\"\ + related\", [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n if type == 'net' or type == 'epoll':\n\ + \ related_str = item_str\n else:\n related_str\ + \ = f\"The most related {item_type} are {item_str} \"\n \n return\ + \ f\"There are {len(analysis['abnormalAnalysis'])} abnormal threads. \"\ + \ + related_str\n " + code_language: python3 desc: '' isInIteration: true - is_team_authorization: true iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: FILE P90分析 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: file - type: tool - height: 54 - id: '1743152043813' + title: it. epoll analyze + type: code + variables: + - value_selector: + - '1744206286177' + - result + variable: data_json + - value_selector: + - '1744342068305' + - result + variable: proof_json + height: 53 + id: '1744342426374' parentId: '1741497176064' position: - x: 1156.6165679157248 - y: 475.1754672301147 + x: 2092.4007677668633 + y: 673.2187341513443 positionAbsolute: - x: 5442.616567915725 - y: 1379.1754672301147 + x: 7354.857045046948 + y: 1589.2187341513443 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: + code: "import json\n\n\ndef main(data_json: str, proof_json: str, type='cpu')\ + \ -> dict:\n data = json.loads(data_json)\n proof_data = json.loads(proof_json)\n\ + \ \n analysis = analyze_abnormal_data(data, proof_data, type)\n \ + \ summary = get_summary(analysis=analysis, type=type)\n\n analysis['summary']\ + \ = summary\n return {\n \"result\": json.dumps(analysis)\n \ + \ }\n\ndef analyze_abnormal_data(abnormal_data, proof_data, type: str)\ + \ -> dict:\n if len(abnormal_data) == 0:\n return {}\n \n \ + \ if type == 'net' or type == 'epoll':\n return net_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n elif type == 'runq':\n return runq_analyze(abnormal_data=abnormal_data)\n\ + \ else:\n return consistent_analyze(abnormal_data=abnormal_data,\ + \ proof_data=proof_data)\n\n\ndef consistent_analyze(abnormal_data: list,\ + \ proof_data: dict) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n timeseries = proof_data.get('data', {}).get('timeseries', [])\n \ + \ proof_chart = {}\n if len(timeseries) > 0:\n proof_chart =\ + \ timeseries[0].get('chart', {}).get('chartData', {})\n related_threads\ + \ = find_similar_charts(abnormal_data=abnormal_data, proof_chart=proof_chart,\ + \ id_key='tid') \n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related_threads\n }\n\ndef find_similar_charts(abnormal_data,\ + \ proof_chart, id_key: str, threshold=0.8):\n if not abnormal_data or\ + \ not proof_chart:\n return []\n\n def cosine_sim(a, b):\n \ + \ dot_product = sum(x * y for x, y in zip(a, b))\n norm_a = sum(x**2\ + \ for x in a) ** 0.5\n norm_b = sum(y**2 for y in b) ** 0.5\n \ + \ if norm_a == 0 or norm_b == 0:\n return 0.0\n return\ + \ dot_product / (norm_a * norm_b)\n\n similar = []\n for data in abnormal_data:\n\ + \ chart = data['chart']\n tid = data[id_key]\n \n \ + \ common_ts = set(chart.keys()) & set(proof_chart.keys())\n \ + \ if not common_ts:\n continue\n \n sorted_ts\ + \ = sorted(common_ts)\n a = [chart[ts] for ts in sorted_ts]\n \ + \ b = [proof_chart[ts] for ts in sorted_ts]\n \n similarity\ + \ = cosine_sim(a, b)\n if similarity >= threshold:\n similar.append((tid,\ + \ similarity))\n \n similar.sort(key=lambda x: x[1], reverse=True)\n\ + \ return [item[0] for item in similar]\n\ndef net_analyze(abnormal_data:\ + \ list, proof_data: list) -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n related = []\n for data in abnormal_data:\n chart = data.get('chart',\ + \ {})\n\n tid = data.get('tid', '')\n if tid == '':\n \ + \ continue\n\n # find which downstream pod is related to this\ + \ thread\n res = find_similar_charts(proof_data, chart, id_key='dst_pod')\n\ + \n related.append({\n 'tid': tid,\n 'relatedItems':\ + \ res,\n })\n \n return {\n 'abnormalAnalysis': analysis,\n\ + \ 'related': related\n }\n\ndef runq_analyze(abnormal_data: list)\ + \ -> dict:\n analysis = get_analysis_data(abnormal_data=abnormal_data)\n\ + \n return {\n 'abnormalAnalysis': analysis,\n }\n\ndef get_analysis_data(abnormal_data):\n\ + \ \"\"\"Get abnormal count, chart, spikes, avg\"\"\"\n analysis =\ + \ []\n\n for data in abnormal_data:\n chart = data['chart']\n\ + \ abnormal_count = data['abnormalCount']\n unit = data['unit']\n\ + \ \n values = sorted(chart.values(), reverse=True)\n \ + \ spikes = values[:abnormal_count]\n analysis.append({\n \ + \ 'tid': data['tid'],\n 'abnormalCount': abnormal_count,\n\ + \ 'spikes': spikes,\n 'avg': data['avg'],\n \ + \ 'unit': unit\n })\n\n return analysis\n\ndef get_summary(analysis:\ + \ dict, type: str) -> str:\n \"\"\"\n 生成异常线程报告\n :param abnormal_count:\ + \ 异常线程数量 (int)\n :param related_items: 相关项列表 (list)\n :param item_type:\ + \ 相关项类型名称 (str, default: \"threads\")\n :return: 格式化报告字符串\n \"\"\"\ + \n if analysis == {}:\n good_str = f\"Thread consumption on {type}\ + \ is normal.\"\n return 'No abnormal data was observed. ' + good_str\n\ + \ \n item_type = ''\n item_str = ''\n if type == 'net' or type\ + \ == 'epoll':\n item_type = 'downstream pods'\n for item in\ + \ analysis.get(\"related\", []):\n tid = item.get(\"tid\", \"\ + \")\n if tid == '':\n continue\n\n \ + \ pods = item.get(\"relatedItems\", [])\n pods = item.get(\"\ + relatedItems\", [])\n if len(pods) == 0 :\n continue\n\ + \ \n pods_str = \", \".join(pods)\n item_str +=\ + \ f\"thread {tid}: affected by {pods_str}. The RTT between them raised about\ + \ 20% over 20% time samples.\"\n \n \n else:\n\ + \ item_type = 'threads'\n\n threads = analysis.get(\"related\"\ + , [])\n threads_str = \", \".join(threads)\n if len(threads_str)\ + \ > 0:\n item_str += threads_str + \". \"\n\n related_str\ + \ = ''\n if len(item_str) > 0:\n related_str = f\"The most related\ + \ {item_type} are {item_str}. \"\n return f\"There are {len(analysis['abnormalAnalysis'])}\ + \ abnormal threads. \" + related_str\n " + code_language: python3 desc: '' isInIteration: true - is_team_authorization: true iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: EPOLL P90分析 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: epoll - type: tool - height: 54 - id: '1743152103020' + title: it. runq analyze + type: code + variables: + - value_selector: + - '1744206314118' + - result + variable: data_json + - value_selector: + - '17430610756270' + - text + variable: proof_json + height: 53 + id: '1744342478278' parentId: '1741497176064' position: - x: 1180.802273988861 - y: 721.6803898302928 + x: 1768.3401312758333 + y: 804.853363697991 positionAbsolute: - x: 5466.802273988861 - y: 1625.6803898302928 + x: 7030.796408555918 + y: 1720.853363697991 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'runq')\n return {\"result\": markdown}" + code_language: python3 desc: '' isInIteration: true - is_team_authorization: true iteration_id: '1741497176064' - output_schema: null - paramSchemas: - - auto_generate: null - default: null - form: llm - human_description: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - label: - en_US: Pod name - ja_JP: Pod name - pt_BR: Pod name - zh_Hans: Pod名称 - llm_description: Pod name - max: null - min: null - name: pod - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - label: - en_US: Type (cpu,net,file,epoll,runq) - ja_JP: Type (cpu,net,file,epoll,runq) - pt_BR: Type (cpu,net,file,epoll,runq) - zh_Hans: 线程执行类型(cpu,net,file,epoll,runq) - llm_description: Type (cpu,net,file,epoll,runq) - max: null - min: null - name: type - options: [] - placeholder: null - precision: null - required: false - scope: null - template: null - type: string - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query start time(Microsecond) - ja_JP: Data query start time(Microsecond) - pt_BR: Data query start time - zh_Hans: 开始时间 (微秒) - label: - en_US: startTime - ja_JP: startTime - pt_BR: startTime - zh_Hans: startTime - llm_description: Data query start time(Microsecond) - max: null - min: null - name: startTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - - auto_generate: null - default: null - form: llm - human_description: - en_US: Data query end time(Microsecond) - ja_JP: Data query end time(Microsecond) - pt_BR: Data query end time(Microsecond) - zh_Hans: 结束时间 (微秒) - label: - en_US: endTime - ja_JP: endTime - pt_BR: endTime - zh_Hans: endTime - llm_description: Data query end time(Microsecond) - max: null - min: null - name: endTime - options: [] - placeholder: null - precision: null - required: true - scope: null - template: null - type: number - params: - endTime: '' - pod: '' - startTime: '' - type: '' - provider_id: apo_select - provider_name: apo_select - provider_type: builtin + outputs: + result: + children: null + type: string selected: false - title: RUNQ P90分析 - tool_configurations: {} - tool_label: Thread Polaris Metrics P90 - tool_name: 线程北极星P90数据 - tool_parameters: - endTime: - type: variable - value: - - '1741227526517' - - endTime - pod: - type: mixed - value: '{{#1741497181784.pod#}}' - startTime: - type: variable - value: - - '1741227526517' - - startTime - type: - type: mixed - value: runq - type: tool - height: 54 - id: '1743152169252' + title: it. to template runq + type: code + variables: + - value_selector: + - '1744342478278' + - result + variable: data_json + height: 53 + id: '1744342609856' + parentId: '1741497176064' + position: + x: 2071.3401312758333 + y: 804.853363697991 + positionAbsolute: + x: 7333.796408555918 + y: 1720.853363697991 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. to template epoll + type: code + variables: + - value_selector: + - '1744342426374' + - result + variable: data_json + height: 53 + id: '1744342800777' + parentId: '1741497176064' + position: + x: 2396.2516631873705 + y: 671.1408594726702 + positionAbsolute: + x: 7658.707940467455 + y: 1587.1408594726702 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. to template net + type: code + variables: + - value_selector: + - '1744342372882' + - result + variable: data_json + height: 53 + id: '1744342846753' + parentId: '1741497176064' + position: + x: 2397.0575190597137 + y: 576.2913937324586 + positionAbsolute: + x: 7659.513796339798 + y: 1492.2913937324586 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. to template file + type: code + variables: + - value_selector: + - '1744342309386' + - result + variable: data_json + height: 53 + id: '1744342890395' + parentId: '1741497176064' + position: + x: 2298.297497136483 + y: 475.73311174167225 + positionAbsolute: + x: 7560.7537744165675 + y: 1391.7331117416722 + selected: false + sourcePosition: right + targetPosition: left + type: custom + width: 243 + zIndex: 1002 + - data: + code: "import json\n\ndef format_number(num):\n return \"{:,}\".format(num)\n\ + \ndef json_to_markdown(data, analysis_type):\n markdown = [\n \ + \ f\"# {analysis_type} Consumption Analysis Report\\n\",\n \"## Executive\ + \ Summary\",\n f\"The summary of {analysis_type} thread consumption\ + \ analysis.\\n\"\n ]\n \n if 'abnormalAnalysis' in data and data['abnormalAnalysis']:\n\ + \ markdown.append(\"## Abnormal Thread Details\")\n for analysis\ + \ in data['abnormalAnalysis']:\n unit = analysis['unit']\n \ + \ markdown.extend([\n f\"### Thread {analysis['tid']}\"\ + ,\n f\"- ​**​Abnormal data count​**​: {analysis['abnormalCount']}\"\ + ,\n f\"- ​**​Spike values​**​: ({unit})\",\n \ + \ *[f\" - {format_number(spike)}{unit}\" for spike in sorted(analysis['spikes'],\ + \ reverse=True)],\n f\"- ​**​Average consumption​**​: {format_number(round(analysis['avg'],\ + \ 2))}{unit}\",\n ])\n \n markdown.append(\"\ + \\n---\\n\") \n \n if 'summary' in data:\n markdown.extend([\n\ + \ \"## Final Conclusion\",\n f\"{data['summary']}\"\ + ,\n ])\n \n return \"\\n\".join(markdown)\n\ndef main(data_json:\ + \ str) -> dict:\n data = json.loads(data_json)\n markdown = json_to_markdown(data,\ + \ 'net')\n return {\"result\": markdown}" + code_language: python3 + desc: '' + isInIteration: true + iteration_id: '1741497176064' + outputs: + result: + children: null + type: string + selected: false + title: it. to template cpu + type: code + variables: + - value_selector: + - '1744342244843' + - result + variable: data_json + height: 53 + id: '1744342920172' parentId: '1741497176064' position: - x: 1185.1766094380573 - y: 848.576845109292 + x: 2291.073286368818 + y: 355.5973351437458 positionAbsolute: - x: 5471.176609438057 - y: 1752.576845109292 + x: 7553.529563648903 + y: 1271.5973351437458 selected: false sourcePosition: right targetPosition: left type: custom - width: 244 + width: 243 zIndex: 1002 viewport: - x: -1894.4612133909195 - y: -99.63042772647532 - zoom: 0.3103568397951731 + x: -2615.891775110111 + y: -292.61647100919583 + zoom: 0.4425894832963618