Created
April 21, 2024 10:08
-
-
Save romiras/d4d339facd22f2d5ac7c717836ff719a to your computer and use it in GitHub Desktop.
Debugging Datadog agent in Ruby on Rails app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
get '/health', to: proc { [200, {}, ['ok']] }, as: :app_health_check | |
get '/dd', to: proc { | |
port_is_open = Socket.tcp('localhost', 8126, connect_timeout: 5) { true } rescue false | |
res = "Datadog port is open: #{port_is_open}" | |
[200, {}, [res]] | |
}, as: :dd_health_check | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution
Wait for Datadog agent has started and listening on a port 8126:
wait_for_datadog.sh
:Procfile
: