Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Ruby

แนะนำ AppSignal Ruby Gem 3.0 – Instrumentation และ Compatibility ที่เพิ่มขึ้น

เรายินดีมากที่จะนำเสนอ Version 3.0 ของ AppSignal สำหรับ Ruby - Major Release ใหม่สำหรับ Ruby Gem 🎉

เราเปลี่ยนวิธีที่เรา Instrument Apps และ Gems เพื่อให้ Compatibility ดีกว่ากับ Instrumentation Gems อื่นๆ Support สำหรับ Ruby Version 1.9 ถูกลบออก และ Deprecated Classes, Modules, Methods และ Instrumentations ก็ถูกลบออกเช่นกัน

อ่าน Upgrade Guide ของเรา!

ในส่วนที่เหลือของโพสต์ เราจะอธิบายว่า Version ใหม่ของ Gem ของเรานำอะไรมาให้คุณและแอปของคุณ มาเริ่มกัน!

ลบ Ruby 1.9 Support

Ruby 1.9 End of Life มาตั้งแต่ 23 กุมภาพันธ์ 2015 และแม้ AppSignal Ruby Gem จะพยายาม Support อยู่ดี แต่เวลามาถึงที่จะลากันแล้ว

ใน Release นี้ เราเปลี่ยนวิธีที่เรา Instrument Apps และ Gems วิธี Instrumentation นี้ Introduced ใน Ruby 2.0 ซึ่งหมายความว่า ตั้งแต่ Release นี้ Ruby 2.0 หรือใหม่กว่าจำเป็นสำหรับ Apps ที่ใช้ AppSignal Gem โปรด Upgrade Apps ของคุณเป็น Ruby Version ใหม่กว่า หากเป็นไปได้

Sidekiq Error Reporting

Sidekiq Error Reporting ครบถ้วนขึ้น เรา Include Sidekiq Error Handler ที่ Report Errors ไม่เพียงแค่จาก Jobs ที่รันโดย Sidekiq แต่ยังรวม Errors ที่เกิดขึ้นใน Sidekiq เอง ตัวอย่างเช่น เมื่อ Sidekiq อ่าน Job JSON จาก Redis และมัน Corrupt มันจะ Report Error สำหรับ Error นั้น วิธีนี้คุณจะรู้ว่าทำไม Job นั้นจึงไม่สามารถ Execute ได้

Compatibility กับ Instrumentation Libraries อื่นๆ

ใน 3.x Series AppSignal for Ruby Gem เปลี่ยน Internal Method ที่ใช้ Instrument Apps และ Gems อื่นๆ นี่ควรปรับปรุง Compatibility กับ Gems อื่นๆ ที่ใช้ Instrumentation Method เดียวกัน Previous Instrumentation Method Incompatible กับ Newer Method และจะทำให้ App ติด Loop ทำให้เกิด SystemStackError

Ruby Ecosystem ดูเหมือนจะเคลื่อนไปสู่ New Instrumentation Method นี้ ดังนั้น AppSignal Gem จึง Update Instrumentation Method ให้ Compatible กับ Gems อื่นๆ มากขึ้น

หาก App เริ่มเจอ Issue นี้หลัง Upgrade ให้ Upgrade APM และ Error Reporting Gems อื่นๆ ใน App Versions ใหม่กว่าน่าจะ Updated เพื่อ Instrument ด้วย New Method เช่นกัน หาก Issue ยังคงอยู่ โปรดติดต่อเรา

สำหรับข้อมูล Technical และ Background ของการเปลี่ยนแปลงนี้ ดู Upgrade Guide เรื่อง Compatibility กับ Gems อื่นๆ

ลบ Previously Deprecated Features ที่ Deprecated ไว้ก่อนหน้านี้

ตลอด 2.x Series Releases ของ Ruby Gem เราเปลี่ยนบางอย่างใน Codebase ของ Gem เรามั่นใจเสมอว่า Old Methods ยังทำงานผ่าน Fallbacks เพื่อให้แน่ใจว่าไม่มีอะไร Broken ระหว่าง Upgrades ทุกครั้งที่มีการเปลี่ยนแปลง Ruby Gem จะ Print และ Log Warnings พร้อม Steps ที่ต้องทำเพื่อ Resolve Warning

ใน Major Release นี้ เราลบ Fallbacks เหล่านี้ออกเพื่อปรับปรุง Maintainability ของ Ruby Gem นี่หมายความว่าบางอย่างอาจ Broken ด้วย Release นี้ โปรดดู Upgrade Guide สำหรับวิธี Upgrade ที่ดีที่สุด เพื่อให้ AppSignal Ruby Gem สามารถเตือนคุณล่วงหน้าเกี่ยวกับการเปลี่ยนแปลงที่คุณต้องทำก่อน Upgrade เป็น Version 3.0 ของ Ruby Gem ของเรา

บางสิ่งที่ Apps ที่ใช้ AppSignal for Ruby อาจใช้อยู่ที่ถูกลบ:

  • ลบ JavaScript Integration เราลบ Built-in JavaScript Integration ที่ Route Traffic ผ่าน App เพื่อ Report Errors เราแนะนำให้ใช้ Dedicated AppSignal for Front-end JavaScript Integration ดู Upgrade Guide สำหรับรายละเอียด JavaScript Integration
  • ลบ Command appsignal notify_of_deploy แทนที่เราแนะนำให้ใช้ Config Option revision เพื่อ Report Deploys ให้แม่นยำกว่า ดู Upgrade Guide สำหรับ Command notify_of_deploy ที่ถูกลบ

การเปลี่ยนแปลงใน 2.x Series

Ruby Gem 3.0 Release นี้สร้างบน Releases เล็กๆ มากใน 2.x Series การเปลี่ยนแปลงที่โดดเด่นที่รวมอยู่ใน Release นี้คือ:

  • Support สำหรับ Ruby 3.0 (ภาษาเอง 😉)
  • Breadcrumb Support ติดตาม User Actions ผ่าน App ดู Steps ที่ User ทำเพื่อ Raise Error
  • ActionMailer Magic Dashboard Visualize Mail Deliveries จาก App ของคุณ
  • Sidekiq Error และ Performance Reporting ที่แม่นยำกว่า รวม Middleware อื่นๆ
  • ActiveSupport::Notifications Support ที่ปรับปรุง Shoryuken Batch Support และ Fixes เล็กๆ อื่นๆ

วิธี Upgrade เป็น AppSignal for Ruby Gem 3.0

เพื่อช่วย Upgrade Major Release นี้ เราเขียน Upgrade Guide ที่คุณสามารถปฏิบัติตามใน Docs ของเรา รู้สึกสบายใจที่จะบอกเราหากคุณเจอปัญหา ใน Guide นี้ เราอธิบาย Steps ที่จำเป็นในการ Upgrade Ruby Gem สิ่งที่ต้องระวัง และ List การเปลี่ยนแปลงที่ครอบคลุมที่อาจส่งผลต่อ Apps ของคุณ

ลอง AppSignal - APM พร้อม Stroopwafels 🍪

หากคุณยังไม่ได้ลอง AppSignal สำหรับ Monitor Ruby/Rails Apps ของคุณ ใช้เวลา 5 นาทีเช็คเอาท์ มี Trial 30 วัน ไม่ต้อง Credit Card

เนื่องจากเราเป็นบริษัท Dutch เรายังส่ง Stroopwafels (คุกกี้ดัตช์อร่อยบ้าสุด) ไปทั่วโลกให้ Users ทุกอย่างที่คุณต้องทำเพื่อรับกล่องคือ Contact Support ของเรา 📧➡️😋