DEV Community

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

Posted on

1

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)

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay