健康检查终结点

使用Endpoints.UseViz 可以为应用程序及路由添加健康检查的Endpoint用于Http输出应用状态

实例

  1. func main() {
  2. YoyoGo.CreateDefaultBuilder(func(rb router.IRouterBuilder) {
  3. endpoints.UseViz(rb)
  4. }).Build().Run() //默认端口号 :8080
  5. }

访问地址

  1. 输出依赖图 : /actuator/graph?type=viz
  2. 依赖图字符串 : /actuator/graph

返回值

type=viz返回值

可观察性-依赖检查 - 图1

默认返回值

  1. digraph {
  2. subgraph cluster_s4 {
  3. ID = "cluster_s4";
  4. bgcolor="#E8E8E8";color="lightgrey";fontcolor="#46494C";fontname="COURIER";label="";style="rounded";
  5. n7[color="#46494C",fontcolor="white",fontname="COURIER",label="*di.Graph",shape="box",style="filled"];
  6. n6[color="#46494C",fontcolor="white",fontname="COURIER",label="di.Extractor",shape="box",style="filled"];
  7. }subgraph cluster_s0 {
  8. ID = "cluster_s0";
  9. bgcolor="#E8E8E8";color="lightgrey";fontcolor="#46494C";fontname="COURIER";label="";style="rounded";
  10. n1[color="#46494C",fontcolor="white",fontname="COURIER",label="*Abstractions.ApplicationLife",shape="box",style="filled"];
  11. }subgraph cluster_s3 {
  12. ID = "cluster_s3";
  13. bgcolor="#E8E8E8";color="lightgrey";fontcolor="#46494C";fontname="COURIER";label="";style="rounded";
  14. n5[color="#46494C",fontcolor="white",fontname="COURIER",label="*contollers.UserController[usercontroller]",shape="box",style="filled"];
  15. }subgraph cluster_s2 {
  16. ID = "cluster_s2";
  17. bgcolor="#E8E8E8";color="lightgrey";fontcolor="#46494C";fontname="COURIER";label="";style="rounded";
  18. n3[color="#46494C",fontcolor="white",fontname="COURIER",label="*models.UserAction",shape="box",style="filled"];
  19. n4[color="#2589BD",fontcolor="white",fontname="COURIER",label="models.IUserAction",style="filled"];
  20. }subgraph cluster_s1 {
  21. ID = "cluster_s1";
  22. bgcolor="#E8E8E8";color="lightgrey";fontcolor="#46494C";fontname="COURIER";label="";style="rounded";
  23. n2[color="#46494C",fontcolor="white",fontname="COURIER",label="*Context.HostEnvironment",shape="box",style="filled"];
  24. }splines="ortho";
  25. n3->n4[color="#949494"];
  26. n4->n5[color="#949494"];
  27. }