GithubHelp home page GithubHelp logo

kaola-fed / console-agent Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 1.0 144 KB

console 平台是完整的 node 监控平台,由 agent + connection + cron + web 组成。agent 是其中的 「采集/上报」模块。其余部分暂未开源

License: MIT License

JavaScript 100.00%
agent node-monitor

console-agent's People

Contributors

imhype avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sdgdsffdsfff

console-agent's Issues

架构调整

  • 建立 Leader 与 Follower 的进程,使用 TCP 进程间通信;
    • 每个启动的进程抢占成为 Supervisor 的宿主进程,只有一个进程能够抢占成功;
    • 抢占成为 Supervisor 的宿主进程,开始 fork Supervisor 进程;
    • Supervisor 进程负责 fork Leader 进程,并守护 Leader 的重启;
    • Leader 进程启动成功后,以 net 模块去监听一个端口(这个端口在第一步就确定了);
    • Follower 进程在启动成功后,便不断尝试连接 Leader,直至连接完成;
    • Leader 进程与 Follower 建立连接后,生成 Request 对象,将其存入 requestPool,用于 broadcast;
    • Follower 断开连接时,Leader 将其对应的 Request 对象 从 requestPool 中移除;
    • Leader Crash 后会自动重启,Follower 断开连接后不断重试(每秒一次),期间出现 sendToLeader 的需求时,等待重连后再发送;
    • Follower 与 Leader 建立连接后,获取初始化的一些信息,如采集频率;
    • kagent 提供采集基础方法 guage/timer/histogram/meter/counter;
    • Follower 在采集间隔达到时进行采集(执行 Guage 函数,汇总其他数据),并将采集结果,发送给 Leader;
    • Leader 与 WebSocketAgent 模块交互,将采集结果汇总,并等待与服务端的连接建立完毕后,发送给服务端,完成上报;
    • Follower 与 Leader 建立连接后,Leader 可以向 Follower 分发一些可执行命令,执行完成后重新返回给 Follower;
  • 新增 WebSocketAgent
    • 首次连接,传递基础信息(包含 appid, secret, hostname)到服务端进行认证,服务端决定是否创建集群/节点,并将信息存储在 socket 结构上;
    • 如果不存在 session 信息,或是 session 信息失效了,以事件通知客户端,使其重新认证;
    • 接收 / 执行远程端命令
    • 日志上报
    • 连接断开时,Leader 进程会重启(socket.io)

监控探针

进程监控

  • cpu
  • memory
  • network 流量
  • GC
  • TCP 连接数
  • cpuporfile
  • snapshot

应用性能监控

  • 接口响应时间
  • 模板渲染响应时间
  • mysql
  • redis
  • trace
  • 限流
  • dubbo
  • proxy

系统监控

暂无

异常监控

  • uncaughtException
  • 请求运行时的异常

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.