Files
Jeremy Daer b88182c3ad Autotuner: use structured logging instead of Sentry (#2011)
Move thousands of info-level Sentry events to logs. Query Loki rather
than downsampling events: `event.action = "run.ruby-script",
script.name = "autotuner"`
2025-12-08 10:01:28 -08:00

17 lines
600 B
Ruby

# Enable autotuner. Alternatively, call Autotuner.sample_ratio= with a value
# between 0 and 1.0 to sample on a portion of instances.
Autotuner.enabled = true
# This callback is called whenever a suggestion is provided by this gem.
# Log to structured logging for query/analysis in Loki. This is called
# once per autotuner heuristic.
Autotuner.reporter = proc do |heuristic_report|
report = heuristic_report.to_s
Rails.logger.info "GCAUTOTUNE: #{report}"
RailsStructuredLogging.instrument_script "autotuner" do
Rails.logger.info report.to_s
end if defined? RailsStructuredLogging
end