{"id":15126191,"url":"https://github.com/sofastack/sofa-tracer","last_synced_at":"2025-05-14T14:06:31.901Z","repository":{"id":38052249,"uuid":"133340671","full_name":"sofastack/sofa-tracer","owner":"sofastack","description":"SOFATracer is a component for the distributed system call trace. And through a unified traceId logging the logs of various network calls in the invoking link. These logs can be used for quick discovery of faults, service governance, etc.","archived":false,"fork":false,"pushed_at":"2025-04-28T03:07:55.000Z","size":1973,"stargazers_count":1122,"open_issues_count":50,"forks_count":382,"subscribers_count":75,"default_branch":"master","last_synced_at":"2025-04-28T04:22:45.065Z","etag":null,"topics":["opentracing","sofa-boot-starter","sofa-tracer","sofastack","tracer"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sofastack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-14T09:56:50.000Z","updated_at":"2025-04-28T03:08:00.000Z","dependencies_parsed_at":"2024-09-13T15:56:36.710Z","dependency_job_id":"26048895-2287-4a84-94d1-418532d34763","html_url":"https://github.com/sofastack/sofa-tracer","commit_stats":{"total_commits":234,"total_committers":27,"mean_commits":8.666666666666666,"dds":0.7094017094017093,"last_synced_commit":"53332d8eb9cae6c8d93b932fe3ae01c894dbd337"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-tracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-tracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-tracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-tracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sofastack","download_url":"https://codeload.github.com/sofastack/sofa-tracer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159182,"owners_count":22024558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opentracing","sofa-boot-starter","sofa-tracer","sofastack","tracer"],"created_at":"2024-09-26T02:02:21.738Z","updated_at":"2025-05-14T14:06:31.884Z","avatar_url":"https://github.com/sofastack.png","language":"Java","funding_links":[],"categories":["Tracing \u0026 Profiling","应用分析与监控"],"sub_categories":[],"readme":"## SOFATracer\n\n[![Build Status](https://github.com/sofastack/sofa-tracer/workflows/build/badge.svg?branch=master)](https://github.com/sofastack/sofa-tracer/workflows/build/badge.svg?branch=master)\n[![Coverage Status](https://codecov.io/gh/sofastack/sofa-tracer/branch/master/graph/badge.svg)](https://codecov.io/gh/sofastack/sofa-tracer/branch/master)\n![license](https://img.shields.io/badge/license-Apache--2.0-green.svg)\n[![Maven](https://img.shields.io/github/release/alipay/sofa-tracer.svg)](https://github.com/alipay/sofa-tracer/releases)\n\nSOFATracer 是一个用于分布式系统调用跟踪的组件，通过统一的 `traceId` 将调用链路中的各种网络调用情况以日志的方式记录下来，以达到透视化网络调用的目的。这些日志可用于故障的快速发现，服务治理等。\n\n## 一、背景\n\n在当下的技术架构实施中，统一采用面向服务的分布式架构，通过服务来支撑起一个个应用，而部署在应用中的各种服务通常都是用复杂大规模分布式集群来实现的，同时，这些应用又构建在不同的软件模块上，这些软件模块，有可能是由不同的团队开发，可能使用不同的编程语言来实现、有可能部署了几千台服务器。因此，就需要一些可以帮助理解各个应用的线上调用行为，并可以分析远程调用性能的组件。\n\n为了能够分析应用的线上调用行为以及调用性能，蚂蚁金服基于 [OpenTracing 规范](http://opentracing.io/documentation/pages/spec.html) 提供了分布式链路跟踪 SOFATracer 的解决方案。\n\n## 二、功能简介\n\n为了解决在实施大规模微服务架构时的链路跟踪问题，SOFATracer 提供了以下的能力：\n\n### 2.1 基于 OpenTracing 规范提供分布式链路跟踪解决方案\n\n基于 [OpenTracing 规范](http://opentracing.io/documentation/pages/spec.html) 并扩展其能力提供链路跟踪的解决方案。各个框架或者组件可以基于此实现，通过在各个组件中埋点的方式来提供链路跟踪的能力。\n\n### 2.2 提供异步落地磁盘的日志打印能力\n\n基于 [Disruptor](https://github.com/LMAX-Exchange/disruptor) 高性能无锁循环队列，提供异步打印日志到本地磁盘的能力。框架或者组件能够在接入时，在异步日志打印的前提下可以自定义日志文件的输出格式。SOFATracer 提供两种类似的日志打印类型即摘要日志和统计日志，摘要日志：每一次调用均会落地磁盘的日志；统计日志：每隔一定时间间隔进行统计输出的日志。\n\n### 2.3 支持日志自清除和滚动能力\n\n异步落地磁盘的 SOFATracer 日志支持自清除和滚动能力，支持按照按照天清除和按照小时或者天滚动的能力\n\n### 2.4 基于 SLF4J MDC 的扩展能力\n\nSLF4J 提供了 MDC（Mapped Diagnostic Contexts）功能，可以支持用户定义和修改日志的输出格式以及内容。SOFATracer 集成了 SLF4J MDC 功能，方便用户在只简单修改日志配置文件即可输出当前 Tracer 上下文的 `tracerId` 和 `spanId`。\n\n### 2.5 界面展示能力\n\nSOFATracer 可以将链路跟踪数据远程上报到开源产品 [Zipkin](https://zipkin.io/) 做分布式链路跟踪的展示。\n\n### 2.6 统一配置能力\n\n配置文件中提供丰富的配置能力以定制化应用的个性需求。\n\n## 三、快速开始\n\n请查看文档中的[快速开始](https://www.sofastack.tech/projects/sofa-tracer/component-access/)来了解如何快速上手使用 SOFATracer。\n\n## 四、如何贡献\n\n在贡献代码之前，请阅读[如何贡献](./CONTRIBUTING.md)来了解如何向 SOFATracer 贡献代码。\n\nSOFATracer 的编译环境的要求为 JDK7 或者 JDK8，需要采用 [Apache Maven 3.2.5](https://archive.apache.org/dist/maven/maven-3/3.2.5/binaries/) 或者更高的版本进行编译。\n\n## 五、示例\n\n在此工程的 `tracer-samples` 目录下的是 SOFATracer 的示例工程，分别为：\n\n* [SOFATracer 示例工程（基于 Spring MVC 示例落地日志）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-springmvc)\n* [SOFATracer 示例工程（基于 Spring MVC 示例远程上报 Zipkin）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-zipkin)\n* [SOFATracer 示例工程（基于 SOFA RPC 示例落地日志）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-sofarpc)\n* [SOFATracer 示例工程（基于日志编程接口 SLF4J 示例打印 traceId）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-slf4j)\n* [SOFATracer 示例工程（基于 DataSource 示例落地日志）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-h2)\n* [SOFATracer 示例工程（基于 HttpClient 示例落地日志）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-httpclient)\n* [SOFATracer 示例工程（SOFATracer 采样策略）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-sampler)\n* [SOFATracer 示例工程（SOFATracer 集成 SpringCloud）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-openfeign)\n* [SOFATracer 示例工程（SOFATracer 集成 Dubbo）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-dubbo)\n* [SOFATracer 示例工程（SOFATracer RestTemplate）](https://github.com/sofastack-guides/sofa-tracer-guides/blob/master/tracer-sample-with-resttemplate)\n \n## 六、文档\n\n请参考 [SOFATracer 官方文档](http://www.sofastack.tech/sofa-tracer/docs/Home)。\n\n## 七、致谢\n\nSOFATracer 中的部分实现参考了阿里的 EagleEye 组件，感谢 EagleEye 的同学们。\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofastack%2Fsofa-tracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsofastack%2Fsofa-tracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofastack%2Fsofa-tracer/lists"}