4pigxx_zipkin.sql 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : 本机mysql
  4. Source Server Type : MySQL
  5. Source Server Version : 50724
  6. Source Host : localhost:3306
  7. Source Schema : pigxx_zipkin
  8. Target Server Type : MySQL
  9. Target Server Version : 50724
  10. File Encoding : 65001
  11. Date: 22/02/2019 11:44:20
  12. */
  13. USE pigxx_zipkin;
  14. SET NAMES utf8mb4;
  15. SET FOREIGN_KEY_CHECKS = 0;
  16. -- ----------------------------
  17. -- Table structure for zipkin_annotations
  18. -- ----------------------------
  19. DROP TABLE IF EXISTS `zipkin_annotations`;
  20. CREATE TABLE `zipkin_annotations` (
  21. `trace_id_high` bigint(20) NOT NULL DEFAULT 0 COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit',
  22. `trace_id` bigint(20) NOT NULL COMMENT 'coincides with zipkin_spans.trace_id',
  23. `span_id` bigint(20) NOT NULL COMMENT 'coincides with zipkin_spans.id',
  24. `a_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'BinaryAnnotation.key or Annotation.value if type == -1',
  25. `a_value` blob NULL COMMENT 'BinaryAnnotation.value(), which must be smaller than 64KB',
  26. `a_type` int(11) NOT NULL COMMENT 'BinaryAnnotation.type() or -1 if Annotation',
  27. `a_timestamp` bigint(20) NULL DEFAULT NULL COMMENT 'Used to implement TTL; Annotation.timestamp or zipkin_spans.timestamp',
  28. `endpoint_ipv4` int(11) NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
  29. `endpoint_ipv6` binary(16) NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null, or no IPv6 address',
  30. `endpoint_port` smallint(6) NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
  31. `endpoint_service_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
  32. UNIQUE INDEX `trace_id_high`(`trace_id_high`, `trace_id`, `span_id`, `a_key`, `a_timestamp`) USING BTREE COMMENT 'Ignore insert on duplicate',
  33. INDEX `trace_id_high_2`(`trace_id_high`, `trace_id`, `span_id`) USING BTREE COMMENT 'for joining with zipkin_spans',
  34. INDEX `trace_id_high_3`(`trace_id_high`, `trace_id`) USING BTREE COMMENT 'for getTraces/ByIds',
  35. INDEX `endpoint_service_name`(`endpoint_service_name`) USING BTREE COMMENT 'for getTraces and getServiceNames',
  36. INDEX `a_type`(`a_type`) USING BTREE COMMENT 'for getTraces',
  37. INDEX `a_key`(`a_key`) USING BTREE COMMENT 'for getTraces',
  38. INDEX `trace_id`(`trace_id`, `span_id`, `a_key`) USING BTREE COMMENT 'for dependencies job'
  39. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compressed;
  40. -- ----------------------------
  41. -- Table structure for zipkin_dependencies
  42. -- ----------------------------
  43. DROP TABLE IF EXISTS `zipkin_dependencies`;
  44. CREATE TABLE `zipkin_dependencies` (
  45. `day` date NOT NULL,
  46. `parent` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  47. `child` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  48. `call_count` bigint(20) NULL DEFAULT NULL,
  49. `error_count` bigint(20) NULL DEFAULT NULL,
  50. UNIQUE INDEX `day`(`day`, `parent`, `child`) USING BTREE
  51. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compressed;
  52. -- ----------------------------
  53. -- Table structure for zipkin_spans
  54. -- ----------------------------
  55. DROP TABLE IF EXISTS `zipkin_spans`;
  56. CREATE TABLE `zipkin_spans` (
  57. `trace_id_high` bigint(20) NOT NULL DEFAULT 0 COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit',
  58. `trace_id` bigint(20) NOT NULL,
  59. `id` bigint(20) NOT NULL,
  60. `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  61. `parent_id` bigint(20) NULL DEFAULT NULL,
  62. `debug` bit(1) NULL DEFAULT NULL,
  63. `start_ts` bigint(20) NULL DEFAULT NULL COMMENT 'Span.timestamp(): epoch micros used for endTs query and to implement TTL',
  64. `duration` bigint(20) NULL DEFAULT NULL COMMENT 'Span.duration(): micros used for minDuration and maxDuration query',
  65. UNIQUE INDEX `trace_id_high`(`trace_id_high`, `trace_id`, `id`) USING BTREE COMMENT 'ignore insert on duplicate',
  66. INDEX `trace_id_high_2`(`trace_id_high`, `trace_id`, `id`) USING BTREE COMMENT 'for joining with zipkin_annotations',
  67. INDEX `trace_id_high_3`(`trace_id_high`, `trace_id`) USING BTREE COMMENT 'for getTracesByIds',
  68. INDEX `name`(`name`) USING BTREE COMMENT 'for getTraces and getSpanNames',
  69. INDEX `start_ts`(`start_ts`) USING BTREE COMMENT 'for getTraces ordering and range'
  70. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compressed;
  71. SET FOREIGN_KEY_CHECKS = 1;