{"id":15066795,"url":"https://github.com/yfractal/sdb","last_synced_at":"2025-04-10T13:53:15.984Z","repository":{"id":255855607,"uuid":"850585246","full_name":"yfractal/sdb","owner":"yfractal","description":"A Ruby stack profiler without GLV.","archived":false,"fork":false,"pushed_at":"2025-04-07T00:51:19.000Z","size":237,"stargazers_count":29,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T07:18:06.002Z","etag":null,"topics":["dll-injection","ebpf","observability","profiler","ruby","rust","stack-profiling"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yfractal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.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}},"created_at":"2024-09-01T07:45:44.000Z","updated_at":"2025-04-07T00:51:23.000Z","dependencies_parsed_at":"2024-09-29T11:24:27.584Z","dependency_job_id":"fc98c203-5c37-42aa-a5c9-abec0319b9ef","html_url":"https://github.com/yfractal/sdb","commit_stats":null,"previous_names":["yfractal/sdb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yfractal%2Fsdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yfractal%2Fsdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yfractal%2Fsdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yfractal%2Fsdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yfractal","download_url":"https://codeload.github.com/yfractal/sdb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248229032,"owners_count":21068808,"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":["dll-injection","ebpf","observability","profiler","ruby","rust","stack-profiling"],"created_at":"2024-09-25T01:12:12.829Z","updated_at":"2025-04-10T13:53:15.962Z","avatar_url":"https://github.com/yfractal.png","language":"Rust","readme":"\u003ch1 align=\"center\"\u003eSDB: High-accuracy stack profiler for Ruby\u003c/h1\u003e\n\n# Introduction\nSDB provides high-accuracy stack profiling for Ruby applications. It can profile Ruby at **microsecond (0.000001 second)** intervals and offers event tagging for requests.\n\n# Why Do We Need Another Stack Profiler?\n1. Minimal Impact: SDB does not affect the target application’s performance.\n2. Event Tagging: SDB supports event tagging, making it easier to trace and identify slow functions.\n3. High Accuracy: SDB offers precision down to microseconds.\n\nInstrumentation libraries like `opentelemetry-ruby` generate data during application runtime, and some stack profilers block application threads. These approaches can introduce delays in your application.\n\nSDB, inspired by [LDB](https://www.usenix.org/conference/nsdi24/presentation/cho#:~:text=LDB%20observes%20the%20latency%20of,costs%20away%20from%20program%20threads.), operates by pulling stack traces on a separate thread, which minimizes the impact on our application.\n\nEvent tagging, such as adding trace_id for Puma requests, makes it easier to identify slow functions.\n\nMoreover, SDB can precisely identify delays, down to a single microsecond.\n\n# How it works\n\u003cimg width=\"634\" alt=\"Screenshot 2024-10-31 at 13 58 55\" src=\"https://github.com/user-attachments/assets/66e8e876-a19f-44f0-8b59-955a69cc3cc3\"\u003e\n\nUnlike other Ruby stack profilers, SDB doesn't acquire GVL. It only scans stacks, which are then collected into a buffer and written to the log.\n\nAs the stack scanner only gathers function addresses, the symbolizer is used for gathering human-readable information, such as function names, files, etc. To achieve this, the symbolizer instruments several Ruby VM methods, such as `rb_iseq_new_with_opt` through eBPF.\n\nSDB adds event tags for categorizing the stacks and the analyzer combines all those logs for us.\n\n\n\n# Usage Example\n![roda](https://github.com/yfractal/sdb-analyzer/blob/main/images/roda.png)\n\nThe image above is generated by [sdb-analyzer](https://github.com/yfractal/sdb-analyzer). It represents a simple Ruby API application rendering an empty body.\n\nThe image clearly shows which methods are used and their latency, helping us understand the application's behavior and identify potential latency issues, even without prior background knowledge.\n\n# NOTICE\nSDB is still in **the experimental stage**. Rather than focusing on ease of use and stability, I am exploring additional use cases, such as detecting concurrency issues or delays caused by GVL.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyfractal%2Fsdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyfractal%2Fsdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyfractal%2Fsdb/lists"}