Skip to content

Datadog not using hostname but 127.0.0.1 #1065

Closed

Description

ERROR -- ddtrace: [ddtrace] (/usr/local/bundle/gems/ddtrace-0.36.0/lib/ddtrace/transport/http/client.rb:35:in rescue in send_request') Internal error during HTTP transport request. Cause: Failed to open TCP connection to 127.0.0.1:8126 (Connection refused - connect(2) for "127.0.0.1" port 8126) Location: /usr/local/lib/ruby/2.5.0/net/http.rb:939:in rescue in block in connect'

def configure_tracer(config)
  config.tracer          = ::Datadog::Tracer.new
  config.tracer.enabled  = true
  config.tracer.hostname = tracer_params[:hostname]
  config.tracer.port     = tracer_params[:port]
  config.tracer.env      = tracer_params[:env] if config.tracer.respond_to?(:env=)
  config.tracer.transport_options = proc do |t|
    # Hostname, port, and additional options. :timeout is in seconds.
    t.adapter :net_http, tracer_params[:hostname], tracer_params[:port], { timeout: tracer_params[:timeout] }
  end
end

If I do a puts on tracer_params[:hostname] it is set to datadog-agent.datadog but somehow something is still trying to push to 127.0.0.1.

Another weird thing is that unless I set the tracer = the tracer is nil. I am currently on version 0.36.0 of the gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugInvolves a bugcommunityWas opened by a community membercoreInvolves Datadog core libraries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions