[HN Gopher] OpenTelemetry Tracing in < 200 lines of code
___________________________________________________________________
OpenTelemetry Tracing in < 200 lines of code
Author : masterj
Score : 76 points
Date : 2024-09-17 17:21 UTC (5 hours ago)
(HTM) web link (jeremymorrell.dev)
(TXT) w3m dump (jeremymorrell.dev)
| thewisenerd wrote:
| the "true spec is the data" is very powerful.
|
| for example, we translate our loosely OTEL-based telemetry into a
| format which was consumable by any otel collector.
|
| shim a few fields, et voila! can be read by Jaeger-UI. free trace
| tree visualization.
| Ciantic wrote:
| The utility of tracing is great, I've been using Azure
| Application Insights with NodeJS (and of course in .NET). This is
| relatively simple because it monkey patches itself everywhere if
| you go through the "classic" SDK route. Then adding your own data
| to logs is just a few simple functions trackTrace,
| trackException, trackEvent, etc.
|
| However, if you want to figure out how it works you might be
| scared, it is not lightweight. I just spent a few days digging
| through the Azure Application Insights NodeJS code base which
| integrates with OpenTelemetry packages. It's an utter mess, a
| huge amount of abstractions. Adding it to the project brought 100
| MB and around 40 extra packages.
| h1fra wrote:
| I have one biff against otel, it's not possible to stream a
| trace. You have to build a big object in memory that is not
| suitable for a long-running process. And because of that it's not
| possible to start it somewhere and finish it somewhere else
| thephyber wrote:
| I'm under the impression this is wrong. A trace is made from
| one or more spans. So long as the context is propagated[1] from
| one service to another, any number of spans referring to the
| same trace can be generated anywhere at any time. The
| trace+spans don't have to be created in the order of a stack.
|
| [1] https://opentelemetry.io/docs/concepts/context-propagation/
| phillipcarter wrote:
| This is correct. Traces are made up of spans that can be
| created within the same process, different processes,
| different machines, etc. and all emitted asynchronously.
| eterm wrote:
| I don't think that's a limitation of the specification. You can
| create spans and emit events for those spans without holding
| objects in memory.
___________________________________________________________________
(page generated 2024-09-17 23:00 UTC)