4pigxx_zipkin.sql 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for zipkin_annotations
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `zipkin_annotations`;
  19. CREATE TABLE `zipkin_annotations` (
  20. `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',
  21. `trace_id` bigint(20) NOT NULL COMMENT 'coincides with zipkin_spans.trace_id',
  22. `span_id` bigint(20) NOT NULL COMMENT 'coincides with zipkin_spans.id',
  23. `a_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'BinaryAnnotation.key or Annotation.value if type == -1',
  24. `a_value` blob NULL COMMENT 'BinaryAnnotation.value(), which must be smaller than 64KB',
  25. `a_type` int(11) NOT NULL COMMENT 'BinaryAnnotation.type() or -1 if Annotation',
  26. `a_timestamp` bigint(20) NULL DEFAULT NULL COMMENT 'Used to implement TTL; Annotation.timestamp or zipkin_spans.timestamp',
  27. `endpoint_ipv4` int(11) NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
  28. `endpoint_ipv6` binary(16) NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null, or no IPv6 address',
  29. `endpoint_port` smallint(6) NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
  30. `endpoint_service_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Null when Binary/Annotation.endpoint is null',
  31. UNIQUE INDEX `trace_id_high`(`trace_id_high`, `trace_id`, `span_id`, `a_key`, `a_timestamp`) USING BTREE COMMENT 'Ignore insert on duplicate',
  32. INDEX `trace_id_high_2`(`trace_id_high`, `trace_id`, `span_id`) USING BTREE COMMENT 'for joining with zipkin_spans',
  33. INDEX `trace_id_high_3`(`trace_id_high`, `trace_id`) USING BTREE COMMENT 'for getTraces/ByIds',
  34. INDEX `endpoint_service_name`(`endpoint_service_name`) USING BTREE COMMENT 'for getTraces and getServiceNames',
  35. INDEX `a_type`(`a_type`) USING BTREE COMMENT 'for getTraces',
  36. INDEX `a_key`(`a_key`) USING BTREE COMMENT 'for getTraces',
  37. INDEX `trace_id`(`trace_id`, `span_id`, `a_key`) USING BTREE COMMENT 'for dependencies job'
  38. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compressed;
  39. -- ----------------------------
  40. -- Table structure for zipkin_dependencies
  41. -- ----------------------------
  42. DROP TABLE IF EXISTS `zipkin_dependencies`;
  43. CREATE TABLE `zipkin_dependencies` (
  44. `day` date NOT NULL,
  45. `parent` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  46. `child` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  47. `call_count` bigint(20) NULL DEFAULT NULL,
  48. `error_count` bigint(20) NULL DEFAULT NULL,
  49. UNIQUE INDEX `day`(`day`, `parent`, `child`) USING BTREE
  50. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compressed;
  51. -- ----------------------------
  52. -- Table structure for zipkin_spans
  53. -- ----------------------------
  54. DROP TABLE IF EXISTS `zipkin_spans`;
  55. CREATE TABLE `zipkin_spans` (
  56. `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',
  57. `trace_id` bigint(20) NOT NULL,
  58. `id` bigint(20) NOT NULL,
  59. `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  60. `parent_id` bigint(20) NULL DEFAULT NULL,
  61. `debug` bit(1) NULL DEFAULT NULL,
  62. `start_ts` bigint(20) NULL DEFAULT NULL COMMENT 'Span.timestamp(): epoch micros used for endTs query and to implement TTL',
  63. `duration` bigint(20) NULL DEFAULT NULL COMMENT 'Span.duration(): micros used for minDuration and maxDuration query',
  64. UNIQUE INDEX `trace_id_high`(`trace_id_high`, `trace_id`, `id`) USING BTREE COMMENT 'ignore insert on duplicate',
  65. INDEX `trace_id_high_2`(`trace_id_high`, `trace_id`, `id`) USING BTREE COMMENT 'for joining with zipkin_annotations',
  66. INDEX `trace_id_high_3`(`trace_id_high`, `trace_id`) USING BTREE COMMENT 'for getTracesByIds',
  67. INDEX `name`(`name`) USING BTREE COMMENT 'for getTraces and getSpanNames',
  68. INDEX `start_ts`(`start_ts`) USING BTREE COMMENT 'for getTraces ordering and range'
  69. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compressed;
  70. SET FOREIGN_KEY_CHECKS = 1;