kubesphere / kubesphere/notification-manager

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

Open
#276 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
240
Forks
116
PR merge metrics
No merged PRs in 30d

Description

`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
这个值还是零值,是没有赋值吗

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the notification-manager-template ConfigMap and the nm.feishu.text template, then trace how .StartsAt is populated in the alert data passed to the template. Confirm the zero-value timestamp with the existing notification or template tests, and consider the issue done when Feishu receives the actual alert start time.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.