My OpenTelemetry talk at Ruby on Rails Oceania in Melbourne slides
Sauce: OpenTelemetry Sandbox Repo with code examples
UPD: There is a way to include sidekiq supspan into a calling parent Span. To override default instrumentation options, in
OpenTelemetry::SDK.configure do |c|
block you need to specify propagation style in the following format:c.use 'OpenTelemetry::Instrumentation::Sidekiq', { propagation_style: :child }
Action Plan
- Part I
- Observabitiy
- “Open Telemetry” OS project
- It’s components
- Part II - Demo:
- Basic implementation with vanilla Ruby
- Ruby with multiple gems
About me
class Friendlyantz
def initialize
@name = 'Anton Panteleev'
@dob = '1987-04-01T04:15:00'
@title = 'Engineer, Software Stuntman and aspiring Dev Advocate, Saul Goodman of Tech'
@hobbies = [ 'Kitesurfing',
'Camping',
'Art Photography',
'Motorcycling',
'Longboarding' ]
end
def current_location
'Melbourne, Australia'
end
https://friendlyantz.me/
A bit of theory and why I decided to do this talk
Distributed Tracing
- Tender Driven Development
- Signals are not very useful when they are isolated
- Context Propagation
Spans
OpenTelemetry
OpenTelemetry is:
- a collection of tools, APIs, and SDKs.
- Use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help you analyze your software’s performance and behavior
- It started as a merger of OpenCensus and openTracing
- open-source, vendor agnostic
- It is part on CNCF since 2019 and 2nd most active project after Kubernetes.
- many popular languages are supported
- a lot of high-calibre contributors (GitHub, Shopify, Google, etc)
OT Components
A bit confusing and constantly evolving, but some of the basic concepts are:
- Specification
- Implementations
- Language-specific Instrumentation, API & SDK implementations
- Collector - like an agent / service that marries different telemetry streams
Specification
- Cross-language requirements and expectations
- API, SDK and Data Requirements
- Semantic Convention
- Resources
Instrumentation, Language-specific API & SDK implementations
- can be Manual and/or Automatic
- Ruby Instrumentation Repo
Demo
Basic Single Span:
bundle
ruby basic_single_span/basic_operation.rb
Complex Multi Span
Spin up ‘Jaeger’
docker run -d --name jaeger \
-e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
-p 5775:5775/udp \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 14268:14268 \
-p 14250:14250 \
-p 9411:9411 \
jaegertracing/all-in-one
Spin up Sidekiq in a tab
# DO NOT forget ./ in front of the required filepath)
sidekiq -r ./multi_span/job.rb
# if this doesn't work you might need to spin up redis-server if it is not running already
redis-server
Run demo script in another tab
ruby multi_span/complex_operations.rb
and observe Sidekiq tab
go to Jaeger UI to observe observabity observing our app
http://localhost:16686
Summary
Summary
- OT can be Automatic and Manual
- Future Adoption
- Still in active development
- Traces are implemented, Metrics & Logs yet to come
- challenge Anton to match a talk
Resources:
- https://opentelemetry.io/
- https://www.jaegertracing.io/ - backend for above (optional, you can use your own existing compatible provider, i.e DataDog, Splunk, etc)
- https://youtu.be/Txe4ji4EDUA - fantastic tutorial by NGNIX, which this talk is based on
- https://github.com/open-telemetry/opentelemetry-demo - official demo of a shopping app using various languages (mail service is in Ruby)
- https://github.com/friendlyantz/open-telemetry-sandbox - my sandbox
Leave a comment