Class: LaunchDarklyObservability::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/launchdarkly_observability/rails.rb

Overview

Rails Railtie for automatic integration

This Railtie automatically:

  • Inserts the LaunchDarkly middleware into the Rails middleware stack

  • Bridges Rails.logger to the OpenTelemetry Logs pipeline (if logger provider is available)

  • Provides helper methods for controllers and views

Examples:

The Railtie is automatically loaded when Rails is detected

# In config/initializers/launchdarkly.rb
LaunchDarklyObservability.init(project_id: ENV['LD_PROJECT_ID'])