Commit 3b64cc2
feat(yabeda): Add sentry-yabeda adapter gem (#2925)
* feat(yabeda): Add sentry-yabeda adapter gem
Introduces sentry-yabeda, a Yabeda adapter that forwards metrics to
Sentry. Covers all four Yabeda metric types (counter, gauge, histogram,
summary), a periodic collector to drive gauge collection in push-based
environments, and a full spec suite including unit and integration tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(yabeda): Replace endless method syntax for Ruby 2.7 compatibility
Endless method syntax (def m() = val) requires Ruby 3.0+. Replace with
conventional empty method bodies (def m; end) so RuboCop using the Ruby
2.7 parser does not reject the file.
Co-Authored-By: Claude Sonnet 4.6 <noreply@example.com>
* fix(yabeda): Use ActionController::API in yabeda-mini app
The app is configured as api_only but inherited from ActionController::Base,
which includes CSRF protection middleware. Switch to ActionController::API
to align with the api_only setting and eliminate the CSRF warning.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Potential fix for code scanning alert no. 22: CSRF protection not enabled
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* chore(yabeda): Remove unused yabeda-mini manual test app
The app was never referenced by any spec or CI step and carried
maintenance weight (Gemfile.lock, SQLite DB, log files). The
sentry-yabeda adapter is already covered by unit and integration
specs in sentry-yabeda/spec/.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* ci(yabeda): Add GitHub Actions workflow for sentry-yabeda
Add sentry_yabeda_test.yml following the same pattern as other gem
workflows (resque, delayed_job, opentelemetry). Wire it into tests.yml
so it runs on every PR and push to master, and is included in the
CodeCov notification gate.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs(yabeda): Add sentry-yabeda to root README and trim per-gem README
Replace the detailed standalone sentry-yabeda README with a minimal
one matching the per-gem style used across the repo. Add sentry-yabeda
to the badge table, install snippet, and integrations list in the root
README.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs(yabeda): Add sentry-yabeda to sentry-ruby/README.md
Same badge table row, install snippet, and integrations list entry
as the root README — keeps the gem-level README in sync.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* ref(yabeda): Auto-start collector via Sentry::Configuration callback
Remove the manual start_collector!/stop_collector! API. The periodic
gauge collector now starts automatically when Sentry is initialized
with enable_metrics: true, via an after(:configured) hook — consistent
with how other Sentry integrations wire into the SDK lifecycle.
Collector follows the same initialization pattern as SessionFlusher and
BackpressureMonitor, taking a configuration positional argument and
calling super(configuration.sdk_logger, interval).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(yabeda): Fire :closed callbacks on Sentry.close for final flush
Add a :closed callback event to Sentry::Configuration, fired by
Sentry.close before client.flush. sentry-yabeda registers an
after(:closed) hook that performs one final Yabeda.collect! and
then kills the collector, ensuring any gauge values set by
collection blocks are captured in the last envelope.
The existing after(:configured) guard (collector&.kill) is kept to
handle re-initialisation without an explicit close call.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs(yabeda): Add How it works section to README
Explain the two metric modes: inline metrics (counters, histograms,
summaries, direct gauge sets) forward to Sentry immediately, while
collector blocks need a periodic trigger since Yabeda was designed
for Prometheus's pull model. Documents the 15s background thread
and the lack of trace context on collector-driven metrics.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@example.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>1 parent 89514c0 commit 3b64cc2
21 files changed
Lines changed: 886 additions & 2 deletions
File tree
- .github/workflows
- sentry-ruby
- lib
- sentry
- spec/sentry
- sentry-yabeda
- lib
- sentry/yabeda
- spec
- sentry/yabeda
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
| |||
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
| 83 | + | |
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
| 27 | + | |
23 | 28 | | |
24 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
| 465 | + | |
465 | 466 | | |
466 | 467 | | |
467 | 468 | | |
| |||
798 | 799 | | |
799 | 800 | | |
800 | 801 | | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
801 | 807 | | |
802 | 808 | | |
803 | 809 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
572 | 586 | | |
573 | 587 | | |
574 | 588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments