OpenTelemetry Golang Tutorial
In this tutorial, we will learn how to set up tracing in Grafana and Kubernetes using OpenTelemetry with Golang. We will also explore Tempo, an open-source distributed tracing system for monitoring and troubleshooting distributed systems.
Setting up OpenTelemetry with Golang
To get started with OpenTelemetry in Golang, you first need to install the necessary packages. You can do this by using the following command:
go get go.opentelemetry.io/otel go get go.opentelemetry.io/otel/exporters/otlp go get go.opentelemetry.io/otel/sdk
Tracing in Grafana
Once you have set up OpenTelemetry in your Golang application, you can start tracing your application. To view these traces in Grafana, you will need to set up an OpenTelemetry exporter that sends the traces to Grafana. Here is an example of how you can set up the exporter:
exporter, err := otlp.NewExporter( otlp.WithInsecure(), otlp.WithAddress("localhost:4317"), )
Tracing in Kubernetes
Tracing in Kubernetes can be done by configuring the OpenTelemetry exporter to send the traces to a centralized tracing system like Tempo. Here is an example of how you can set up the exporter to send traces to Tempo:
exporter, err := otlp.NewExporter( otlp.WithSecure(), otlp.WithAddress("tempo.example.com:4317"), )
Using Tempo for Distributed Tracing
Tempo is an open-source tracing system that is designed to store and analyze trace data in a scalable and cost-effective way. By sending your traces to Tempo, you can easily monitor and troubleshoot your distributed systems. To configure your OpenTelemetry exporter to send traces to Tempo, use the following code:
exporter, err := otlp.NewExporter( otlp.WithSecure(), otlp.WithAddress("tempo.example.com:4317"), )
By following this tutorial, you can set up tracing in Grafana and Kubernetes using OpenTelemetry with Golang and utilize Tempo for monitoring and troubleshooting your distributed systems.
👉 [Playlist] Kubernetes Tutorials: https://www.youtube.com/playlist?list=PLiMWaCMwGJXnHmccp2xlBENZ1xr4FpjXF
👉 [Playlist] Terraform Tutorials: https://www.youtube.com/playlist?list=PLiMWaCMwGJXmJdmfJjG3aK1IkU7oWvxIj
👉 [Playlist] Network Tutorials: https://www.youtube.com/playlist?list=PLiMWaCMwGJXluySjXqWG6fg1H1hzd-zWz
👉 [Playlist] Apache Kafka Tutorials: https://www.youtube.com/playlist?list=PLiMWaCMwGJXlL8-E-xu8RBwyC5YfS3V5e
👉 [Playlist] Performance Benchmarks: https://www.youtube.com/playlist?list=PLiMWaCMwGJXl-h2RgOSpdO-pQaSRwlVjd
👉 [Playlist] Database Tutorials: https://www.youtube.com/playlist?list=PLiMWaCMwGJXnhmmh5pu9sdWekdRwAzV5f
it doesn't need otel operator to be installed
Great content! very useful. Thank you very much!
Good video! Is it possible to integrate opentelemetry without editing the application code, since adding the ‘trace.xxx’ is really painful in large application. I would expect if there is a library for adding the hooks in the start and end of all functions, and record the called function as span with its name.
Jaeger UI not the localhost ?
Great content! One of the best channels to learn from.
oh very detail explanation and useful, thank a lot!!!
Is it normal to have to manually place Jaeger Tracing in the application to be able to place the body inside Jaeger Web or is there an automatic way to see the body on a Tracing platform like Jaeger Web?
Very helpful video about tracing. I will implement on my project. Please make video on nodejs microservices Tracing with Opentelemetry and Tempo on AWS EKS.
I wish you showed case using helm to add the tempo data source using terraform as well
Well done
what about make video about Grafana-agent? It's a very promising thing and can replace all exporters in the cluste.