Spring Cloud入门教程-使用rabbitMQ传输链路数据,储存到MySQL

Spring Cloud入门教程-使用rabbitMQ传输链路数据,储存到MySQL,第1张

Spring Cloud入门教程-使用rabbitMQ传输链路数据,储存到MySQL

a_value BLOB COMMENT’BinaryAnnotation.value(), which must be smaller than 64KB’,

a_type INT NOT NULL COMMENT’BinaryAnnotation.type() or -1 if Annotation’,

a_timestamp BIGINT COMMENT ‘Used toimplement TTL; Annotation.timestamp or zipkin_spans.timestamp’,

endpoint_ipv4 INT COMMENT ‘Null whenBinary/Annotation.endpoint is null’,

endpoint_ipv6 BINARY(16) COMMENT ‘Null whenBinary/Annotation.endpoint is null, or no IPv6 address’,

endpoint_port SMALLINT COMMENT ‘Null whenBinary/Annotation.endpoint is null’,

endpoint_service_name VARCHAr(255) COMMENT’Null when Binary/Annotation.endpoint is null’

)ENGINE=INNODB ROW_FORMAT=COMPRESSED CHARACTER SET=utf8 COLLATE utf8_general_ci;

ALTER TABLE zipkin_annotations ADD UNIQUE KEY(trace_id_high, trace_id, span_id,a_key, a_timestamp) COMMENT ‘Ignore insert on duplicate’;

ALTER TABLE zipkin_annotations ADD INDEX(trace_id_high, trace_id, span_id)COMMENT ‘for joining with zipkin_spans’;

ALTER TABLE zipkin_annotations ADD INDEX(trace_id_high, trace_id) COMMENT ‘forgetTraces/ByIds’;

ALTER TABLE zipkin_annotations ADD INDEX(endpoint_service_name) COMMENT ‘forgetTraces and getServiceNames’;

ALTER TABLE zipkin_annotations ADD INDEX(a_type) COMMENT ‘for getTraces’;

ALTER TABLE zipkin_annotations ADD INDEX(a_key) COMMENT ‘for getTraces’;

ALTER TABLE zipkin_annotations ADD INDEX(trace_id, span_id, a_key) COMMENT ‘fordependencies job’;

CREATE TABLE IF NOT EXISTS zipkin_dependencies (

day DATE NOT NULL,

parent VARCHAr(255) NOT NULL,

child VARCHAr(255) NOT NULL,

call_count BIGINT

《一线大厂Java面试题解析+后端开发学习笔记+最新架构讲解视频+实战项目源码讲义

【docs.qq.com/doc/DSmxTbFJ1cmN1R2dB】 完整内容开源分享

)ENGINE=INNODB ROW_FORMAT=COMPRESSED CHARACTER SET=utf8 COLLATE utf8_general_ci;

ALTER TABLE zipkin_dependencies ADD UNIQUE KEY(day, parent, child);

修改eureka-client-zipkin 项目添加rabbitMQ 依赖

org.springframework.cloud

spring-cloud-stream-binder-rabbit

增加配置:

spring.rabbitmq.host=localhost

spring.rabbitmq.port=5672

spring.rabbitmq.password=guest

spring.rabbitmq.username=guest

zipkin链接方式

spring.zipkin.sender.type=rabbit

#是否启动zipkin,默认为true

spring.zipkin.enabled=true

支持通过服务发现来定位host name:

spring.zipkin.locator.discovery.enabled=true

重新启动项目eureka-client-zipkin。

使用 以下命令重新启动zipkin-server-xxx.jar :

java -jar zipkin-server.jar --STORAGE_TYPE=mysql --MYSQL_DB=springboot --MYSQL_USER=root --MYSQL_PASS=000000 --MYSQL_HOST=localhost --MYSQL_TCP_PORT=3306

请求:http://localhost:8788/main  返回8792

查看数据库表

zipkin_annotations表中数据如下:

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/5683741.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存