Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Peeking into Rails apps using OpenTelemetry

Peeking into Rails apps using OpenTelemetry

While Rails makes getting the application out quickly without losing the developer productivity, it needs Observability once it hits production. Because we don’t want the business to suffer in case the application performance suffers. Learn how OpenTelemetry offers the best open standards to observe a Rails app by allowing you to ask complex, improvement-focused questions before your customers ask you about them.

Prathamesh Sonpatki

January 25, 2023
Tweet

More Decks by Prathamesh Sonpatki

Other Decks in Programming

Transcript

  1. 3 Instrumentation? 🤔 🤨 - How do you know your

    application is running as expected?
  2. 4 Instrumentation? 🤔 🤨 - How do you know your

    application is running as expected? - Service Level Agreements(SLA)
  3. 5 Instrumentation? 🤔 🤨 - How do you know your

    application is running as expected? - Service Level Agreements(SLA) - Good night’s sleep 😴 💤
  4. 🌈 Landscape of the Instrumentation 10 - Your application is

    not standalone - It’s actually a 🍔
  5. 🌈 Landscape of the Instrumentation 11 - Your application is

    not standalone - It’s actually a 🍔 - The Bun(Cloud/VM) - Patty(application) - Along with Mayo sauce(RDS/DB) - And Ketchup(Third party services)
  6. 🌈 The Landscape of Instrumentation 12 - Your application is

    not standalone - It’s actually a 🍔 - The Bun(Cloud/VM) - Patty(application) - Along with Mayo sauce(RDS/DB) - And Ketchup(Third party services) “Full stack observability” FTW!
  7. 💡Modern applications are like living organisms that grow and shrink

    in all possible directions. And also communicate with their peers! 13
  8. Agenda 📄 14 - Need of instrumentation/observability - Basic Terminology

    - What is OpenTelemetry - Otel Architecture - Otel + Rails - Way forward
  9. Observability 🪩 16 The measurement and attribution of performance in

    a complex software environment is called Observability. @realmeson10
  10. Telemetry 📊 17 Collection of measurements or data at remote

    points and their automatic transmission to receiving equipment (telecommunication) for monitoring.
  11. Logs ⛈ 18 - Why is something wrong?? - Structured

    vs unstructured - Easier to adopt but consistency is hard Started GET "/posts" for 192.168.0.102 at 2023-01-25 11:53:32 +0530 Processing by PostsController#index as HTML Post Load (0.3ms) SELECT "posts".* FROM "posts" Rendered posts/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.3ms)
  12. Metrics 📊 19 - What is wrong? - Overview via

    aggregates - Consistency and adoption - Visualization using external tools https://guides.rubyonrails.org/active_support_instrumentation.html
  13. Traces 󰙪 20 - Entire journey of a workflow. -

    Data that tracks an application request as it flows through the various parts of an application. - Provides context for what exactly happened “Tracing is just structured logging at DEBUG level. Would you run production logs on debug level? NO! ” - @nishantmodak
  14. Span 🔧 21 - Basic building block of a trace

    - Span is equivalent to an event happening. - A tree of spans make a trace Image credit https://docs.splunk.com/Observability/apm/apm-spans-traces/traces-spans.html
  15. Observability back-ends 📇 22 - A tool/service that gets the

    telemetry data and presents way of visualization, aggregation, alerting, notifications.
  16. Standardization Challenges 📜 23 - Different vendors - Different formats

    - Agents - Nomenclature https://last9.io/blog/observability-is-dead-long-live-observability/
  17. OTLP 🧬 - Describes the encoding, transport, and delivery mechanism

    of telemetry data between telemetry sources, intermediate nodes such as collectors and backends. - gRPC and HTTP implementations https://opentelemetry.io/docs/reference/specification/protocol/ 32
  18. Automatic and Manual instrumentations ⚒ - Automatic instrumentation by just

    including relevant gems. - Out of the box telemetry data. - Common bases are covered. - Don’t have application specific data. - Getting started with auto-instrumentation is easiest. 33
  19. Automatic and Manual instrumentations ⚒ - Automatic instrumentation by just

    including relevant gems. - Out of the box telemetry data. - Common bases are covered. - Don’t have application specific data. - Getting started with auto-instrumentation is easiest. 34 - Deeper insights into application. - Custom metadata. - More control. - Needs application code change.
  20. Way forward 🛣 36 - Ruby Otel SDK Complete support

    for traces - WIP for logs and metrics - https://github.com/open-telemetry/opentelemetry-ruby - https://opentelemetry.io/docs/instrumentation/ruby/
  21. Who are already onboard on the Otel Train 🚝 37

    - GitHub - Shopify - Heroku - Puppet - Dropbox - You??
  22. Recap 💹 38 - Need for standardized instrumentation - What

    is the essence of OpenTelemetry? - Otel Architecture - Rails app using Otel - Automatic and Manual instrumentation - Way forward
  23. Thanks 🤝 39 Prathamesh Sonpatki Last9.io 󰜼 prathamesh.tech 🐧 twitter.com/_cha1tanya

    🐘hachyderm.io/@Prathamesh “Last9 of Reliability” Discord