Skip to content

通知给飞书的告警时间Alert.StartsAt值有问题 #276

@ColeSu-n

Description

@ColeSu-n

configMap notification-manager-template

....

{{ define "nm.feishu.text" }} {{ range.Alerts }}
    {{ template "nm.default.message". }}
    时间: {{ .StartsAt }}
    {{ range.Labels.SortedPairs }}
        {{.Name | translate }}: {{.Value }}
    {{ end }}
{{ end }} {{- end }}

...

实际飞书中接收到告警内容

[触发中] 过去3分钟内,kube - proxy存在没有本地端点的代理规则,这可能导致某些服务无法正确路由。检查服务的端点配置和kube - proxy
    时间: 0001-01-01 00:00:00 +0000 UTC
    
        告警名称: KubeProxySyncProxyRulesNoLocalEndpoints
    
        告警类型: metric
    
        集群: prod
    
        endpoint: http-metrics
    
        实例: xxxx
    
        任务: kube-proxy-metrics
    
        项目: kube-system
    
        容器组: kube-proxy-jnfdg
    
        receiver: global-feishu-receiver
    
        rule_group: kube-proxy-alert
    
        rule_level: cluster
    
        rule_type: custom
    
        服务: kube-proxy-metrics
    
        告警级别: warning
    
        traffic_policy: external

时间: 0001-01-01 00:00:00 +0000 UTC
这个值还是零值,是没有赋值吗

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions