Understanding socket connection issues
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend, observability-sre
Research direction
Start at src/scout_apm/core/socket.py around line 190, where socket connection attempts are exhausted, and trace the available agent configuration and startup timing data. Implement the diagnostic POST to diagnostics.scoutapp.com with the specified headers, URL parameters, and body fields; done means exhausted connection attempts are reported with the requested socket and agent context.
Written by the indexing model from the issue text.
Description
What
We'd like to track socket connection issues with the core agent 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_socketpath noexecis set on the volume wherecore_agent_dirresides- Random things like
core_agent_dirresides on a bind mount inside a docker container on an OSX host and creating a socket results in aname too longerror. https://github.com/moby/moby/issues/23545#issuecomment-226144475
No matter the issue, the end result is that the python agent will attempt to connect to the socket, fail, and ultimately stop trying after a few attempts. We'll start by tracking when the connection attempts are exhausted.
How
- At https://github.com/scoutapp/scout_apm_python/blob/master/src/scout_apm/core/socket.py#L190
- Report the following data in a
POSTtohttps://checkin.scoutapp.com/apps/diagnostics.scout - With URL parameters:
?key=#{org_key}&name=#{app_name} - With Headers:
Agent-Hostname: #{socket.gethostbyname()}
Agent-Version: #{agent version}
Content-Type: application/octet-stream
- With body data:
{
version: 1,
type: socket,
language: python,
agent_version: ${agent_version},
environment: #{app_environment},
node: #{socket.gethostbyname()},
time_since_startup: #{figure out how to determine this},
agent_config: #{json object/hash of key/value of the agent's config options}
}
- Dominant language
- Python
- Stars
- 77
- Forks
- 19
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from scoutapp/scout_apm_python
-
botwork
Difficulty 4/5 3-5 days Newbie friendliness 42/100
scoutapp/scout_apm_python#841 ·
-
botwork
Difficulty 4/5 3-5 days Newbie friendliness 45/100
scoutapp/scout_apm_python#837 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
scoutapp/scout_apm_python#815 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
scoutapp/scout_apm_python#791 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
scoutapp/scout_apm_python#789 ·
All issues in scoutapp/scout_apm_python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100