{"id":16105080,"url":"https://github.com/intgr/dogslow-sentry","last_synced_at":"2025-08-21T09:06:12.944Z","repository":{"id":45186416,"uuid":"387550382","full_name":"intgr/dogslow-sentry","owner":"intgr","description":"A Django middleware that logs tracebacks of slow requests to Sentry","archived":false,"fork":false,"pushed_at":"2025-08-12T18:49:35.000Z","size":155,"stargazers_count":11,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-12T20:33:43.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intgr.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-07-19T17:53:05.000Z","updated_at":"2025-08-12T18:49:38.000Z","dependencies_parsed_at":"2024-04-07T11:32:40.721Z","dependency_job_id":"f7f03983-2ef6-4d16-ab1a-d952a8f0d83f","html_url":"https://github.com/intgr/dogslow-sentry","commit_stats":{"total_commits":148,"total_committers":19,"mean_commits":"7.7894736842105265","dds":0.5540540540540541,"last_synced_commit":"24682249b19a445ca4caba5d802e94adfa8a3da5"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/intgr/dogslow-sentry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intgr%2Fdogslow-sentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intgr%2Fdogslow-sentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intgr%2Fdogslow-sentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intgr%2Fdogslow-sentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intgr","download_url":"https://codeload.github.com/intgr/dogslow-sentry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intgr%2Fdogslow-sentry/sbom","scorecard":{"id":491700,"data":{"date":"2025-08-11","repo":{"name":"github.com/intgr/dogslow-sentry","commit":"5e0b8e66909543d7d16d7b76ddc803436433e6e5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/intgr/dogslow-sentry/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/intgr/dogslow-sentry/tests.yml/main?enable=pin","Warn: pipCommand not pinned by hash: scripts/release.sh:13","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:31","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: COPYING.txt:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-29pr-6jr8-q5jm","Warn: Project is vulnerable to: GHSA-g92j-qhmh-64v2"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T19:20:10.648Z","repository_id":45186416,"created_at":"2025-08-19T19:20:10.649Z","updated_at":"2025-08-19T19:20:10.649Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271454989,"owners_count":24762699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T19:08:22.062Z","updated_at":"2025-08-21T09:06:12.927Z","avatar_url":"https://github.com/intgr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==============================================\nDogslow-Sentry -- Django Slow Request Watchdog\n==============================================\n\n|PyPI version badge| |Tests status|\n\n.. |PyPI version badge| image:: https://badge.fury.io/py/dogslow-sentry.svg\n   :target: https://pypi.org/project/dogslow-sentry/\n\n.. |Tests status| image:: https://github.com/intgr/dogslow-sentry/actions/workflows/tests.yml/badge.svg?branch=main\n   :target: https://github.com/intgr/dogslow-sentry/actions?query=workflow:Tests\n\nOverview\n--------\n\nDogslow is a Django watchdog middleware that logs tracebacks of slow\nrequests. Dogslow-sentry requires Python 3.8+, Django 2.2+.\n\nIt started as an `internal project inside Bitbucket`_ to help trace\noperational problems.\n\nIn 2021, the dogslow-sentry fork was created to add Sentry-specific information\nto reports, like full stack trace, request information, fingerprint for issue\ngrouping, breadcrumbs, etc.\n\n.. _internal project inside Bitbucket: http://blog.bitbucket.org/2011/05/17/tracking-slow-requests-with-dogslow/\n\n\nInstallation\n------------\n\nInstall dogslow-sentry::\n\n    $ pip install dogslow-sentry\n\nThen add ``dogslow_sentry.WatchdogMiddleware`` to your Django settings file::\n\n    MIDDLEWARE = [\n        'dogslow_sentry.WatchdogMiddleware',\n        ...\n    ]\n\nFor best results, make it one of the first middlewares that is run.\n\n\nConfiguration\n-------------\n\nNaturally, dogslow-sentry expects a `working Sentry configuration for Django`_.\n\n.. _working Sentry configuration for Django: https://docs.sentry.io/platforms/python/guides/django/\n\nYou can use the following configuration in your ``settings.py``\nfile to tune the watchdog::\n\n    # Watchdog is enabled by default, to temporarily disable, set to False:\n    DOGSLOW = True\n\n    # Log requests taking longer than 25 seconds:\n    DOGSLOW_TIMER = 25\n\n    # Enable logging to Sentry\n    DOGSLOW_SENTRY = True\n\n    # Also log slow request tracebacks to Python logger\n    DOGSLOW_LOGGER = 'dogslow_sentry'\n    DOGSLOW_LOG_LEVEL = 'WARNING'\n\n    # Tuple of url pattern names that should not be monitored:\n    # (defaults to none -- everything monitored)\n    DOGSLOW_IGNORE_URLS = ('some_view', 'other_view')\n\n\nUsage\n-----\n\nEvery incoming HTTP request gets a 25 second timeout in the watchdog. If a\nrequest does not return within that time, the watchdog activates and takes a\npeek at the request thread's stack and writes the backtrace (including all\nlocal stack variables -- Django style) to a log file.\n\nNote that ``dogslow`` only takes a peek at the thread's stack. It does not\ninterrupt the request, or influence it in any other way. Using ``dogslow`` is\ntherefore safe to use in production.\n\n\nChangelog\n---------\n\nUnreleased (2025-01-21)\n\n* Dropped Python 3.7 support, now requires Python 3.8+.\n* Enabled CI testing with Python 3.13 and Django 5.1.\n\n2.0.1 (2023-12-08)\n\n* Use ISO 8601-like YYYY-MM-DD date format for email/file logging.\n* Fixed deprecation warnings on Python 3.12 (utcnow function).\n* Enabled CI testing with Python 3.11, 3.12 and Django 5.0, 4.2, 4.1.\n\n2.0.0 (2021-12-13)\n\n* Configured GitHub Actions for CI.\n* Enabled testing with Python 3.10 and Django 4.0.\n* Fixed deprecation warning when using Python 3.10.\n\n2.0.0b1 (2021-07-19)\n\n* Initial pre-release of ``dogslow-sentry`` fork.\n* Improved Sentry integration.\n* Dropped Python 2.7 support, now requires Python 3.7+, Django 2.2+.\n* Many minor tweaks. Reformatted code with Black.\n\n1.2 (2018-01-04)\n\n* Last release of upstream ``dogslow`` package.\n\n\nCaveats\n-------\n\nDogslow uses multithreading. It has a single background thread that handles the\nwatchdog timeouts and takes the tracebacks, so that the original request\nthreads are not interrupted. This has some consequences.\n\n\nMultithreading and the GIL\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn CPython, the GIL (Global Interpreter Lock) prevents multiple threads from\nexecuting Python code simultaneously. Only when a thread explicitly releases\nits lock on the GIL, can a second thread run.\n\nReleasing the GIL is done automatically whenever a Python program makes\nblocking calls outside of the interpreter, for example when doing IO.\n\nFor ``dogslow`` this means that it can only reliably intercept requests that\nare slow because they are doing IO, calling sleep or busy waiting to acquire\nlocks themselves.\n\nIn most cases this is fine. An important cause of slow Django requests is an\nexpensive database query. Since this is IO, ``dogslow`` can intercept those\nfine. A scenario where CPython's GIL is problematic is when the request's\nthread hits an infinite loop in Python code (or legitimate Python that is\nextremely expensive and takes a long time to execute), never releasing the\nGIL. Even though ``dogslow``'s watchdog timer thread does become runnable, it\ncannot log the stack.\n\n\nCo-routines and Greenlets\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n``Dogslow`` is intended for use in a synchronous worker configuration. A\nwebserver that uses dedicated threads (or single-threaded, dedicated worker\nprocesses) to serve requests. Django's built-in wsgi server does this, as\ndoes ``Gunicorn`` in its default sync-worker mode.\n\nWhen running with a \"co-routines framework\" where multiple requests are served\nconcurrently by one thread, backtraces might become nonsensical.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintgr%2Fdogslow-sentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintgr%2Fdogslow-sentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintgr%2Fdogslow-sentry/lists"}