Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
头条的数据模型 Span: 一个有时间跨度的事件,例如一次 RPC 调用,一个函数执行。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Agent 底层代码研究
Cat
https://github.com/dianping/cat/wiki/client
把整个Trace 消息数本地Thread 保存加入queue 中, 异步上报给Server。
上报的数据不是Span,而是消息树 Message Tree
OTel
两种方式自动侵入
https://opentelemetry.io/docs/concepts/instrumenting-library/
OpenTelemetry provides automatic instrumentation for many libraries, which is typically done through library hooks or monkey-patching library code.
OTel Agent 支持两种主要数采上报Export 方式
Batch
https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java
OpenTelemetry tracing supports two strategies to get traces out of an application, a “SimpleSpanProcessor” and a “BatchSpanProcessor.” The SimpleSpanProcessor will submit a span every time a span is finished, but the BatchSpanProcessor buffers spans until a flush event occurs. Flush events can occur when a buffer is filled or when a timeout is reached.
The BatchSpanProcessor has a number of properties:
Simple
比如Http 具体 export 上报数据
https://github.com/open-telemetry/opentelemetry-java/blob/main/exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/http/trace/OtlpHttpSpanExporter.java
真正实现
https://github.com/open-telemetry/opentelemetry-java/blob/main/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/okhttp/OkHttpExporter.java
Httpclient 用的
OKHttp3
https://github.com/square/okhttp
OTel export 原理
定量队列,收集一定数量的Span 才去上报,它不是做按Database 思路组织数据,定位还是
transmission system
高并发系统Span 上报的优化思路
To avoid getting rate limited, we recommend these practices:
批量处理
数据传播压缩
Beta Was this translation helpful? Give feedback.
All reactions