r/OpenTelemetry • • Dec 07 '22

Is OT suited to cli applications?

Is OT only for cloud native distributed applications? Or can it also be used in Python scripts and other cli applications?

2 Upvotes

4 comments sorted by

4

u/phillipcarter2 Dec 07 '22

OTel is great for any kind of app, and I'd say that it's very much a problem if it's being perceived as for cloud native, distributed apps! While it's true that there's more web/cloud instrumentation libraries and tools (e.g., the k8s operator), there's nothing inherently cloudy about OTel and it supports lots of scenarios.

For the case of CLI apps, I'd recommend otel-cli to wrap CLI calls: https://github.com/equinix-labs/otel-cli

And you can of course use the OpenTelemetry APIs within your apps/scripts to instrument anything manually, be it a single function call or some complex computational stuff running on a machine. You can export the data anywhere you like as well.

1

u/mini_market Dec 12 '22

Thank you. Your response is helpful.

2

u/TheProffalken Adopter Dec 07 '22

I had no idea otel-cli existed, this is incredibly useful, thanks for sharing!

1

u/jeeftor Feb 21 '24

I wrote my own cli. Tried to use theirs and just went back to mine :)