TraceMessage.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. option java_package = "com.nrxt.nms.rpc.protobuf";
  2. option java_outer_classname = "TraceMessage";
  3. package nrxt;
  4. //标签信息
  5. message Tag {
  6. required string key = 1; //标签key
  7. required string value = 2; //标签value
  8. }
  9. //事件
  10. message Event {
  11. required string level = 1; //等级
  12. required string message = 2; //事件内容
  13. required string name = 3; //事件名称
  14. optional string stack = 4; //异常堆栈
  15. }
  16. message NetMetric {
  17. required string metricCode = 1; // 指标编码
  18. required bool success = 2 [default = true]; // 是否成功
  19. optional string errorCode = 3; // 错误代码
  20. optional string errorMsg = 4; // 错误信息
  21. optional string metricValue = 5; // 采集结果
  22. }
  23. message NPMSpan {
  24. required string traceId = 1 ;
  25. required string fromIp = 2 ;
  26. optional string fromPort = 3 ;
  27. required string toIp = 4 ;
  28. required string toPort = 5 ;
  29. required string referUrl = 6 ;
  30. required string url = 7 ;
  31. required string cmdbId = 8 ;
  32. required string apmServiceCode = 9 ;
  33. optional string apmServiceInstId = 10;
  34. required string uri = 11;
  35. required int64 startTime = 12;
  36. required int64 endTime = 13;
  37. required bool success = 14;
  38. required string statusCode = 15;
  39. optional string errorMsg = 16;
  40. repeated NetMetric netMetric = 17;// 网络指标
  41. repeated Tag tag = 18;
  42. }
  43. message APMSpan {
  44. enum SpanTypeCls {
  45. ENTRY = 1; //进入
  46. LOCAL = 2; //本地
  47. EXIT = 3; //调用外部
  48. }
  49. enum LayerCls {
  50. JOB = 1; //任务触发
  51. METHOD = 2; //本地方法
  52. DB = 3; //数据库驱动层
  53. RPC = 4; //RPC框架层
  54. HTTP = 5; //HTTP框架层
  55. MQ = 6; //MQ驱动层
  56. CACHE = 7; //CACHE驱动层
  57. }
  58. required string traceId = 1 ;
  59. required string segmentId = 2 ;
  60. required string spanId = 3 ;
  61. optional string superSegmentId = 4 ;
  62. optional string superSpanId = 5 ;
  63. optional string apmServiceCode = 6 ;
  64. optional string apmServiceInstId = 7 ;
  65. optional string cmdbId = 8 ;
  66. optional string superAPMServiceCode =9 ;
  67. optional string superAPMServiceInstId =10;
  68. optional string superAPMEndpointName = 11;
  69. optional string superCmdbId =12;
  70. required string apmEndpointName = 13;
  71. required int64 startTime = 14;
  72. required int64 endTime = 15;
  73. required SpanTypeCls type = 16;
  74. required LayerCls layer = 17;
  75. required bool success = 18;
  76. required string statusCode = 19;
  77. optional string errorMsg = 20;
  78. optional Event event = 21;
  79. optional string peer = 22;
  80. repeated Tag tag = 23;
  81. repeated APMSpan subSpan = 24;
  82. }
  83. message UserRequest {
  84. enum ClientType {
  85. web = 1; //桌面浏览器
  86. app = 2; //移动app
  87. }
  88. required string traceId = 1;
  89. required string uerId = 2;
  90. required string clientIp = 3;
  91. required ClientType clientType = 4;
  92. required string appName = 5;
  93. required string cmdbId = 6;
  94. required string requestUrl = 7;
  95. required string referUrl = 8;
  96. required int64 startTime = 9;
  97. required int64 endTime = 10;
  98. required bool success = 11;
  99. required int32 statusCode = 12;
  100. optional string errorMsg = 13;
  101. }
  102. message SpanMessage {
  103. enum MsgType {
  104. user = 1; //表示消息内容是用户客户端请求
  105. npm = 2; //表示消息内容是npmspan
  106. apm = 3; //表示消息内容是apmspan
  107. }
  108. optional UserRequest userRequest =1;
  109. optional NPMSpan npmSpan =2;
  110. optional APMSpan apmSpan =3;
  111. required MsgType msgType =4;
  112. optional string secZoneId =5 [default = "40003102"];
  113. }