和顺 / 衡律 返回所属 Agent
16.7

风险监测与停止能力

原能力

持续监测风险和停止能力,明确停止对象、送达及实际生效回执。(合同附件 R7 16.7)

首选项目

Alertmanager(Apache-2.0)。 Alertmanager

匹配范围

告警去重、转派与持久暂停/通知。

源码

Alertmanager · func (rs RoutingStage) Exec(

notify/notify.go · 279–292 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
func (rs RoutingStage) Exec(ctx context.Context, l *slog.Logger, alerts ...*alert.Alert) (context.Context, []*alert.Alert, error) {
	receiver, ok := ReceiverName(ctx)
	if !ok {
		return ctx, nil, errors.New("receiver missing")
	}

	ctx, span := tracer.StartRoutingStage(ctx, receiver, len(alerts))
	defer span.End()

	s, ok := rs[receiver]
	if !ok {
		return ctx, nil, errors.New("stage for receiver missing")
	}
  • // Copyright The Prometheus Authors

Temporal Python SDK · async def cancel(

temporalio/client/_workflow.py · 326–339 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
    async def cancel(
        self,
        *,
        reason: str = "",
        rpc_metadata: Mapping[str, str | bytes] = {},
        rpc_timeout: timedelta | None = None,
    ) -> None:
        """Cancel the workflow.

        This will issue a cancellation for :py:attr:`run_id` if present. This
        call will make sure to use the run chain starting from
        :py:attr:`first_execution_run_id` if present. To create handles with
        these values, use :py:meth:`Client.get_workflow_handle`.

实现与验收要点

撤权、实际停止、在途请求和权限正确性。