What's OpenTelemetry
OpenTelemetry is like a smart monitoring system for your software. Imagine you're running a delivery business with lots of drivers. You’d want to track where they go, how fast they are, and if they run into any issues. OpenTelemetry does the same for your applications—it helps you see what’s happening inside your code, servers, and services in real time.
It collects traces (steps in a process), metrics (performance data), and logs (error messages or events) so you can understand how your system is working and fix problems faster. It’s open-source and works with many tools like Prometheus, Jaeger, and Grafana.
In short, it’s like having a dashboard for your entire software, showing where things slow down or break, so you can improve them.
It works with any programming language.
To get Started there are other technologies you need to be aware about the LGTM :
Loki
Grafana
Tempo
Pro M etheus
To use OpenTelemetry, we need a backend to store and visualize the data, and here where the role of LGTM comes in.
*Grafana * which is the frontend UI where you can visualize your data, you can also setup alerts, create dashboards.
Prometheus; it's a time series database for storing metrics.
Tempo; a database for storing traces.
Loki; database for storing logs.
Metrics, Traces and Logs are the main trinity for software observability
Collectively that forms the OTEL-LGTM stack where data is collected with OpenTelemetry, stored in these databases and visualized with Grafana.
How to implement
You can find a ready to use docker image provided by Grafana :
Use your favorite hosting provider to make a docker server, it's just an UBUNTU with docker preinstalled.
Set up an SSH key, once the server is up and running go to the management dashboard and you will find instructions on how to connect with SSH.
Copy the provided IP address and go to your terminal then run
ssh root@[IP_ADDRESS]
Now you have admin access to the main frame of the hosting server
At this point you can run this docker command :
docker ps
to verify that the docker daemon is live and well.Now run the docker image with :
docker run -p 3000:3000 -p 4317:4317 -p 4318:4318 --rm-ri grafana/otel-lgtm
-It will take a minute to pull the docker image from the cloud, then it should run at localhost :
- Log in as admin and Congratulations, you are now running the LGTM stack.
Now just run your app on localhost and set up the configuration depends on the technology you are using, after establishing the connection just navigate in the app normally and go back to grafana dashboard and you will find detailed logs of all the errors that happened or could happen and analyze everything there.
Top comments (5)
Glad to see people posting about OpenTelemetry! I think it is a very well thought piece of technology, and in my mind certainly a leap forward from previous telemetry designs.
Over here we even use it as a tool for software development - not only for monitoring systems in production, but also to 'measure' progress. Things like - how much resources does this algorithm need? Is our next release be better than the previous? What areas of our code need improvement? And so on...
I won't go further with details in this comment, as I don't want to sound salesy - but if anyone is interested - drop a comment here, I am happy to share, there's plenty of stuff on the internet.
@zorous - if you'd like to write more about OTEL - might be able to help! :)
@zethix - That’s awesome! I appreciate the offer. OpenTelemetry is definitely a fascinating topic, and I’d love to dive deeper. What aspects do you think would be most interesting to cover?
Ah, well, kinda depends on your preferences (I see you're posting about .NET?) and what level of experience you'd like to target?
You can do some simple things - OpenTelemetry has a demo app - it's an Astronomy web shop implemented in multiple microservices (and some of them are .NET). If you launch it - it's perhaps the easiest way to get some telemetry data to play with. As it has .NET services inside - you can also show other .NET developers what's in there for them...
You can also write some simple .NET app and instrument it (in the OTEL docs this is called manual instrumentation ) and then show what happens when instrumented code is executed...
You can dig deeper into each of the signals... logs, metrics, traces...
Thanks for the suggestion! I'm actually relatively new to .NET, and I'm just documenting my learning journey here. My main focus has been on JavaScript and its frameworks, as well as PHP with Laravel. However, the demo app you mentioned sounds intriguing, and I'll definitely check it out to explore the telemetry features it offers
Sure, take a look, play with it - it's easy. Let me know if I can help further :)