ruby

Better Observability on Ruby on Rails Logs with OpenTelemetry Trace and Span ID

February 24, 2023
tutorials
ruby, rails, opentelemetry

Ruby on Rails (RoR) is a common framework used by Ruby developers when building web application. It ships with common libraries from logger to active record (for easily querying from database). But, like many current framework in others programming language, we need to write some extra code to make our application easier to observe and debug. For example, on small traffic application we may satisfied by printing some logging such as: ...

Better Observability on Ruby on Rails Logs with OpenTelemetry Trace and Span ID (Part 1 - Preparing Rails Application)

February 24, 2023
tutorials
ruby, rails, opentelemetry

In this part, I will mainly focusing on preparing Rails application. If you already know about the Rails and want to only focusing on how to make the logs better, you can skip this part and jump to Part 2. Prepare Rails Application # To make this tutorial is easier to follow both for experienced RoR developers and newcomers, I will create easy to follow step by step tutorial from installing Rails to adding OpenTelemetry library to customize the log output in Rails application. ...

Better Observability on Ruby on Rails Logs with OpenTelemetry Trace and Span ID (Part 2 - Improving Log Output)

February 24, 2023
tutorials
ruby, rails, opentelemetry

In previous part you already know how to setup a simple (really simple) Rails application with one route. In this part, I will focusing on how we improve the log printed by the standard Rails application. To recap, if you want to follow this article smoothly, you can use the code from previous part by cloning from my Github repository: git clone https://github.com/yusufsyaifudin/rails-otel.git And then checkout to the commit id c85c199 where is the last state of the code from previous article. ...