• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

zipkin: Zipkin 是 Twitter 的一个开源项目,允许开发者收集 Twitter 各个服务上的监 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

zipkin

开源软件地址:

https://gitee.com/mirrors/zipkin

开源软件介绍:

zipkin

Gitter chatBuild StatusMaven Central

Zipkin is a distributed tracing system. It helps gathertiming data needed to troubleshoot latency problems in service architectures.Features include both the collection and lookup of this data.

If you have a trace ID in a log file, you can jump directly to it. Otherwise,you can query based on attributes such as service, operation name, tags andduration. Some interesting data will be summarized for you, such as thepercentage of time spent in a service, and whether or not operations failed.

Trace view screenshot

The Zipkin UI also presents a dependency diagram showing how many tracedrequests went through each application. This can be helpful for identifyingaggregate behavior including error paths or calls to deprecated services.

Dependency graph screenshot

Application’s need to be “instrumented” to report trace data to Zipkin. Thisusually means configuration of a tracer or instrumentation library. The mostpopular ways to report data to Zipkin are via http or Kafka, though many otheroptions exist, such as Apache ActiveMQ, gRPC and RabbitMQ. The data served tothe UI is stored in-memory, or persistently with a supported backend such asApache Cassandra or Elasticsearch.

Quick-start

The quickest way to get started is to fetch the latest released server as a self-contained executable jar. Note that the Zipkin server requires minimum JRE 8. For example:

curl -sSL https://zipkin.io/quickstart.sh | bash -sjava -jar zipkin.jar

You can also start Zipkin via Docker.

# Note: this is mirrored as ghcr.io/openzipkin/zipkindocker run -d -p 9411:9411 openzipkin/zipkin

Once the server is running, you can view traces with the Zipkin UI at http://your_host:9411/zipkin/.

If your applications aren't sending traces, yet, configure them with Zipkin instrumentation or try one of our examples.

Check out the zipkin-server documentation for configuration details, or Docker examples for how to use docker-compose.

Zipkin Slim

The slim build of Zipkin is smaller and starts faster. It supports in-memory and Elasticsearch storage, but doesn't support messaging transports like Kafka or RabbitMQ. If these constraints match your needs, you can try slim like below:

Running via Java:

curl -sSL https://zipkin.io/quickstart.sh | bash -s io.zipkin:zipkin-server:LATEST:slim zipkin.jarjava -jar zipkin.jar

Running via Docker:

# Note: this is mirrored as ghcr.io/openzipkin/zipkin-slimdocker run -d -p 9411:9411 openzipkin/zipkin-slim

Core Library

The core library is used by both Zipkin instrumentation and the Zipkin server. Its minimum Java language level is 6, in efforts to support those writing agent instrumentation.

This includes built-in codec for Zipkin's v1 and v2 json formats. A direct dependency on gson (json library) is avoided by minifying and repackaging classes used. The result is a 155k jar which won't conflict with any library you use.

Ex.

// All data are recorded against the same endpoint, associated with your service graphlocalEndpoint = Endpoint.newBuilder().serviceName("tweetie").ip("192.168.0.1").build()span = Span.newBuilder()    .traceId("d3d200866a77cc59")    .id("d3d200866a77cc59")    .name("targz")    .localEndpoint(localEndpoint)    .timestamp(epochMicros())    .duration(durationInMicros)    .putTag("compression.level", "9");// Now, you can encode it as jsonbytes = SpanBytesEncoder.JSON_V2.encode(span);

Note: The above is just an example, most likely you'll want to use an existing tracing library like Brave

Storage Component

Zipkin includes a StorageComponent, used to store and query spans anddependency links. This is used by the server and those making collectors, or span reporters. For this reason, storagecomponents have minimal dependencies, but most require Java 8+

Ex.

// this won't create network connectionsstorage = ElasticsearchStorage.newBuilder()                              .hosts(asList("http://myelastic:9200")).build();// prepare a calltraceCall = storage.spanStore().getTrace("d3d200866a77cc59");// execute it synchronously or asynchronouslytrace = traceCall.execute();// clean up any sessions, etcstorage.close();

In-Memory

The InMemoryStorage component is packaged in zipkin's core library. Itis neither persistent, nor viable for realistic work loads. Its purposeis for testing, for example starting a server on your laptop without anydatabase needed.

Cassandra

The Cassandra component uses Cassandra3.11.3+ features, but is tested against the latest patch of Cassandra 3.11.

This is the second generation of our Cassandra schema. It stores spansusing UDTs, such that they appear like Zipkin v2 json in cqlsh. It isdesigned for scale, and uses a combination of SASI and manuallyimplemented indexes to make querying larger data more performant.

Note: This store requires a job to aggregate dependency links.

Elasticsearch

The Elasticsearch component usesElasticsearch 5+ features, but is tested against Elasticsearch 6-7.x.

It stores spans as Zipkin v2 json so that integration with other tools isstraightforward. To help with scale, this uses a combination of customand manually implemented indexing.

Note: This store requires a spark job to aggregate dependency links.

Disabling search

The following API endpoints provide search features, and are enabled bydefault. Search primarily allows the trace list screen of the UI operate.

  • GET /services - Distinct Span.localServiceName
  • GET /remoteServices?serviceName=X - Distinct Span.remoteServiceName by Span.localServiceName
  • GET /spans?serviceName=X - Distinct Span.name by Span.localServiceName
  • GET /autocompleteKeys - Distinct keys of Span.tags subject to configurable whitelist
  • GET /autocompleteValues?key=X - Distinct values of Span.tags by key
  • GET /traces - Traces matching a query possibly including the above criteria

When search is disabled, traces can only be retrieved by ID(GET /trace/{traceId}). Disabling search is only viable when there isan alternative way to find trace IDs, such as logs. Disabling search canreduce storage costs or increase write throughput.

StorageComponent.Builder.searchEnabled(false) is implied when a zipkinis run with the env variable SEARCH_ENABLED=false.

Legacy (v1) components

The following components are no longer encouraged, but exist to help aidtransition to supported ones. These are indicated as "v1" as they usedata layouts based on Zipkin's V1 Thrift model, as opposed to thesimpler v2 data model currently used.

MySQL

The MySQL v1 component uses MySQL 5.6+features, but is tested against MariaDB 10.3.

The schema was designed to be easy to understand and get started with;it was not designed for performance. Ex spans fields are columns, soyou can perform ad-hoc queries using SQL. However, this component hasknown performance issues: queries will eventually take seconds to returnif you put a lot of data into it.

This store does not require a job to aggregate dependency links.However, running the job will improve performance of dependenciesqueries.

Running the server from source

The Zipkin server receives spans via HTTP POST and respond to queriesfrom its UI. It can also run collectors, such as RabbitMQ or Kafka.

To run the server from the currently checked out source, enter thefollowing. JDK 11 is required to compile the source.

# Build the server and also make its dependencies$ ./mvnw -q --batch-mode -DskipTests --also-make -pl zipkin-server clean install# Run the server$ java -jar ./zipkin-server/target/zipkin-server-*exec.jar

Artifacts

Server artifacts are under the maven group id io.zipkinLibrary artifacts are under the maven group id io.zipkin.zipkin2

Library Releases

Releases are at Sonatype and Maven Central

Library Snapshots

Snapshots are uploaded to Sonatype aftercommits to master.

Docker Images

Released versions of zipkin-server are published to Docker Hub as openzipkin/zipkin and GitHubContainer Registry as ghcr.io/openzipkin/zipkin. See docker for details.

Helm Charts

Helm charts are available at https://openzipkin.github.io/zipkin. See charts for details.

Javadocs

https://zipkin.io/zipkin contains versioned folders with JavaDocs published on each (non-PR) build, as wellas releases.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap