trace.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. package dto
  2. import (
  3. "go-admin/app/observe/models"
  4. "go-admin/common/dto"
  5. )
  6. type TraceListReq struct {
  7. dto.Pagination
  8. models.TimeRange
  9. models.DurationRange
  10. AppAlias string `form:"app_alias"`
  11. ServiceName string `form:"service_name"`
  12. TraceId string `form:"trace_id" json:"trace_id"`
  13. Failed bool `form:"failed" json:"failed"`
  14. Kind string `from:"kind"` //异常筛选维度:app、biz、service、interface
  15. SubconditionValue string `form:"subcondition_value"` //子选项的值,例如kind为service,该值为 checkout_service,服务的英文原名
  16. StatusMessage string `form:"status_message"` //异常简讯
  17. }
  18. type TraceListResp struct {
  19. TraceId string `json:"trace_id"`
  20. MinTimestamp string `json:"timestamp"`
  21. MaxDuration float64 `json:"duration"`
  22. ServiceNum int64 `json:"service_num"`
  23. SpanNum int64 `json:"span_num"`
  24. // MaxDepth int64 `json:"max_depth"`
  25. }
  26. type TraceDetailReq struct {
  27. TraceId string `form:"trace_id" json:"trace_id" uri:"trace_id"`
  28. models.TimeRange
  29. }
  30. type TraceDetailResp struct {
  31. // ServiceName string `json:"service_name"`
  32. // SpanName string `json:"span_name"`
  33. // SpanKind string `json:"span_kind"`
  34. // SpanId string `json:"span_id"`
  35. // ParentSpanId string `json:"parent_span_id"`
  36. // Duration float64 `json:"duration"`
  37. models.Trace
  38. HiddenSpanAttributes map[string]string
  39. HiddenResourceAttributes map[string]string
  40. Duration float64 `json:"duration"`
  41. DurationPersent float64 `json:"duration_persent"`
  42. MaxDepth int `json:"max_depth"`
  43. Children []*TraceDetailResp `json:"children"`
  44. }
  45. type TraceGraphReq struct {
  46. TraceId string `uri:"trace_id"`
  47. }
  48. type TraceGraphEdgeRaw struct {
  49. SourceSpan string `ch:"SourceSpan"`
  50. TargetSpan string `ch:"TargetSpan"`
  51. RequestType string `ch:"RequestType"`
  52. }
  53. type TraceGraphNodeRaw struct {
  54. SpanId string `ch:"SpanId"`
  55. SpanName string `ch:"SpanName"`
  56. ServiceName string `ch:"ServiceName"`
  57. ParentSpanId string `ch:"ParentSpanId"`
  58. SpanKind string `ch:"SpanKind"`
  59. Duration float64 `ch:"Duration"`
  60. }
  61. type TraceGraphEdge struct {
  62. ID string `json:"id"`
  63. Source string `json:"source"`
  64. Target string `json:"target"`
  65. MainStat string `json:"mainstat"`
  66. SecondaryStat string `json:"secondarystat"`
  67. }
  68. type TraceGraphNode struct {
  69. ID string `json:"id"`
  70. Title string `json:"title"`
  71. SubTitle string `json:"subtitle"`
  72. MainStat string `json:"mainstat"`
  73. SecondaryStat string `json:"secondarystat"`
  74. ArcGreen float64 `json:"arc__green"`
  75. ArcRed float64 `json:"arc__red"`
  76. Icon string `json:"icon"`
  77. }
  78. type TraceGraphResp struct {
  79. Nodes []TraceGraphNode `json:"nodes"`
  80. Edges []TraceGraphEdge `json:"edges"`
  81. }
  82. type TraceDBSlowTopReq struct {
  83. AppAlias string `form:"app_alias"`
  84. models.TimeRange
  85. Limit uint8 `form:"limit"`
  86. }
  87. type TraceDBSlowTopResp struct {
  88. Datetime string `json:"datetime"`
  89. Timestamp1 string `json:"timestamp"`
  90. TraceId string `json:"trace_id"`
  91. SpanId string `json:"span_id"`
  92. SpanName string `json:"span_name"`
  93. ServiceName string `json:"service_name"`
  94. ServiceNameCN string `json:"service_name_cn"`
  95. Statement string `json:"statement"`
  96. Duration float64 `json:"duration"`
  97. }