* Add basic Honeycomb initializers * Add some basic instrumentation, capture basic IDs * Correctly alphabetize Gemfile, embed env in dataset names * Actually reorder Gemfile because I can read * Add custom tracing instrumentation to RssReader * Improve timing/tracing info in RssReader * Even make sure Errors show up in trace if possible * Make sure we capture this as Rails traffic * Swap in dev/test Libhoney::Clients as appropriate * Move context-snagging bits into lib/instrumentation.rb * Merging Gemfile lines seems to be my Achilles heel
21 lines
490 B
Ruby
21 lines
490 B
Ruby
require 'libhoney'
|
|
|
|
key = ApplicationConfig["HONEYCOMB_API_KEY"]
|
|
dataset = "dev.to-#{Rails.env}"
|
|
|
|
if Rails.env.development? || Rails.env.test?
|
|
$libhoney = Libhoney::NullClient.new
|
|
else
|
|
$libhoney = Libhoney::Client.new(
|
|
writekey: key,
|
|
dataset: dataset,
|
|
user_agent_addition: HoneycombRails::USER_AGENT_SUFFIX,
|
|
)
|
|
end
|
|
|
|
HoneycombRails.configure do |conf|
|
|
conf.writekey = key
|
|
conf.dataset = dataset
|
|
conf.db_dataset = "dev.to-db-#{Rails.env}"
|
|
conf.client = $libhoney
|
|
end
|