frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

OpenTelemetry for Go: Measuring overhead costs

https://coroot.com/blog/opentelemetry-for-go-measuring-the-overhead/
61•openWrangler•6h ago

Comments

dmoy•4h ago
Not on original topic, but:

I definitely prefer having graphs put the unit at least on the axis, if not in the individual axis labels directly.

I.e. instead of having a graph titled "latency, seconds" at the top and then way over on the left have an unlabeled axis with "5m, 10m, 15m, 20m" ticks...

I'd rather have title "latency" and either "seconds" on the left, or, given the confusion between "5m = 5 minutes" or "5m = 5 milli[seconds]", just have it explicitly labeled on each tick: 5ms, 10ms, ...

Way, way less likely to confuse someone when the units are right on the number, instead of floating way over in a different section of the graph

Thaxll•4h ago
Logging, metrics and traces are not free, especially if you turn them on at every requests.

Tracing every http 200 at 10k req/sec is not something you should be doing, at that rate you should sample 200 ( 1% or so ) and trace all the errors.

anonzzzies•4h ago
A very small % of startups gets anywhere near that traffic so why give them angst? Most people can just do this without any issues and learn from it and a tiny fraction shouldn't.
williamdclt•4h ago
10k/s across multiple services is reached quickly even at startup scale.

In my previous company (startup), we’d use Otel everywhere and we definitely needed sampling for cost reasons (1/30 iirc). And that was using a much cheaper provider than Datadog

cogman10•3h ago
Having high req/s isn't as big a negative as it once was. Especially if you are using http2 or http3.

Designing APIs which cause a high number of requests and spit out a low amount of data can be quite legitimate. It allows for better scaling and capacity planning vs having single calls that take a large amount of time and return large amounts of data.

In the old http1 days, it was a bad thing because a single connection could only service 1 request at a time. Getting any sort of concurrency or high request rates require many connections (which had a large amount of overhead due to the way tcp functions).

We've moved past that.

orochimaaru•3h ago
Metrics are usually minimal overheard. Traces need to be sampled. Logs need to be sampled at error/critical levels. You also need to be able to dynamically change sampling and log levels.

100% traces are a mess. I didn’t see where he setup sampling.

phillipcarter•2h ago
The post didn't cover sampling, which indeed, significantly reduces overhead in OTel because the spans that aren't sampled aren't ever created, when you head sample at the SDK level. This is more of a concern when doing tail-based sampling only, wherein you will want to trace each request and offload to a sidecar so that export concerns are handled outside your app. And then it routes to a sampler elsewhere in your infrastructure.

FWIW at my former employer we had some fairly loose guidelines for folks around sampling: https://docs.honeycomb.io/manage-data-volume/sample/guidelin...

There's outliers, but the general idea is that there's also a high cost to implementing sampling (especially for nontrivial stuff), and if your volume isn't terribly high then you'll probably eat a lot more in time than paying for the extra data you may not necessarily need.

jhoechtl•2h ago
I am relatively new to the topic. In the sample code of the OP there is no logging right? It's metrics and traces but no logging.

How is logging in OTel?

shanemhansen•12m ago
To me traces (or maybe more specifically spans) are essentially a structured log with a unique ID and a reference to a parent ID.

Very open to have someone explain why I'm wrong or why they should be handled separately.

kiitos•5m ago
Traces have a very specific data model, and corresponding limitations, which don't really accommodate log events/messages of arbitrary size. The access model for traces is also fundamentally different vs. that of logs.
kubectl_h•44m ago
You have to do the tracing anyway if you are going to sample based on criteria that isn't available at the beginning of the trace (like an error that occurs later in the request) and tail sample. You can head sample of course, but that's going to be the most coarse sampling you can do and you can't sample based on anything but the initial conditions of the trace.

What we have started doing is still tracing every unit of work, but deciding at the root span the level of instrumentation fidelity we want for the trace based on the initial conditions. Spans are still generated in the lifecycle of the trace, but we discard them at the processor level (before they are batched and sent to the collector) unless they have errors on them or the trace has been marked as "full fidelity".

kiitos•9m ago
> Tracing every http 200 at 10k req/sec is not something you should be doing

You don't know if a request is HTTP 200 or HTTP 500 until it ends, so you have to at least collect trace data for every request as it executes. You can decide whether or not to emit trace data for a request based on its ultimate response code, but emission is gonna be out-of-band of the request lifecycle, and (in any reasonable implementation) amortized such that you really shouldn't need to care about sampling based on outcome. That is, the cost of collection is >> the cost of emission.

If your tracing system can't handle 100% of your traffic, that's a problem in that system; it's definitely not any kind of universal truth... !

jeffbee•3h ago
I feel like this is a lesson that unfortunately did not escape Google, even though a lot of these open systems came from Google or ex-Googlers. The overhead of tracing, logs, and metrics needs to be ultra-low. But the (mis)feature whereby a trace span can be sampled post hoc means that you cannot have a nil tracer that does nothing on unsampled traces, because it could become sampled later. And the idea that if a metric exists it must be centrally collected is totally preposterous, makes everything far too expensive when all a developer wants is a metric that costs nothing in the steady state but can be collected when needed.
mamidon•2h ago
How would you handle the case where you want to trace 100% of errors? Presumably you don't know a trace is an error until after you've executed the thing and paid the price.
phillipcarter•2h ago
This is correct. It's a seemingly simple desire -- "always capture whenever there's a request with an error!" -- but the overhead needed to set that up gets complex. And then you start heading down the path of "well THESE business conditions are more important than THOSE business conditions!" and before you know it, you've got a nice little tower of sampling cards assembled. It's still worth it, just a hefty tax at times, and often the right solution is to just pay for more compute and data so that your engineers are spending less time on these meta-level concerns.
jeffbee•2h ago
I wouldn't. "Trace contains an error" is a hideously bad criterion for sampling. If you have some storage subsystem where you always hedge/race reads to two replicas then cancel the request of the losing replica, then all of your traces will contain an error. It is a genuinely terrible feature.

Local logging of error conditions is the way to go. And I mean local, not to a central, indexed log search engine; that's also way too expensive.

phillipcarter•1h ago
I disagree that it's a bad criterion. The case you describe is what sounds difficult, treating one error as part of normal operations and another as not. That should be considered its own kind of error or other form of response, and sampling decisions could take that into consideration (or not).
jeffbee•1h ago
Another reason against inflating sampling rates on errors is: for system stability you never want to do more stuff during errors than you would normally do. Doing something more expensive during an error can cause your whole system, or elements of it, to latch into an unplanned operating point where they only have the capacity to do the expensive error path, and all of the traffic is throwing errors because of the resource starvation.
vanschelven•3h ago
The article never really explains what eBPF is -- AFAIU, it’s a kernel feature that lets you trace syscalls and network events without touching your app code. Low overhead, good for metrics, but not exactly transparent.

It’s the umpteenth OTEL-critical article on the front page of HN this month alone... I have to say I share the sentiment but probably for different reasons. My take is quite the opposite: most value is precisely in the application (code) level so you definetly should instrument... and then focus on Errors over "general observability"[0]

[0] https://www.bugsink.com/blog/track-errors-first/

nikolay_sivko•3h ago
I'm the author. I wouldn’t say the post is critical of OTEL. I just wanted to measure the overhead, that’s all. Benchmarks shouldn’t be seen as critique. Quite the opposite, we can only improve things if we’ve measured them first.
politician•3h ago
I don't want to take away from your point, and yet... if anyone lacks background knowledge these days the relevant context is just an LLM prompt away.
vanschelven•2h ago
It was always "a search away" but on the _web_ one might as well use... A hyperlink
sa46•3h ago
Funny timing—I tried optimizing the Otel Go SDK a few weeks ago (https://github.com/open-telemetry/opentelemetry-go/issues/67...).

I suspect you could make the tracing SDK 2x faster with some cleverness. The main tricks are:

- Use a faster time.Now(). Go does a fair bit of work to convert to the Go epoch.

- Use atomics instead of a mutex. I sent a PR, but the reviewer caught correctness issues. Atomics are subtle and tricky.

- Directly marshal protos instead of reflection with a hand-rolled library or with https://github.com/VictoriaMetrics/easyproto.

The gold standard is how TiDB implemented tracing (https://www.pingcap.com/blog/how-we-trace-a-kv-database-with...). Since Go purposefully (and reasonably) doesn't currently provide a comparable abstraction for thread-local storage, we can't implement similar tricks like special-casing when a trace is modified on a single thread.

malkia•2h ago
There is an effort to use arrow format for metrics too - https://github.com/open-telemetry/otel-arrow - but no client that exports directly to it yet.
rastignack•1h ago
Would the sync.Pool trick mentionned here: https://hypermode.com/blog/introducing-ristretto-high-perf-g... help ? It’s lossy but might be a good compromise.
otterley•2h ago
Out of curiosity, does Go's built-in pprof yield different results?

The nice thing about Go is that you don't need an eBPF module to get decent profiling.

Also, CPU and memory instrumentation is built into the Linux kernel already.

coxley•1h ago
The OTel SDK has always been much worse to use than Prometheus for metrics — including higher overhead. I prefer to only use it for tracing for that reason.
reactordev•1h ago
Mmmmmmm, the last 8 months of my life wrapped into a blog post but with an ad on the end. Excellent. Basically the same findings as me, my team, and everyone else in the space.

Not being sarcastic at all, it’s tricky. I like that the article called out eBPF and why you would want to disable it for speed but recommends caution. I kept hearing from executives a “single pane of glass” marketing speak and I kept my mouth shut about how that isn’t feasible across the entire organization. Needless to say, they didn’t like that non-answer and so I was canned. What an engineer cared about is different from organization/business metrics and often the two were confused.

I wrote a lot of great otel receivers though. VMware, Veracode, Hashicorp Vault, GitLab, Jenkins, Jira, and the platforms itself.

phillipcarter•1h ago
> I kept hearing from executives a “single pane of glass” marketing speak

It's really unfortunate that Observability vendors lean into this to reinforce it too. What the execs usually care about is engineering workflows consolidating and allowing teams to all "speak the same language" in terms of data, analysis workflows, visualizations, runbooks, etc.

This goal is admirable, but nearly impossible to achieve because it's the exact same problem as solving "we are aligned organizationally", which no organization ever is.

That doesn't mean progress can't be made, but it's always far more complicated than they would like.

reactordev•1h ago
For sure, it’s the ultimate nirvana. Let me know when an organization gets there. :)

John Carmack – Keen AI [video]

https://www.youtube.com/watch?v=rQ-An5bhkrs
1•tzury•1m ago•0 comments

Boss ordered employees to have sex at Bay Area startup: Witnesses

https://www.courthousenews.com/boss-ordered-employees-to-have-sex-at-bay-area-startup-witnesses/
1•randycupertino•3m ago•1 comments

Enough Is Enough. Israel Is Committing War Crimes

https://www.haaretz.com/opinion/2025-05-27/ty-article-opinion/.premium/enough-is-enough-israel-is-committing-war-crimes/00000197-0dd6-df85-a197-0ff64a5c0000
1•lr0•3m ago•0 comments

Devs are considering quitting because of embarrassing legacy tech, survey finds

https://www.msn.com/en-us/news/technology/devs-are-considering-quitting-en-masse-because-of-embarrassing-legacy-tech-survey-finds/ar-AA1GJoB6
1•ivewonyoung•4m ago•0 comments

Thermochromic Paper Sunshine Clock

https://github.com/anneosaur/paper-sunshine-clock
1•favaloralo•5m ago•0 comments

How I started to run

https://mfelix.org/stories/how-i-started-to-run/
1•objcts•6m ago•0 comments

ReactOS Merges Better Support for Fullscreen Applications

https://www.phoronix.com/news/ReactOS-Fullscreen-Apps
1•LorenDB•6m ago•0 comments

Monads are not like burritos

https://byorgey.github.io/blog/posts/2025/06/16/monads-are-not-burritos.html
1•matt_d•7m ago•0 comments

The Writehander

https://www.computerhistory.org/collections/catalog/102688749
1•wduquette•7m ago•1 comments

Writing in the Age of LLMs

https://www.sh-reya.com/blog/ai-writing/
2•hamelsmu•9m ago•0 comments

Stablecoin firm Circle adds to stellar first day gains with another stock surge

https://www.reuters.com/business/stablecoin-firm-circle-scales-record-high-after-blockbuster-nyse-listing-2025-06-06/
1•janandonly•10m ago•0 comments

What Gallium does to an Aluminium bat [video]

https://www.youtube.com/shorts/BmH6Rr4hwRI
1•lifeisstillgood•10m ago•0 comments

Privacy Friendly Apps - improved privacy protection on the smartphone

https://secuso.aifb.kit.edu/english/105.php
3•jalict•13m ago•0 comments

Show HN: Wordplayground – guess the ambiguous word-pair

https://wordplayground.pages.dev/
1•ytx•15m ago•0 comments

Bot Colony _redux: Humanity Test

https://store.steampowered.com/app/3664740/Bot_Colony__redux_Humanity_Test/
1•bcredux•15m ago•1 comments

A Blockchain Folded Back: ψ-Encoded Game Claims to Archive Observer Consciousnes

https://lightcapai.medium.com/when-the-ledger-looks-back-is-the-blockchain-quietly-archiving-human-consciousness-91e1277ebd16
1•WASDAai•17m ago•1 comments

Inside torch.compile Guards: How They Work, What They Cost, and Ways to Optimize

https://www.youtube.com/watch?v=GmhnYe9QQoM
1•matt_d•24m ago•0 comments

Show HN: Tiny Redirects - Git-based URL shortener using _redirects

https://github.com/rishikeshsreehari/tiny-redirects
1•rishikeshs•27m ago•0 comments

Show HN: Mongoose unit of work – transactions made easy

https://github.com/tauqeernasir/mongoose-unit-of-work
1•tauqeernasir•33m ago•1 comments

Scale AI's Wang Brings to Meta Knowledge of What Everyone Else Is Doing

https://www.bloomberg.com/news/articles/2025-06-16/scale-ai-s-alexandr-wang-brings-meta-his-extensive-competitor-knowledge
2•gametorch•34m ago•0 comments

The Impact of Return-to-Office Mandates on Equity Analysts

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5206058
1•petethomas•34m ago•0 comments

Show HN: Chawan TUI web browser

https://chawan.net/news/chawan-0-2-0.html
25•shiomiru•35m ago•1 comments

The Modern Observability Roundtable: AI, Rising Costs and OpenTelemetry

https://thenewstack.io/the-modern-observability-roundtable-ai-rising-costs-and-opentelemetry/
1•oavioklein•37m ago•0 comments

Fugento: How an AI and a Human Built a Magento 2 Assistant Together

https://medium.com/@saccitizen/the-tale-of-fugento-how-an-ai-and-a-human-built-a-magento-2-assistant-together-f1681ab83c60
1•Matsonian•39m ago•0 comments

Logarithms of algebraic data types for property-based testing (2022)

https://dl.acm.org/doi/abs/10.1145/3498726
1•fanf2•42m ago•0 comments

Penn State boffins create silicon-free two-dimensional computer

https://www.theregister.com/2025/06/16/penn_state_boffins_2d_cmos/
3•moose44•44m ago•1 comments

How Do Olympiad Medalists Judge LLMs in Competitive Programming?

https://arxiv.org/abs/2506.11928
1•npalli•46m ago•1 comments

Levels.fyi's Over-the-Air Updates on Mobile App

https://www.levels.fyi/blog/over-the-air-updates.html
1•zuhayeer•47m ago•0 comments

phkmalloc

https://phk.freebsd.dk/sagas/phkmalloc/
4•matt_d•48m ago•0 comments

Flashes of lucidity before death: The debate shaking up neuroscience

https://english.elpais.com/science-tech/2025-06-16/flashes-of-lucidity-before-death-the-debate-shaking-up-neuroscience.html
3•domofutu•49m ago•0 comments