Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding socket connection issues #188

Open
cschneid opened this issue Sep 9, 2020 · 0 comments
Open

Understanding socket connection issues #188

cschneid opened this issue Sep 9, 2020 · 0 comments

Comments

@cschneid
Copy link
Contributor

cschneid commented Sep 9, 2020

What

We'd like to track core agent startup and socket connection issues so we can identify issues and fix them proactively.

Why

The socket connection might fail for multiple reasons, which might include

  • Unable to create the core_agent_dir
  • Unable to download (e.g outbound firewall prevents it)
  • Permission denied to an already existing core_agent_socket path
  • noexec is set on the volume where core_agent_dir resides
  • Random things like core_agent_dir resides on a bind mount inside a docker container on an OSX host and creating a socket results in a name too long error. Can't run swarm tests in Docker for Mac moby/moby#23545 (comment)

No matter the issue, the end result is that the agent will attempt to connect to the socket, fail, and ultimately stop trying after a few attempts.

How

  1. When the core agent fails to download, or socket fails to connect
  2. Report the following data in a POST to https://checkin.scoutapp.com/apps/diagnostics.scout
  3. With URL parameters: ?key=#{org_key}&name=#{app_name}
  4. With Headers:
Agent-Hostname: #{socket.gethostbyname()}
Agent-Version: #{agent version}
Content-Type: application/octet-stream
  1. With body data:
{
  version: 1,
  type: socket,
  language: php,
  agent_version: ${agent_version},
  environment: #{app_environment},
  node: #{hostname},
  agent_config: #{json object/hash of key/value of the agent's config options},
  error: {json object or string with anything you can provide w/ more details}
}

To prevent flooding ourselves with reports on every request, send this once per hour at most, and this should only run when a cache is available.

See-Also - Python Agent's matching ticket: scoutapp/scout_apm_python#554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant