aide-family / moon

prometheus unified rules and alarms management platform
https://aide-family.github.io/i18n/zh/
MIT License
137 stars 47 forks source link

部署agent报错 #149

Open wangliuwei opened 1 month ago

wangliuwei commented 1 month ago

What happened?

使用helm或者k8s yaml部署moon系统,server服务正常运行,但是agent一运行就报错,错误信息:


INFO msg=watcher's ctx cancel : context canceled
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x11a6b2c]

goroutine 1 [running]:
github.com/aide-family/moon/app/prom_agent/internal/data.NewData(0xc000125d10, {0x1bcd1a0?, 0xc000454400})
        /src/app/prom_agent/internal/data/data.go:76 +0x48c
main.wireApp(0xc0000dc150?)
        /src/app/prom_agent/cmd/prom_agent/wire_gen.go:36 +0x73
main.main()
        /src/app/prom_agent/cmd/prom_agent/main.go:21 +0x71

agent config配置:

  config.yaml:
    env:
      env: dev
      metadata:
        author: 梧桐
        description: Prometheus Manager Agent APP
        email: aidecloud@163.com
        license: MIT
        url: https://github.com/aide-family/moon
        version: 0.0.1
      name: moon_agent
      version: 0.0.1
    interflow:
      agent: http://moon-agent-svc.moon.svc.cluster.local:8000/api/v1/interflows/receive
      server: http://moon-server-svc.moon.svc.cluster.local:8000/api/v1/interflows/receive
    log:
      compress: true
      encoder: json
      filename: ./log/agent.log
      level: debug
      maxSize: 500
    server:
      grpc:
        addr: 0.0.0.0:9000
        timeout: 1s
      http:
        addr: 0.0.0.0:8000
        timeout: 1s
    watchProm:
      interval: 10s

What did you expect to happen?

什么原因导致的,怎么修复

How can we reproduce it (as minimally and precisely as possible)?

什么原因导致的,怎么修复

Anything else we need to know?

No response

moon version

v0.0.28

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```
aide-cloud commented 1 month ago

agent配置部分修改如下

interflow:
  version: v2
  watchProm:
    interval: 10s
  hook:
    http:
      agent:
        url: http://localhost:8001/api/v1/interflows/receive
      server:
        url: http://localhost:8000/api/v1/interflows/receive

server配置修改如下

interflow:
  version: v2
  hook:
    network: http