Skip to content

Instantly share code, notes, and snippets.

@stympy
Created January 14, 2025 14:32
Show Gist options
  • Save stympy/2f2631cac90384a9b0bcfbd621c348f0 to your computer and use it in GitHub Desktop.
Save stympy/2f2631cac90384a9b0bcfbd621c348f0 to your computer and use it in GitHub Desktop.
Reporting events to Honeybadger Insignts from Crystal
require "http/server"
require "honeybadger"
Honeybadger.configure do |config|
config.api_key = "replaceme"
config.environment = "production"
end
server = HTTP::Server.new do |context|
context.response.content_type = "text/plain"
context.response.print "Hello world! The time is #{Time.local}"
Honeybadger.event(
name: "greeting.sent",
user_id: 123
)
end
address = server.bind_tcp 8080
puts "Listening on http://#{address}"
server.listen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment