残しておかないと後で忘れそうな奴を書いておく。随時追記予定。
putsに色をつける
seedとかrake taskとかで色つけて出したいときに使える小技
puts 'aaa'.green
Datadogにエンドポイントでの挙動を細かく出したい (grape使用時)
このリファレンスを参照
https://docs.datadoghq.com/ja/tracing/setup/ruby/#grape
下記の実装例のように、リファレンスのoptionsにある analytics_enabled
をtrueにするといい感じになる。
grapeとrails両方指定するのがポイント。
実装例
require 'grape'
require 'ddtrace'
Datadog.configure do |c|
c.use :grape, service_name: 'hoge-app', analytics_enabled: true
end
Datadog.configure do |c|
c.use :rails, service_name: 'hoge-app', analytics_enabled: true
end