How akshatdalton/sherlock works
Project type and purpose
• This is an open-source Python instrumentation library whose goal is to observe incoming and outgoing requests and ensure every HTTP request carries a correlation ID header.
• The README calls it “Your Sherlock to observe and add the missing correlation ID in the request headers,” confirming it’s a middleware/utility rather than a standalone service.
File structure
• Top-level config: .gitignore, pre-commit, pyproject.toml, README.md
• Main package “sherlock/”
• constants.py – shared names, defaults
• sleuth.py & instrumentation.py – core engine that generates/injects IDs
• logging_filters.py – hooks into Python logging to append correlation IDs to logs
• utils.py – helper functions (e.g., ID generator)
• integrations/ – adapters for specific frameworks and libraries (AWS Lambda, FastAPI, HTTPX, urllib3)
• plugins/ – extension points (base_plugin.py) and built-in Sentry plugin
• tests/ – unit tests for each integration and core component
README for additional insights
• Encourages you to infer architecture from file structure and naming.