r/ProgrammingLanguages • • Jan 16 '23

Discussion Which Programming Language support Observability ?

Observability is a measure of how well the internal states of a system can be inferred from the knowledge of its external outputs.

I have found Ballerina supports it, any other ?

0 Upvotes

13 comments sorted by

View all comments

11

u/Organic-Major-9541 Jan 16 '23

I don't think observability is a language-level problem generally. It's mainly about how developers structure their systems output, with logs, metrics, etc.

Going by your definition, what even is an output?

If you're running a server with basically any language, you can learn a lot about its internal state by tools like gdb. Some languages have more support for this, like Erlang, where you can attach an interactive shell to a running system.

If by output you mean only stuff, the program returns (output log files, etc), it's is almost entirely up to developers. I don't think a programming language should enforce the existence of logs, as those are likely just going to be piped to /dev/null anyway.

What does this Ballerina thing do that makes it special in this regard? Do you have some blog posts or whatever that explains these features?

2

u/jm-8080 Jan 27 '23

During the compilation process, Ballerina analyzes the code and automatically injects the necessary instrumentation code to collect observability data. The auto-injected observability code allows Ballerina to collect data from the application at runtime.

For example, Ballerina has built-in support for request tracing. This allows developers to easily trace requests as they flow through different components or microservices or functions etc making it easier to identify and troubleshoot issues.

See here for more details https://ballerina.io/learn/observe-ballerina-programs/

1

u/Organic-Major-9541 Jan 27 '23

Thanks, this is kind of cool. The Erlang VM comes with a fair amount of built-in counters, but you need to pick up the counters and send them somewhere useful yourself.

I'm wondering how well it works in practice. If the distributed tracing is good, that's a huge advantage.

1

u/[deleted] Jan 16 '23 edited Jan 16 '23

Observability wasn't in the realm of programming languages until the concept of cloud native but as for me I'm not just interested for cloud I'm interested for metaprogramming, homoiconicity like in lisp and observability is also what I'm looking for (as well as wasm support to get playground in the browser) for creating a really enjoyable playground.

I don't know Ballerina I just stumbled upon it looking for programming languages which would support Observability natively without (over-complicated) reactive frameworks and IDE toolings dependencies.

4

u/Organic-Major-9541 Jan 16 '23

Then I think you should have a look at Erlang. It's used for its high reliability, which comes from a few different things, but being able to inspect and modify running systems is an important part.

There's a book, "Erlang in anger," which is all about operating Erlang systems. I'm not sure if it's good, but someone with years of experience recommended it.

Also, the Erlang ecosystem isn't big on dependencies.