Build Telemetry for Distributed Services之Jaeger
github链接:https://github.com/jaegertracing/jaeger
官网:https://www.jaegertracing.io/
Jaeger: open source, end-to-end distributed tracing
Monitor and troubleshoot transactions in complex distributed systems
a Cloud Native Computing Foundation incubating project.
Uber published a blog post, Evolving Distributed Tracing at Uber, where they explain the history and reasons for the architectural choices made in Jaeger. Yuri Shkuro, creator of Jaeger, also published a book Mastering Distributed Tracing that covers in-depth many aspects of Jaeger design and operation, as well as distributed tracing in general.
Why Jaeger?
As on-the-ground microservice practitioners are quickly realizing, the majority of operational problems that arise when moving to a distributed architecture are ultimately grounded in two areas: networking and observability. It is simply an orders of magnitude larger problem to network and debug a set of intertwined distributed services versus a single monolithic application.
Problems that Jaeger addresses
It is used for monitoring and troubleshooting microservices-based distributed systems, including:
- Distributed context propagation
- Distributed transaction monitoring
- Root cause analysis
- Service dependency analysis
- Performance / latency optimization
Kubernetes and OpenShift
- Kubernetes templates: https://github.com/jaegertracing/jaeger-kubernetes
- Kubernetes Operator: https://github.com/jaegertracing/jaeger-operator
- OpenShift templates: https://github.com/jaegertracing/jaeger-openshift
Features
- Discover architecture of the whole system via data-driven dependency diagram.
- View request timeline and errors; understand how the app works.
- Find sources of latency and lack of concurrency.
- Highly contextualized logging.
Use baggage propagation to:
- Diagnose inter-request contention (queueing).
- Attribute time spent in a service.
Use open source libraries with OpenTracing integration to get vendor-neutral instrumentation for free.
Features
- OpenTracing compatible data model and instrumentation libraries
- Uses consistent upfront sampling with individual per service/endpoint probabilities
- Multiple storage backends: Cassandra, Elasticsearch, memory.
- Adaptive sampling (coming soon)
- Post-collection data processing pipeline (coming soon)
Technical Specs
- Backend components implemented in Go
- React/Javascript UI
- Supported storage backends:
- Cassandra 3.4+
- Elasticsearch 5.x, 6.x, 7.x
- Kafka
- memory storage
Span
A span represents a logical unit of work in Jaeger that has an operation name, the start time of the operation, and the duration. Spans may be nested and ordered to model causal relationships.


Trace
A trace is a data/execution path through the system, and can be thought of as a directed acyclic graph of spans
Query
Query is a service that retrieves traces from storage and hosts a UI to display them
参考:
Components
Jaeger can be deployed either as all-in-one binary, where all Jaeger backend components run in a single process, or as a scalable distributed system, discussed below. There two main deployment options:
- Collectors are writing directly to storage.
- Collectors are writing to Kafka as a preliminary buffer.

Illustration of direct-to-storage architecture

Illustration of architecture with Kafka as intermediate buffer
This section details the constituent parts of Jaeger and how they relate to each other. It is arranged by the order in which spans from your application interact with them.
Jaeger client libraries
Jaeger clients are language specific implementations of the OpenTracing API. They can be used to instrument applications for distributed tracing either manually or with a variety of existing open source frameworks, such as Flask, Dropwizard, gRPC, and many more, that are already integrated with OpenTracing.
An instrumented service creates spans when receiving new requests and attaches context information (trace id, span id, and baggage) to outgoing requests. Only ids and baggage are propagated with requests; all other information that compose a span like operation name, logs, etc. are not propagated. Instead sampled spans are transmitted out of process asynchronously, in the background, to Jaeger Agents.
The instrumentation has very little overhead, and is designed to be always enabled in production.
Note that while all traces are generated, only a few are sampled. Sampling a trace marks the trace for further processing and storage. By default, Jaeger client samples 0.1% of traces (1 in 1000), and has the ability to retrieve sampling strategies from the agent.

Agent
The Jaeger agent is a network daemon that listens for spans sent over UDP, which it batches and sends to the collector. It is designed to be deployed to all hosts as an infrastructure component. The agent abstracts the routing and discovery of the collectors away from the client.
Collector
The Jaeger collector receives traces from Jaeger agents and runs them through a processing pipeline. Currently our pipeline validates traces, indexes them, performs any transformations, and finally stores them.
Jaeger’s storage is a pluggable component which currently supports Cassandra, Elasticsearch and Kafka
Ingester
Ingester is a service that reads from Kafka topic and writes to another storage backend (Cassandra, Elasticsearch)
Monitoring Jaeger
Jaeger itself is a distributed, microservices based system. If you run it in production, you will likely want to setup adequate monitoring for different components, e.g. to ensure that the backend is not saturated by too much tracing data
Metrics
By default Jaeger microservices expose metrics in Prometheus format. It is controlled by the following command line options:
--metrics-backendcontrols how the measurements are exposed. The default value isprometheus, another option isexpvar, the Go standard mechanism for exposing process level statistics.--metrics-http-routespecifies the name of the HTTP endpoint used to scrape the metrics (/metricsby default).
Each Jaeger component exposes the metrics scraping endpoint on one of the HTTP ports they already serve:
| Component | Port |
|---|---|
| jaeger-agent | 14271 |
| jaeger-collector | 14269 |
| jaeger-query | 16687 |
| jaeger-ingester | 14270 |
Logging
Jaeger components only log to standard out, using structured logging library go.uber.org/zap configured to write log lines as JSON encoded strings, for example:
{"level":"info","ts":1517621222.261759,"caller":"healthcheck/handler.go:99","msg":"Health Check server started","http-port":14269,"status":"unavailable"}
The log level can be adjusted via --log-level command line switch; default level is info.
Build Telemetry for Distributed Services之Jaeger的更多相关文章
- Build Telemetry for Distributed Services之Open Telemetry简介
官网链接:https://opentelemetry.io/about/ OpenTelemetry is the next major version of the OpenTracing and ...
- Build Telemetry for Distributed Services之OpenCensus:C#
OpenCensus Easily collect telemetry like metrics and distributed traces from your services OpenCensu ...
- Build Telemetry for Distributed Services之OpenTracing实践
官网:https://opentracing.io/docs/best-practices/ Best Practices This page aims to illustrate common us ...
- Build Telemetry for Distributed Services之Open Telemetry来历
官网:https://opentelemetry.io/ github:https://github.com/open-telemetry/ Effective observability requi ...
- Build Telemetry for Distributed Services之OpenTracing简介
官网地址:https://opentracing.io/ What is Distributed Tracing? Who Uses Distributed Tracing? What is Open ...
- Build Telemetry for Distributed Services之OpenTracing项目
中文文档地址:https://wu-sheng.gitbooks.io/opentracing-io/content/pages/quick-start.html 中文github地址:https:/ ...
- Build Telemetry for Distributed Services之Elastic APM
官网地址:https://www.elastic.co/guide/en/apm/get-started/current/index.html Overview Elastic APM is an a ...
- Build Telemetry for Distributed Services之OpenCensus:Tracing2(待续)
part 1:Tracing1 Sampling Sampling Samplers Global sampler Per span sampler Rules References
- Build Telemetry for Distributed Services之OpenTracing指导:C#
官网链接:https://opentracing.io/guides/ 官方微博:https://medium.com/opentracing Welcome to the OpenTracing G ...
随机推荐
- ELK6.x_Kafka 安装配置文档
1. 环境描述 1.1. 环境拓扑 如上图所示:Kafka为3节点集群负责提供消息队列,ES为3节点集群.日志通过logstash或者filebeat传送至Kafka集群,再通过logstash发 ...
- python3使用ConfigParser从配置文件中获取列表
使用python3使用ConfigParser从配置文件中获取列表 testConfig.py #!/usr/bin/env python # coding=utf- __author__ = 'St ...
- idou老师教你学Istio 08: 调用链埋点是否真的“零修改”?
本文将结合一个具体例子中的细节详细描述Istio调用链的原理和使用方式.并基于Istio中埋点的原理解释来说明:为了输出一个质量良好的调用链,业务程序需根据自身特点做适当的修改,即并非官方一直在说的完 ...
- 使用fastjson统一序列化响应格式
摘要:其实很简单的处理方式,只不够优雅,或者说没有找到fastjson为其提供便捷的处理方式.因此记录下处理该问题的过程. 目标:将所有api请求,即响应为APPLICATION_JSON的内容做统一 ...
- layui模块化使用
layui模块化使用分为两部分: 1.自身模块的设置与使用.2.自定义模块的设置与使用.直接上案例吧 <a>加载入口模块与自定义模块设置: <b>自定义模块名 <c> ...
- Python3基础学习-while循环实例- 猜数字游戏
需求: 猜数字游戏, 要求如下: 给个数字, 比如是66. 让用户一直猜,直到猜对退出. 中间输入q或Q也能退出 如果猜大了,提示用户猜小一点; 如果猜小了,提示用户猜大一点; likely = 66 ...
- 在浏览器端用H5实现图片压缩上传
一.需求的场景: 在我们的需求中需要有一个在手机浏览器端,用户实现上传证件照片的功能,我们第一版上了一个最简版,直接让用户在本地选择图片,然后上传到公司公共的服务器上. 功能实现后我们发现一个问题,公 ...
- sql prompt工具
SQL Prompt是一款拥有SQL智能提示功能和格式化Sql代码插件.可用于的SQL Server和VS. SQL Prompt能根据数据库的对象名称,语法和用户编写的代码片段自动进行检索,智能的为 ...
- node 初级概念总结
(1)nodejs跳过了服务器软件 直接充当web服务器,nodejs也没有Web容器 (2)nodejs --- 自身哲学---[花最小的硬件成本,追求更好的并发请求,更高的处理性能] (3)nod ...
- C#第一章 第一个C#程序
第一个C#程序 namespace 是C#中组织代码的方式,它的作用那个类似java中的包 using 在Java中作用如果导入其他包 应该是用import关键字而在C#中应使用using关键字来引用 ...