DEV Community

Cover image for OpenTelemetry traces for everything with tracepusher
Adam Gardner
Adam Gardner

Posted on

OpenTelemetry traces for everything with tracepusher

OpenTelemetry is everywhere. If you don't already know, it is an open standard (and large ecosystem) which allows for logs, metrics and distributed traces.

If you don't know what a distributed trace is, think of it like a Gantt chart or timeline of your work, across (as the name suggests) multiple tiers or "steps".

A complex multi-span OpenTelemetry trace generated by tracepusher

Luckily most applications and vendors are now starting to instrument their code to automatically emit OpenTelemetry metrics - so things like nginx, apache and databases will (if not yet) soon "just work" and you'll "just get" traces.

What about the older stuff?

Although we aim for entirely modern practices, let's be honest. There's still the odd (Power)shell script, Cron Job and Jenkins pipeline lying around...

How do we get observability of those?

Answer: tracepusher

tracepusher (on GitHub) is an open source utility which generates OpenTelemetry spans on demand, so you call it and it will generate and send the data to a backend for visualisation.

tracepusher \
  --endpoint=http://YourOpenTelemetryCollector:4318 \
  --service-name=serviceA \
  --span-name="main_span" \
  --duration=2500 \
  --duration-type=ms
Enter fullscreen mode Exit fullscreen mode

Now you can trace literally anything you want:

  • Shell scripts
  • Powershell scripts
  • CICD pipelines (Jenkins, Gitlab, GitHub Actions)
  • Kubernetes Jobs
  • Converting mainframe logs

tracepusher supports span events, span attributes, complex (multi-span) support and more.

tracepusher is available on GitHub (and the docs are here)

Top comments (0)