OpenTelemetry 落地困境复盘:维护者稀缺与稳定性博弈
OpenTelemetry 落地困境与复盘
For years now one of the most reliable complaints I hear when I try to drag a team off their vendor specific SDK and onto OpenTelemetry is some variation of: "why does it seem like this isn't done yet?"
多年来,当我试图将团队从特定厂商的 SDK 迁移到 OpenTelemetry 时,我听到的最可靠的抱怨之一就是某种形式的:"为什么看起来这还没完成?"
Vendor SDKs for observability are, to put it charitably, idiot-proof. You install the thing, dashboards just load data, someone else worries about how all those pieces fit together, and you get on with your life. OpenTelemetry, by contrast, greets you at the door with a lot of "experimental" stamps and roughly six different ways to accomplish any given task.
可观测性领域的厂商 SDK,说得委婉点,是傻瓜式的。你安装好它,仪表板就会自动加载数据,别人会操心如何将这些部分整合在一起,然后你就可以继续你的生活了。相比之下,OpenTelemetry 在门口就给你盖上了许多 "experimental"(实验性)印章,并且对于完成任何给定任务提供了大约六种不同的方法。
In OpenTelemetry's defense this was never what they were going for as a project. I've always respect that they stuck to their guns by attempting to build a truly vendor agnostic system that really doesn't care what you do with the data. I have never gotten a sense of a vendor being strongly preferred with OTel, which is quite the feat considering how lucrative and contentious the observability ecosystem was. Also considering that the maintainers of this project are largely employed by exclusively those companies.
为 OpenTelemetry 辩护的是,这从来不是该项目所追求的目标。我一直尊重他们坚持初衷,试图构建一个真正厂商无关的系统,该系统对数据的用途毫不在意。我从未感觉到 OTel 强烈偏向某个特定厂商,考虑到可观测性生态系统的巨大利益和争议性,这确实是一项壮举。此外,还要考虑到该项目的维护者大多受雇于这些公司。
As the years wore on, I started to get nervous. Conversations in the semantic-conventions repo drag on and on and on. Different languages had dramatically different stories. Golang and Dotnet were first class citizens, but other languages lagged years behind the others.
随着岁月流逝,我开始感到不安。semantic-conventions 仓库中的讨论没完没了。不同语言的情况截然不同。Golang 和 Dotnet 是一等公民,但其他语言则落后于前者数年。
I started asking a lot of probing questions before recommending OpenTelemetry to smaller teams who didn't have the time, budget, or emotional bandwidth for it. Auto-instrumentation was genuinely magical, but the cliff between "auto-instrument works" and "now I have to manually instrument something" was steep enough that you owed people a warning before you pushed them off it.
在向那些没有足够时间、预算或精力来使用 OpenTelemetry 的小型团队推荐之前,我开始提出许多深入的问题。自动插桩确实令人惊叹,但从 "自动插桩有效" 到 "现在我必须手动插桩某些东西" 之间的悬崖陡峭得足以让你在推人下去之前先给予警告。
This narrative has been going on for awhile in the observability space, a vague sense of "something is wrong in Otel-land". But let's try to generate some actual data here. Is there an actual problem, or is this something where the perception by the community of slow progress is imaginary? Is the problem not enough maintainers, too big of a scope, or something in-between?
这种叙事在可观测性领域已经持续了一段时间,一种模糊的感觉是 "Otel-land 中有些不对劲"。但让我们尝试生成一些实际数据。是否存在真正的问题,还是说社区对进展缓慢的看法只是想象出来的?问题在于维护者不足、范围过大,还是介于两者之间?
My guess when I started was "oh this is your classic open-source bit off more than they can chew". Not enough maintainers, not enough budget. Now there is some of that, but there's also something else going on.
我最初的猜测是 "哦,这是典型的开源项目贪多嚼不烂"。维护者不足,预算也不够。现在确实存在这种情况,但也有一些其他因素在起作用。
The actual problem happening inside of OpenTelemetry is a three way crash. You have a binary stability gate which, when combined with a very small bench of actual maintainers means there is understandable worry about marking a feature not experimental then add on just a massive scope of languages and frameworks they are attempting to cover. This creates a perfect storm where there is an incentive to argue about potential problems a feature might create since once it is locked in and shipped as stable you can never change them.
OpenTelemetry 内部发生的实际问题是一场三方崩溃。你有一个二进制稳定性门禁,当它与极少数实际维护者结合时,意味着人们有理由担心:一旦将某个功能标记为非实验性,随后又加上庞大的语言和框架覆盖范围,他们试图涵盖的内容就会变得极其广泛。这造成了一种完美的风暴局面,即存在争论该功能可能引发潜在问题的动机,因为一旦它被锁定并以稳定版发布,你就永远无法再更改它们。
How does OpenTelemetry Work
OpenTelemetry 如何工作
So OpenTelemetry currently is attempting to support a dizzying number of languages and frameworks.
因此,OpenTelemetry 目前正试图支持令人眼花缭乱的各种语言和框架。
OpenTelemetry is a giant project. It spans dozens of languages, hundreds of libraries, and countless backends. To keep things sane, the project splits work into two buckets:
OpenTelemetry 是一个庞大的项目。它跨越数十种语言、数百个库以及无数后端。为了保持秩序,该项目将工作分为两个类别:
- Core → Maintained directly by the OTel project. Small, stable, vendor-neutral, and tightly reviewed. This is the "spec-defining" surface.
- Contrib → Community- and vendor-contributed. Broader, faster-moving, and covers the long tail of integrations.
- Core(核心)→ 由 OTel 项目直接维护。规模小、稳定、厂商中立且经过严格审查。这是“定义规范”的表面接口。
- Contrib(贡献)→ 由社区和厂商贡献。范围更广、迭代更快,并涵盖了长尾集成部分。
There exists the otel-collector, the thing that runs along the thing so that you can ship logs metrics and traces. That copies the same rough pattern. But for the languages when we're talking about core vs contrib this is what we're talking about.
存在 otel-collector,它是运行在基础设施旁以便你发送日志、指标和追踪数据的组件。它也采用了类似的粗略模式。但对于我们讨论的核心与贡献之间的区别而言,这里指的是编程语言层面的情况。
| opentelemetry-python (core) | The API, SDK, OTLP exporter, context propagation, resource detection primitives |
|---|---|
| opentelemetry-python-contrib | Instrumentation libraries for Flask, Django, requests, psycopg2, Redis, Kafka, boto3, etc. |
| opentelemetry-python(核心) | API、SDK、OTLP 导出器、上下文传播、资源检测原语 |
|---|---|
| opentelemetry-python-contrib | Flask、Django、requests、psycopg2、Redis、Kafka、boto3 等的仪器化库 |
Stuff that breaks goes in contrib, stuff that doesn't break goes into core.
会出问题的东西放入 contrib,不会出问题的东西放入 core。
Now the reason this causes a conflict. contrib is massive overkill for most projects. You don't want 300 exporters to add the one you typically need. On the language side, this isn't that big of a problem. pip install opentelemetry-instrumentation-flask gives you the stuff you need for flask. However on the collector side you end up having to do the OpenTelemetry Collector Builder to make your own collector (or just kinda ride the wave and hope it works out). While cool that this exists, it's a lot of scope to ask a team to take on.
现在,这就是导致冲突的原因。contrib 对于大多数项目来说是大材小用。你不需要添加 300 个导出器来使用其中一个你通常需要的。在语言层面,这不是什么大问题。pip install opentelemetry-instrumentation-flask 就能给你 Flask 所需的东西。然而,在 collector 层面,你最终不得不使用 OpenTelemetry Collector Builder 来构建自己的 collector(或者只是随波逐流,希望它能正常工作)。虽然这很酷,但要求团队承担这么大的范围确实很多。
Process of adding a new feature
添加新功能的过程
So I believe I have captured the workflow of adding a new feature to OTel. You can check my homework here:
所以我认为我已经捕捉到了向 OTel 添加新功能的流程。你可以在这里查看我的作业:
- OpenTelemetry Enhancement Proposal (OTEP) (https://github.com/open-telemetry/opentelemetry-specification/tree/main/oteps/)
- Once the OTEP is accepted, the text goes into the Specification directory in the same repo.
- After that it seems to go to Semantic conventions. This seems to be where we get down to the specific details and where most of the long discussions seem to live. At this point we're talking about more or less a permanent commitment to this design and where the lock-in process becomes very hard to change.
- Each of the SDKs implements the API surface that is defined in the specification. Now some of the SDKs have done 2.0 breaking changes, so it does seem like the earlier "please no 2.0 at all costs" sentiment has been abandoned (which I think is smart and good).
- Contrib / instrumentation. This is slightly more mushy. Looks like they should track latest API/SDK but each contrib package may version independently so its more flexible as a design.
- Collector + OTLP. The data has to actually go somewhere. OTLP (wire protocol) has its own stability lifecycle and specification (here). Collector components have their own stability in their READMEs and as far as I can tell that's kinda all over the place.
- OpenTelemetry 增强提案 (OTEP) (https://github.com/open-telemetry/opentelemetry-specification/tree/main/oteps/)
- 一旦 OTEP 被接受,文本就会进入同一仓库中的规范目录。
- 之后它似乎会进入语义约定(Semantic conventions)。这似乎是我们要深入具体细节的地方,也是大多数长期讨论发生的地方。此时我们谈论的几乎是对该设计的永久性承诺,而锁定过程变得非常难以改变。
- 每个 SDK 都实现了规范中定义的 API 表面。现在一些 SDK 已经进行了 2.0 破坏性变更,所以看起来早期的“不惜一切代价不要 2.0”的情绪已经被抛弃了(我认为这是明智且好的做法)。
- Contrib / instrumentation(贡献/插桩)。这稍微有点模糊。看起来它们应该跟踪最新的 API/SDK,但每个 contrib 包可以独立版本化,因此作为设计来说更加灵活。
- Collector + OTLP。数据必须实际发送到某个地方。OTLP(线协议)拥有自己的稳定性生命周期和规范(此处)。Collector 组件在它们的 README 中有自己的稳定性说明,据我所知,这有点杂乱无章。
Things I'm not really clear on
我不太清楚的事情
- It's unclear how long the OTEP -> Specification process takes. I've looked through the Git history but there doesn't seem to be any predictable number or cycle.
- I don't fully understand what is the relationship between all these stability commitments. Does Collector + OTLP group work in lockstep? Can a language "fall out of scope" if you lag too far behind?
- OTEP -> 规范的过程需要多长时间尚不清楚。我查看了 Git 历史记录,但似乎没有任何可预测的数字或周期。
- 我并没有完全理解所有这些稳定性承诺之间的关系。Collector + OTLP 组是否同步工作?如果你落后太多,一种语言是否会‘超出范围’?
Attempting to test it
尝试对其进行测试
So because OpenTelemetry is a CNCF project, I figured it made the most sense to compare them to other CNCF projects. My basis for comparison is Envoy and Prometheus. I have used a hacky Python script I've used before for measuring the "health" of open-source projects, which is probably not the best. However I'll include a link to the raw data without the charts so folks can review it and (more than likely) find a problem in what I generated.
由于 OpenTelemetry 是 CNCF 项目,我认为将其与其他 CNCF 项目进行比较是最有意义的。我的比较基准是 Envoy 和 Prometheus。我使用了一个我之前用来衡量开源项目‘健康度’的 hacky Python 脚本,这可能不是最好的方法。不过,我会提供原始数据的链接(不含图表),以便大家审查并(更有可能地)发现我生成内容中的问题。
So we look at 24 months of activity for Envoy and what we see is a pretty healthy project. There's good distribution of authors, mergers, issue closers. phlax is obviously pretty important to the project but in general there's a good bench of people to step in if needed. I've attempted to filter out all the known bot traffic.
所以我们查看 Envoy 过去 24 个月的活动情况,我们看到的是一个相当健康的项目。作者、合并请求者、问题关闭者的分布都很良好。phlax 显然对项目非常重要,但总体而言,如果需要,有一批人可以随时顶上。我已经尝试过滤掉所有已知的机器人流量。
Let's compare that to one of the OpenTelemetry languages. The ones I have the most professional experience with are Golang and Python, but I hear from a lot of folks in the community that the Ruby and PHP ones struggle a lot. This is the PHP one for the same period.
让我们将其与 OpenTelemetry 的某一种语言进行比较。我在 Golang 和 Python 方面拥有最多的专业经验,但我从社区中的许多人那里听说 Ruby 和 PHP 的版本遇到了很多困难。这是同一时期内 PHP 版本的情况。
So we see pretty clearly that there's way too much concentrated on 2 people. This is not a healthy open-source project and they clearly don't have enough people to cover the kind of scope OTel needs to cover. Same story with Ruby.
因此我们清楚地看到,工作量过于集中在两个人身上。这不是一个健康的开源项目,他们显然没有足够的人手来覆盖 OTel 需要覆盖的范围。Ruby 的情况也是如此。
In comparison the "strongest" OpenTelemetry SDKs in my opinion, Golang and Dotnet (although Python is also no slouch) look more healthy.
相比之下,我认为“最强”的 OpenTelemetry SDKs——Golang 和 Dotnet(尽管 Python 也不逊色)看起来更健康。
Golang
Golang
So the first issue is maybe the least surprising. There's too much concentration among too few maintainers. Your authors shouldn't also be your mergers and your issue closers. Ideally these tasks should be distributed out more evenly.
所以第一个问题也许是最不令人惊讶的。维护者太少,导致工作过度集中。作者不应同时担任合并者和问题关闭者。理想情况下,这些任务应该更均匀地分配出去。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力