Comments (2)
监控指标:
1.执行中失败的任务
2.执行中的任务
from bk-sops.
执行失败任务sql
SELECT
*
FROM
taskflow3_taskflowinstance AS t1
INNER JOIN (
SELECT
pp.id
FROM
pipeline_pipelineinstance AS pp
INNER JOIN eri_state AS es ON pp.instance_id = es.root_id
WHERE
es.NAME = "Failed"
AND pp.is_started = 1
AND pp.is_finished = 0
AND pp.is_revoked = 0
AND pp.is_expired = 0
AND is_deleted = 0
GROUP BY
es.root_id,
pp.id
ORDER BY
pp.id
) AS t2 ON t1.pipeline_instance_id = t2.id;
执行失败任务ORM
# 过滤出失败的节点,根据节点分组
states = [state["root_id"] for state in State.objects.filter(name="FAILED").annotate(count=Count("root_id")).values("root_id")]
# 查出失败的节点任务
tasks = TaskFlowInstance.objects.filter(
pipeline_instance__instance_id__in=states,
pipeline_instance__is_started=True,
pipeline_instance__is_finished=False,
pipeline_instance__is_revoked=False,
pipeline_instance__is_expired=False,
pipeline_instance__is_deleted=False,
is_deleted=False,
).values(
"project__name",
"pipeline_instance__name",
"pipeline_instance__start_time",
)
执行中任务sql
SELECT
*
FROM
taskflow3_taskflowinstance AS t1
INNER JOIN (
SELECT
pp.id,
COUNT( es.root_id ) AS total_count,
SUM( CASE WHEN es.NAME = 'Failed' THEN 1 ELSE 0 END ) AS failed_count,
SUM( CASE WHEN es.NAME = 'FINISHED' THEN 1 ELSE 0 END ) AS finished_count
FROM
pipeline_pipelineinstance AS pp
INNER JOIN eri_state AS es ON pp.instance_id = es.root_id
WHERE
pp.is_started = 1
AND pp.is_finished = 0
AND pp.is_revoked = 0
AND pp.is_expired = 0
AND is_deleted = 0
GROUP BY
es.root_id,
pp.id
HAVING
failed_count = 0
AND finished_count < total_count
ORDER BY
pp.id
) AS t2 ON t1.pipeline_instance_id = t2.id;
执行中任务ORM
states = [
state["root_id"]
for state in (
State.objects.values("root_id").
annotate(total_count=Count("root_id")).
annotate(failed_count=Count("root_id", filter=Q(name='FAILED'))).
annotate(finished_count=Count("root_id",filter=Q(name='FINISHED')))
)
if state["failed_count"] == 0 and state["finished_count"] < state["total_count"]
]
tasks = TaskFlowInstance.objects.filter(
pipeline_instance__instance_id__in=states,
pipeline_instance__is_started=True,
pipeline_instance__is_finished=False,
pipeline_instance__is_revoked=False,
pipeline_instance__is_expired=False,
pipeline_instance__is_deleted=False,
is_deleted=False,
).values(
"project__name",
"pipeline_instance__name",
"pipeline_instance__start_time",
)
from bk-sops.
Related Issues (20)
- 打开节点详情面板抽屉时,需要一直保持小画布的高度
- fix:【3.32.0】独立子流程任务节点操作后,节点详情没有渲染
- fix:【3.32.0】未执行的独立子流程节点,点击画布网关条件,节点树渲染失败,对应网关条件配置不展示
- 节点管理插件支持安装通道
- 周期任务,所有开启的周期任务一起排到前列
- 【jellyfish】草稿保存时间不准
- 运营数据支持多选和导出 HOT 1
- 标准运维-节点管理(Nodeman)-插件操作- bk-collector 版本刷不出来
- 配置平台(CMDB) 相关插件支持 云区域:IP
- 报错后重试, 脚本中的 ${1} 被渲染成了 1
- 公共流程无法重新执行,提示无权限
- create_task api execute_task_nodes_id 传参时两次 replace_id 导致报错
- gse 1.0 接口下线切换
- 第三方插件支持配置超时时间后主动失败机制,防止因插件实现不合理一直在轮询
- 【标准运维+蓝盾】蓝盾需要标准运维的插件!
- 文本框输入大量内容时卡死
- 远程插件可以选择,但是执行时报错pipeline.exceptions.ComponentNotExistException
- sync apigw 只发布对应环境的网关接口
- 快速分发文件插件支持文件源类型
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bk-sops.