上一篇,SpringCloudAlibaba篇(六)整合Seata(微服务分布式事务nacos+seata)
文章目录
前言
Zipkin是一个分布式跟踪系统。它有助于收集解决服务体系结构中的延迟问题所需的计时数据。功能包括此数据的收集和查找。
如果日志文件中有跟踪 ID,则可以直接跳转到该 ID。否则,您可以根据服务、操作名称、标签、持续时间等属性进行查询。将为您汇总一些有趣的数据,例如在服务中花费的时间百分比以及操作是否失败。
Zipkin是一个分布式跟踪系统。它有助于收集解决服务体系结构中的延迟问题所需的计时数据。功能包括此数据的收集和查找。
如果日志文件中有跟踪 ID,则可以直接跳转到该 ID。否则,您可以根据服务、操作名称、标签、持续时间等属性进行查询。将为您汇总一些有趣的数据,例如在服务中花费的时间百分比以及操作是否失败

Zipkin UI 还提供了一个依赖关系图,显示通过每个应用程序跟踪的请求数。这对于识别聚合行为(包括错误路径或对已弃用服务的调用)很有帮助。

1、 zipkin下载安装
1.1、zipkin下载
1.2、zipkin建表语句
--
-- Copyright 2015-2019 The OpenZipkin Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
-- in compliance with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software distributed under the License
-- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-- or implied. See the License for the specific language governing permissions and limitations under
-- the License.
--
CREATE TABLE IF NOT EXISTS zipkin_spans (
`trace_id_high` BIGINT NOT NULL DEFAULT 0 COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit',
`trace_id` BIGINT NOT NULL,
`id` BIGINT NOT NULL,
`name` VARCHAR(255) NOT NULL,
`remote_service_name` VARCHAR(255),
`parent_id` BIGINT,
`debug` BIT(1),
`start_ts` BIGINT COMMENT 'Span.timestamp(): epoch micros used for endTs query and to implement TTL',
`duration` BIGINT COMMENT 'Span.duration(): micros used for minDuration and maxDuration query',
PRIMARY KEY (`trace_id_high`,

本文档介绍了如何在SpringCloud项目中整合Zipkin,用于实现微服务的分布式追踪。首先,详细说明了Zipkin的下载、安装和启动过程,包括数据库表的创建。接着,讨论了如何在SpringCloud中添加依赖、修改配置文件以及针对Dubbo服务的配置调整,以确保Zipkin能够收集并展示服务间的调用轨迹。最后,提供了测试步骤,展示了如何通过Zipkin UI观察和分析微服务的调用情况。

最低0.47元/天 解锁文章
8461





