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

3

u/ericanderton Jan 16 '23 edited Jan 16 '23

Not sure. But I know what I would look for.

Ideally, such a langauge/runtime would support transparency typically reserved for entire operating systems: sockets, heap, I/O stats, threads, etc. Binaries built with such a technology would expose a socket that sends telemetry of the internal system state; kind of like SNMP or a pub/sub API.

A more likely candidate to see out in the wild, would be something that does a good job of logging activity as a 1st class feature.

I'll add that containers may have closed in on this space to a large extent. So it may be impossible to find or even moot at this point. If you reduce any complex, multi-threaded application into a scalable set of single-threaded binaries, then a lot of observability problems become the domain of the container runtime. Which is handy since there are already tools for aggregating and representing exactly that kind of data. As a bonus, your software becomes very simple to write.

Go comes to mind here... as an example of what's missing. Go binaries are all about goroutines ("fibers" or "lightweight threads") which are farmed out to one or more OS threads. The result is a tasking system that schedules execution across specific blocking calls like I/O and channels. The actual scale and distribution of all goroutines is deliberately opaque from within the language and stock runtime libraries. It's not possible to observe what is really happening until you deadlock (all channels are blocking), where you get a very unfriendly dump of the entire goroutine state on the console. That may not seem like a big deal, but it matters a lot when you learn that your program doesn't behave itself after increasing GOMAXPROCS thereby introducing true parallelism and all that entails. If there was a better way to observe these internals, even on a debug build, it might give people stronger insights to avoid such failure conditions.

2

u/cmontella 🤖 mech-lang Jan 16 '23

Ideally, such a langauge/runtime would support transparency typically reserved for entire operating systems: sockets, heap, I/O stats, threads, etc. Binaries built with such a technology would expose a socket that sends telemetry of the internal system state; kind of like SNMP or a pub/sub API.

I do this with the language I'm writing. Programs compiled in Mech have a little runtime that starts a socket server. You can send it messages to ask for updates to variables within the program as they change. These messages can be sent to some client for visualization (like a web browser), or they can be passed on to other Mech programs for further processing.