{"id":19725608,"url":"https://github.com/xdev-software/thread-origin-agent","last_synced_at":"2025-04-30T00:31:26.820Z","repository":{"id":233292074,"uuid":"785565528","full_name":"xdev-software/thread-origin-agent","owner":"xdev-software","description":"Find out who creates your Java threads ","archived":false,"fork":false,"pushed_at":"2024-11-08T02:32:50.000Z","size":662,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2024-11-08T03:29:24.908Z","etag":null,"topics":["debug","debugging","java","javaagent","thread","thread-origin","trace","tracing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xdev-software.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-12T06:27:23.000Z","updated_at":"2024-09-30T03:25:04.000Z","dependencies_parsed_at":"2024-04-29T03:29:12.205Z","dependency_job_id":"f0a4daab-fbc5-43ff-8162-4ce81a50f985","html_url":"https://github.com/xdev-software/thread-origin-agent","commit_stats":null,"previous_names":["xdev-software/thread-origin-agent"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdev-software%2Fthread-origin-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdev-software%2Fthread-origin-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdev-software%2Fthread-origin-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdev-software%2Fthread-origin-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xdev-software","download_url":"https://codeload.github.com/xdev-software/thread-origin-agent/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224191417,"owners_count":17271045,"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","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":["debug","debugging","java","javaagent","thread","thread-origin","trace","tracing"],"created_at":"2024-11-11T23:31:30.004Z","updated_at":"2024-11-11T23:33:03.232Z","avatar_url":"https://github.com/xdev-software.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/thread-origin-agent/check-build.yml?branch=develop)](https://github.com/xdev-software/thread-origin-agent/actions/workflows/check-build.yml?query=branch%3Adevelop)\n\n# Thread Origin Agent\n\nIn many situations is it helpful to find out who created a [Thread](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Thread.html).\n\nTo find the origin of a thread, this project provides a [javaagent](https://docs.oracle.com/en/java/javase/21/docs/api/java.instrument/java/lang/instrument/package-summary.html) which logs the stacktrace at Thread creation.\n\n## Installation\n[Installation guide for the latest release](https://github.com/xdev-software/thread-origin-agent/releases/latest#Installation)\n\n## Usage\nInsert ``-javaagent:\u003cpathToThread-origin-agent.jar\u003e=\u003cpackagesToIgnore\u003e`` into the JVM-arguments (at the beginning!)\u003cbr/\u003e\nExamples:\n```bash\njava -javaagent:thread-origin-agent-1.0.0.jar -jar \u003cappToInspect\u003e.jar\njava -javaagent:\"C:\\temp\\thread-origin-agent-1.0.0.jar\"=sun/awt,sun/java2d -jar \u003cappToInspect\u003e.jar\n```\n\n\u003e [!NOTE]\n\u003e Please note that it's not possible to monitor all ``Thread`` starts as the ``Thread`` class is loaded and used extremely early.\u003cbr/\u003e\n\u003e Some static instantiations that use Threads e.g. ``ForkJoinPool#common`` are therefore not affected by changing the underlying bytecode.\n\n\u003cdetails\u003e\u003csummary\u003eExample output for a Spring Boot application\u003c/summary\u003e\n\n```\n[TOA] Arg: null\n[TOA] Ignoring excluded:\n[TOA] Trying to retransform loaded classes\n[TOA] Ignoring javassist.CtField\n...\n[TOA] Retransformed loaded classes; 820x successful, 150x unmodifiable\n[TOA] Detected java.lang.Thread.start() id: 46 name: background-preinit\n[TOA]   org.springframework.boot.autoconfigure.BackgroundPreinitializer.performPreinitialization(BackgroundPreinitializer.java:129)\n[TOA]   org.springframework.boot.autoconfigure.BackgroundPreinitializer.onApplicationEvent(BackgroundPreinitializer.java:85)\n[TOA]   org.springframework.boot.autoconfigure.BackgroundPreinitializer.onApplicationEvent(BackgroundPreinitializer.java:55)\n...\n[TOA] Detected java.lang.Thread.start() id: 47 name: Thread-0\n[TOA]   org.springframework.boot.autoconfigure.condition.OnClassCondition$ThreadedOutcomesResolver.\u003cinit\u003e(OnClassCondition.java:147)\n...\n```\n\n\u003c/details\u003e\n\n### Additional configuration options\n\nThese options can be configured as system properties. Example:\u003cbr/\u003e\n``-DTOA_LOG_CALLER_THREADS``\n\n| Option | Description |\n| --- | --- |\n| ``TOA_LOG_THREAD_JOINS`` | Also logs ``Thread#join`` calls |\n| ``TOA_LOG_CALLER_THREADS`` | Displays additional information about the thread that started the new thread |\n| ``TOA_DISPLAY_METHOD_INSTRUMENTATION_FAILURES`` | Displays method instrumentation failures.\u003cbr/\u003eThis happens when a method is not present or can't be instrumented due to other reasons (e.g. JDK internal method).\u003cbr/\u003eProduces a lot of log output so it's recommended to only enable it for debugging |\n\n## Support\nIf you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).\n\n## Contributing\nSee the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.\n\n## Dependencies and Licenses\nView the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/thread-origin-agent/dependencies)\n\n\u003csub\u003eThis project was inspired by [kreyssel/maven-examples](https://github.com/kreyssel/maven-examples)\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdev-software%2Fthread-origin-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxdev-software%2Fthread-origin-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdev-software%2Fthread-origin-agent/lists"}