e11y 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +4 -0
  3. data/.rubocop.yml +69 -0
  4. data/CHANGELOG.md +26 -0
  5. data/CODE_OF_CONDUCT.md +64 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +179 -0
  8. data/Rakefile +37 -0
  9. data/benchmarks/run_all.rb +33 -0
  10. data/config/README.md +83 -0
  11. data/config/loki-local-config.yaml +35 -0
  12. data/config/prometheus.yml +15 -0
  13. data/docker-compose.yml +78 -0
  14. data/docs/00-ICP-AND-TIMELINE.md +483 -0
  15. data/docs/01-SCALE-REQUIREMENTS.md +858 -0
  16. data/docs/ADR-001-architecture.md +2617 -0
  17. data/docs/ADR-002-metrics-yabeda.md +1395 -0
  18. data/docs/ADR-003-slo-observability.md +3337 -0
  19. data/docs/ADR-004-adapter-architecture.md +2385 -0
  20. data/docs/ADR-005-tracing-context.md +1372 -0
  21. data/docs/ADR-006-security-compliance.md +4143 -0
  22. data/docs/ADR-007-opentelemetry-integration.md +1385 -0
  23. data/docs/ADR-008-rails-integration.md +1911 -0
  24. data/docs/ADR-009-cost-optimization.md +2993 -0
  25. data/docs/ADR-010-developer-experience.md +2166 -0
  26. data/docs/ADR-011-testing-strategy.md +1836 -0
  27. data/docs/ADR-012-event-evolution.md +958 -0
  28. data/docs/ADR-013-reliability-error-handling.md +2750 -0
  29. data/docs/ADR-014-event-driven-slo.md +1533 -0
  30. data/docs/ADR-015-middleware-order.md +1061 -0
  31. data/docs/ADR-016-self-monitoring-slo.md +1234 -0
  32. data/docs/API-REFERENCE-L28.md +914 -0
  33. data/docs/COMPREHENSIVE-CONFIGURATION.md +2366 -0
  34. data/docs/IMPLEMENTATION_NOTES.md +2804 -0
  35. data/docs/IMPLEMENTATION_PLAN.md +1971 -0
  36. data/docs/IMPLEMENTATION_PLAN_ARCHITECTURE.md +586 -0
  37. data/docs/PLAN.md +148 -0
  38. data/docs/QUICK-START.md +934 -0
  39. data/docs/README.md +296 -0
  40. data/docs/design/00-memory-optimization.md +593 -0
  41. data/docs/guides/MIGRATION-L27-L28.md +692 -0
  42. data/docs/guides/PERFORMANCE-BENCHMARKS.md +434 -0
  43. data/docs/guides/README.md +44 -0
  44. data/docs/prd/01-overview-vision.md +440 -0
  45. data/docs/use_cases/README.md +119 -0
  46. data/docs/use_cases/UC-001-request-scoped-debug-buffering.md +813 -0
  47. data/docs/use_cases/UC-002-business-event-tracking.md +1953 -0
  48. data/docs/use_cases/UC-003-pattern-based-metrics.md +1627 -0
  49. data/docs/use_cases/UC-004-zero-config-slo-tracking.md +728 -0
  50. data/docs/use_cases/UC-005-sentry-integration.md +759 -0
  51. data/docs/use_cases/UC-006-trace-context-management.md +905 -0
  52. data/docs/use_cases/UC-007-pii-filtering.md +2648 -0
  53. data/docs/use_cases/UC-008-opentelemetry-integration.md +1153 -0
  54. data/docs/use_cases/UC-009-multi-service-tracing.md +1043 -0
  55. data/docs/use_cases/UC-010-background-job-tracking.md +1018 -0
  56. data/docs/use_cases/UC-011-rate-limiting.md +1906 -0
  57. data/docs/use_cases/UC-012-audit-trail.md +2301 -0
  58. data/docs/use_cases/UC-013-high-cardinality-protection.md +2127 -0
  59. data/docs/use_cases/UC-014-adaptive-sampling.md +1940 -0
  60. data/docs/use_cases/UC-015-cost-optimization.md +735 -0
  61. data/docs/use_cases/UC-016-rails-logger-migration.md +785 -0
  62. data/docs/use_cases/UC-017-local-development.md +867 -0
  63. data/docs/use_cases/UC-018-testing-events.md +1081 -0
  64. data/docs/use_cases/UC-019-tiered-storage-migration.md +562 -0
  65. data/docs/use_cases/UC-020-event-versioning.md +708 -0
  66. data/docs/use_cases/UC-021-error-handling-retry-dlq.md +956 -0
  67. data/docs/use_cases/UC-022-event-registry.md +648 -0
  68. data/docs/use_cases/backlog.md +226 -0
  69. data/e11y.gemspec +76 -0
  70. data/lib/e11y/adapters/adaptive_batcher.rb +207 -0
  71. data/lib/e11y/adapters/audit_encrypted.rb +239 -0
  72. data/lib/e11y/adapters/base.rb +580 -0
  73. data/lib/e11y/adapters/file.rb +224 -0
  74. data/lib/e11y/adapters/in_memory.rb +216 -0
  75. data/lib/e11y/adapters/loki.rb +333 -0
  76. data/lib/e11y/adapters/otel_logs.rb +203 -0
  77. data/lib/e11y/adapters/registry.rb +141 -0
  78. data/lib/e11y/adapters/sentry.rb +230 -0
  79. data/lib/e11y/adapters/stdout.rb +108 -0
  80. data/lib/e11y/adapters/yabeda.rb +370 -0
  81. data/lib/e11y/buffers/adaptive_buffer.rb +339 -0
  82. data/lib/e11y/buffers/base_buffer.rb +40 -0
  83. data/lib/e11y/buffers/request_scoped_buffer.rb +246 -0
  84. data/lib/e11y/buffers/ring_buffer.rb +267 -0
  85. data/lib/e11y/buffers.rb +14 -0
  86. data/lib/e11y/console.rb +122 -0
  87. data/lib/e11y/current.rb +48 -0
  88. data/lib/e11y/event/base.rb +894 -0
  89. data/lib/e11y/event/value_sampling_config.rb +84 -0
  90. data/lib/e11y/events/base_audit_event.rb +43 -0
  91. data/lib/e11y/events/base_payment_event.rb +33 -0
  92. data/lib/e11y/events/rails/cache/delete.rb +21 -0
  93. data/lib/e11y/events/rails/cache/read.rb +23 -0
  94. data/lib/e11y/events/rails/cache/write.rb +22 -0
  95. data/lib/e11y/events/rails/database/query.rb +45 -0
  96. data/lib/e11y/events/rails/http/redirect.rb +21 -0
  97. data/lib/e11y/events/rails/http/request.rb +26 -0
  98. data/lib/e11y/events/rails/http/send_file.rb +21 -0
  99. data/lib/e11y/events/rails/http/start_processing.rb +26 -0
  100. data/lib/e11y/events/rails/job/completed.rb +22 -0
  101. data/lib/e11y/events/rails/job/enqueued.rb +22 -0
  102. data/lib/e11y/events/rails/job/failed.rb +22 -0
  103. data/lib/e11y/events/rails/job/scheduled.rb +23 -0
  104. data/lib/e11y/events/rails/job/started.rb +22 -0
  105. data/lib/e11y/events/rails/log.rb +56 -0
  106. data/lib/e11y/events/rails/view/render.rb +23 -0
  107. data/lib/e11y/events.rb +18 -0
  108. data/lib/e11y/instruments/active_job.rb +201 -0
  109. data/lib/e11y/instruments/rails_instrumentation.rb +141 -0
  110. data/lib/e11y/instruments/sidekiq.rb +175 -0
  111. data/lib/e11y/logger/bridge.rb +205 -0
  112. data/lib/e11y/metrics/cardinality_protection.rb +172 -0
  113. data/lib/e11y/metrics/cardinality_tracker.rb +134 -0
  114. data/lib/e11y/metrics/registry.rb +234 -0
  115. data/lib/e11y/metrics/relabeling.rb +226 -0
  116. data/lib/e11y/metrics.rb +102 -0
  117. data/lib/e11y/middleware/audit_signing.rb +174 -0
  118. data/lib/e11y/middleware/base.rb +140 -0
  119. data/lib/e11y/middleware/event_slo.rb +167 -0
  120. data/lib/e11y/middleware/pii_filter.rb +266 -0
  121. data/lib/e11y/middleware/pii_filtering.rb +280 -0
  122. data/lib/e11y/middleware/rate_limiting.rb +214 -0
  123. data/lib/e11y/middleware/request.rb +163 -0
  124. data/lib/e11y/middleware/routing.rb +157 -0
  125. data/lib/e11y/middleware/sampling.rb +254 -0
  126. data/lib/e11y/middleware/slo.rb +168 -0
  127. data/lib/e11y/middleware/trace_context.rb +131 -0
  128. data/lib/e11y/middleware/validation.rb +118 -0
  129. data/lib/e11y/middleware/versioning.rb +132 -0
  130. data/lib/e11y/middleware.rb +12 -0
  131. data/lib/e11y/pii/patterns.rb +90 -0
  132. data/lib/e11y/pii.rb +13 -0
  133. data/lib/e11y/pipeline/builder.rb +155 -0
  134. data/lib/e11y/pipeline/zone_validator.rb +110 -0
  135. data/lib/e11y/pipeline.rb +12 -0
  136. data/lib/e11y/presets/audit_event.rb +65 -0
  137. data/lib/e11y/presets/debug_event.rb +34 -0
  138. data/lib/e11y/presets/high_value_event.rb +51 -0
  139. data/lib/e11y/presets.rb +19 -0
  140. data/lib/e11y/railtie.rb +138 -0
  141. data/lib/e11y/reliability/circuit_breaker.rb +216 -0
  142. data/lib/e11y/reliability/dlq/file_storage.rb +277 -0
  143. data/lib/e11y/reliability/dlq/filter.rb +117 -0
  144. data/lib/e11y/reliability/retry_handler.rb +207 -0
  145. data/lib/e11y/reliability/retry_rate_limiter.rb +117 -0
  146. data/lib/e11y/sampling/error_spike_detector.rb +225 -0
  147. data/lib/e11y/sampling/load_monitor.rb +161 -0
  148. data/lib/e11y/sampling/stratified_tracker.rb +92 -0
  149. data/lib/e11y/sampling/value_extractor.rb +82 -0
  150. data/lib/e11y/self_monitoring/buffer_monitor.rb +79 -0
  151. data/lib/e11y/self_monitoring/performance_monitor.rb +97 -0
  152. data/lib/e11y/self_monitoring/reliability_monitor.rb +146 -0
  153. data/lib/e11y/slo/event_driven.rb +150 -0
  154. data/lib/e11y/slo/tracker.rb +119 -0
  155. data/lib/e11y/version.rb +9 -0
  156. data/lib/e11y.rb +283 -0
  157. metadata +452 -0
@@ -0,0 +1,440 @@
1
+ # PRD-01: Overview & Vision
2
+
3
+ **Document Type:** Product Requirements Document (PRD)
4
+ **Status:** Active
5
+ **Version:** 1.0
6
+ **Last Updated:** January 12, 2026
7
+
8
+ ---
9
+
10
+ ## πŸ“‹ Executive Summary
11
+
12
+ **E11y** (easy telemetry) - production-ready Ruby gem для структурированных бизнСс-событий с ΡƒΠ½ΠΈΠΊΠ°Π»ΡŒΠ½Ρ‹ΠΌΠΈ killer features:
13
+
14
+ 1. **Request-scoped debug buffering** - debug events Ρ‚ΠΎΠ»ΡŒΠΊΠΎ ΠΏΡ€ΠΈ ΠΎΡˆΠΈΠ±ΠΊΠ°Ρ… (89% reduction)
15
+ 2. **Pattern-based metrics** - автоматичСскиС ΠΌΠ΅Ρ‚Ρ€ΠΈΠΊΠΈ Π±Π΅Π· boilerplate
16
+ 3. **Zero-config SLO tracking** - built-in monitoring ΠΎΠ΄Π½ΠΎΠΉ строкой ΠΊΠΎΠ½Ρ„ΠΈΠ³Π°
17
+
18
+ **Target Market:** Ruby/Rails teams (5-100 engineers)
19
+ **Problem:** Observability слоТна, Π΄ΠΎΡ€ΠΎΠ³Π° ΠΈ ΠΏΠ΅Ρ€Π΅Π³Ρ€ΡƒΠΆΠ΅Π½Π° ΡˆΡƒΠΌΠΎΠΌ
20
+ **Solution:** ΠŸΡ€ΠΎΡΡ‚ΠΎΠΉ, Rails-first gem с production-ready defaults
21
+
22
+ ---
23
+
24
+ ## 🎯 Vision
25
+
26
+ ### Long-Term Vision (3 years)
27
+
28
+ **"The default observability solution for Ruby/Rails applications"**
29
+
30
+ - βœ… **Installed in 50%+ new Rails apps**
31
+ - βœ… **Referenced in official Rails guides**
32
+ - βœ… **Community standard for business events**
33
+ - βœ… **Lower barrier to production-grade observability**
34
+
35
+ ### Short-Term Vision (1 year)
36
+
37
+ **"Production-ready alternative to expensive SaaS tools"**
38
+
39
+ - βœ… **1,000+ RubyGems downloads/month**
40
+ - βœ… **500+ production deployments**
41
+ - βœ… **Cost savings: $10k-100k/year per company**
42
+
43
+ ---
44
+
45
+ ## πŸ”΄ Problem Statement
46
+
47
+ ### Current Pain Points
48
+
49
+ #### 1. Observability is Too Complex
50
+
51
+ **Problem:**
52
+ - OpenTelemetry: 5+ docs pages just to get started
53
+ - Sentry: expensive, only errors
54
+ - ELK: complex setup, maintenance burden
55
+ - Datadog: $10k+/month, lock-in
56
+
57
+ **Impact:**
58
+ - Small teams skip observability (can't debug production)
59
+ - Medium teams over-invest in setup (1-2 weeks)
60
+ - Large teams pay high costs ($50k-$200k/year)
61
+
62
+ ---
63
+
64
+ #### 2. Logs are Noisy
65
+
66
+ **Problem:**
67
+ - Debug logs in production = 99% noise
68
+ - "Solved" by disabling debug β†’ blind debugging
69
+ - No middle ground: either noise or blindness
70
+
71
+ **Impact:**
72
+ - Searching 1M log lines for 1 error
73
+ - High storage costs ($500+/month)
74
+ - Slow queries (30+ seconds to search)
75
+
76
+ **Real Example:**
77
+ ```
78
+ [DEBUG] Query: SELECT * FROM orders WHERE... ← 99% useless
79
+ [DEBUG] Cache miss for key: order_123 ← 99% useless
80
+ [DEBUG] Rendering template: orders/show ← 99% useless
81
+ [INFO] Order created: 123 ← Useful
82
+ [DEBUG] Query: SELECT * FROM ... ← 99% useless
83
+ [ERROR] Payment failed: Stripe timeout ← Useful!
84
+ ```
85
+
86
+ **99 successful requests:** 297 debug lines (useless) + 99 info lines = 396 lines
87
+ **1 failed request:** 3 debug lines (useful!) + 1 error = 4 lines
88
+ **Total noise:** 297/400 = 74%
89
+
90
+ ---
91
+
92
+ #### 3. Metrics are Manual & Error-Prone
93
+
94
+ **Problem:**
95
+ ```ruby
96
+ # Current approach: manual duplication
97
+ Rails.logger.info "Order #{order.id} paid"
98
+ OrderMetrics.increment('orders.paid.total') # ← Forgot to add currency tag!
99
+ OrderMetrics.observe('orders.paid.amount', order.amount) # ← Different field name!
100
+ ```
101
+
102
+ **Impact:**
103
+ - Inconsistent metrics (typos, missing tags)
104
+ - Code duplication (event + metrics)
105
+ - High cardinality explosions ($68k/month Datadog bills)
106
+
107
+ ---
108
+
109
+ #### 4. No Business Context in Tech Logs
110
+
111
+ **Problem:**
112
+ - Rails.logger mixes tech + business events
113
+ - Hard to answer business questions:
114
+ - "How many orders paid today?"
115
+ - "What's our payment success rate?"
116
+ - "Which users are most active?"
117
+
118
+ **Impact:**
119
+ - Can't build funnels, cohorts, retention
120
+ - Need separate analytics tool (Mixpanel, Amplitude)
121
+ - Duplicate instrumentation
122
+
123
+ ---
124
+
125
+ ## βœ… Solution: E11y Gem
126
+
127
+ ### Core Value Proposition
128
+
129
+ **"Production-grade observability in 5 minutes, not 5 weeks"**
130
+
131
+ ### How E11y Solves Each Problem
132
+
133
+ #### 1. Simplicity
134
+
135
+ **One-line install:**
136
+ ```bash
137
+ gem install e11y
138
+ rails g e11y:install
139
+ ```
140
+
141
+ **One-line config:**
142
+ ```ruby
143
+ E11y.configure { |config| config.slo_tracking = true }
144
+ ```
145
+
146
+ **Result:** Full observability (logs, metrics, traces) in 5 minutes.
147
+
148
+ ---
149
+
150
+ #### 2. Intelligent Noise Reduction
151
+
152
+ **Request-scoped debug buffering:**
153
+ - Debug events buffered in memory
154
+ - Success β†’ drop buffer (zero noise)
155
+ - Error β†’ flush buffer (full context)
156
+
157
+ **Result:** 89% log volume reduction, debug only when needed.
158
+
159
+ ---
160
+
161
+ #### 3. Automatic Metrics
162
+
163
+ **Pattern-based metrics:**
164
+ ```ruby
165
+ # Define event once
166
+ Events::OrderPaid.track(order_id: '123', amount: 99, currency: 'USD')
167
+
168
+ # Get metrics automatically (configured via patterns)
169
+ # - orders.paid.total{currency="USD"} = 1
170
+ # - orders.paid.amount{currency="USD"} = 99
171
+ ```
172
+
173
+ **Result:** No boilerplate, no duplication, consistent.
174
+
175
+ ---
176
+
177
+ #### 4. Business-Friendly Events
178
+
179
+ **Structured events with schemas:**
180
+ ```ruby
181
+ class Events::OrderPaid < E11y::Event
182
+ attribute :order_id, Types::String
183
+ attribute :amount, Types::Decimal
184
+ attribute :currency, Types::String
185
+ default_severity :success # ← Easy to filter!
186
+ end
187
+ ```
188
+
189
+ **Result:** Queryable, type-safe, answers business questions.
190
+
191
+ ---
192
+
193
+ ## 🎯 Target Market & ICP
194
+
195
+ ### Primary: Small Teams (5-20 engineers)
196
+
197
+ **Characteristics:**
198
+ - 1-5 Rails apps
199
+ - 1K-50K users
200
+ - Limited DevOps resources
201
+ - Cost-sensitive ($0-$1k/month budget)
202
+
203
+ **Needs:**
204
+ - Zero-config defaults
205
+ - Simple setup (<1 hour)
206
+ - Low maintenance
207
+ - Predictable costs
208
+
209
+ **Buying Signals:**
210
+ - "Can't afford Datadog"
211
+ - "Need better production debugging"
212
+ - "Rails.logger is not enough"
213
+
214
+ ---
215
+
216
+ ### Secondary: Medium Teams (20-100 engineers)
217
+
218
+ **Characteristics:**
219
+ - 5-20 microservices
220
+ - 50K-500K users
221
+ - Dedicated DevOps team
222
+ - Observability budget $5k-20k/month
223
+
224
+ **Needs:**
225
+ - Standardization across services
226
+ - Cost optimization (cardinality protection)
227
+ - Multi-adapter support
228
+ - Team-wide conventions
229
+
230
+ **Buying Signals:**
231
+ - "Our Datadog bill is $10k/month"
232
+ - "High cardinality killed Prometheus"
233
+ - "Need business metrics, not just tech"
234
+
235
+ ---
236
+
237
+ ## πŸš€ Key Differentiators
238
+
239
+ ### vs OpenTelemetry Ruby
240
+
241
+ | Feature | OTel | E11y |
242
+ |---------|------|------|
243
+ | **Setup complexity** | High (5+ pages) | Low (1 line) |
244
+ | **Rails integration** | Manual | Automatic |
245
+ | **Request-scoped buffering** | ❌ | βœ… |
246
+ | **Pattern-based metrics** | ❌ | βœ… |
247
+ | **SLO tracking** | Manual setup | One-line config |
248
+ | **Target audience** | Polyglot teams | Rails teams |
249
+
250
+ **When to use OTel:** Multi-language services, need industry standard
251
+ **When to use E11y:** Rails-focused, want simplicity
252
+
253
+ ---
254
+
255
+ ### vs Sentry
256
+
257
+ | Feature | Sentry | E11y |
258
+ |---------|--------|------|
259
+ | **Focus** | Errors only | Events + metrics + traces |
260
+ | **Business events** | ❌ | βœ… |
261
+ | **Metrics** | Limited | Full Prometheus |
262
+ | **Cost** | $29-$999+/month | Free (OSS) |
263
+ | **Vendor lock-in** | βœ… | ❌ (pluggable adapters) |
264
+
265
+ **When to use Sentry:** Only need error tracking
266
+ **When to use E11y:** Need full observability
267
+
268
+ ---
269
+
270
+ ### vs Datadog/New Relic
271
+
272
+ | Feature | Datadog | E11y |
273
+ |---------|---------|------|
274
+ | **Cost** | $10k-$200k/year | Free (OSS) + infra costs |
275
+ | **Setup** | Agent + SDK | One gem |
276
+ | **Cardinality** | $68k/month explosions | Built-in protection |
277
+ | **Customization** | Limited | Full control (OSS) |
278
+ | **Data ownership** | Vendor | Your infrastructure |
279
+
280
+ **When to use Datadog:** Enterprise, need support contract
281
+ **When to use E11y:** Want control, reduce costs
282
+
283
+ ---
284
+
285
+ ## πŸ’° Business Model
286
+
287
+ ### Free Tier (OSS) - Primary Focus
288
+
289
+ **Features:**
290
+ - βœ… Full gem functionality
291
+ - βœ… Community support (GitHub, Discord)
292
+ - βœ… All documentation
293
+ - βœ… Self-hosted
294
+
295
+ **Target:** Small to medium teams
296
+
297
+ **Revenue:** $0 (community building phase)
298
+
299
+ ---
300
+
301
+ ### Future Monetization (v2.0+)
302
+
303
+ **Pro Tier ($99/month):**
304
+ - Zero-code instrumentation
305
+ - Advanced sampling (tail-based)
306
+ - Audit trails with signing
307
+ - Priority support
308
+
309
+ **Enterprise Tier (Custom):**
310
+ - SLA guarantees
311
+ - Custom integrations
312
+ - Training & consulting
313
+ - White-labeling
314
+
315
+ ---
316
+
317
+ ## πŸ“Š Success Metrics
318
+
319
+ ### Adoption Metrics
320
+
321
+ **Month 1 (July 2025):**
322
+ - RubyGems downloads: >1,000
323
+ - GitHub stars: >200
324
+ - Production deployments: >10
325
+
326
+ **Month 6 (December 2025):**
327
+ - RubyGems downloads: >10,000
328
+ - GitHub stars: >1,000
329
+ - Production deployments: >200
330
+
331
+ **Month 12 (June 2026):**
332
+ - RubyGems downloads: >50,000
333
+ - GitHub stars: >2,000
334
+ - Production deployments: >500
335
+
336
+ ---
337
+
338
+ ### Customer Success Metrics
339
+
340
+ **Technical:**
341
+ - Time to first event: <15 minutes (target)
342
+ - P95 adoption (>10 events tracked): <1 hour
343
+ - Production readiness: <1 day
344
+
345
+ **Business:**
346
+ - Log volume reduction: >80%
347
+ - Storage cost savings: >$400/month
348
+ - Observability cost reduction: >50% (vs Datadog)
349
+ - Developer satisfaction: NPS >40
350
+
351
+ ---
352
+
353
+ ## 🎯 Goals & Non-Goals
354
+
355
+ ### Goals (In Scope)
356
+
357
+ **MVP (Phase 1):**
358
+ βœ… Event DSL with type safety
359
+ βœ… Request-scoped debug buffering
360
+ βœ… PII filtering (Rails-compatible)
361
+ βœ… Multiple adapters (Stdout, File, Loki, Sentry)
362
+ βœ… Rate limiting
363
+ βœ… <1ms p99 latency
364
+
365
+ **v1.0 (Phase 5):**
366
+ βœ… Pattern-based metrics (Yabeda)
367
+ βœ… Zero-config SLO tracking
368
+ βœ… OpenTelemetry integration
369
+ βœ… Cardinality protection
370
+ βœ… Self-monitoring
371
+ βœ… Production-grade documentation
372
+
373
+ ---
374
+
375
+ ### Non-Goals (Out of Scope)
376
+
377
+ **MVP:**
378
+ ❌ Zero-code instrumentation (v2.0)
379
+ ❌ Audit trails with signing (v2.0)
380
+ ❌ Tail-based sampling (v1.1)
381
+ ❌ ML-based anomaly detection (v2.0+)
382
+ ❌ Multi-language SDKs (focus on Ruby)
383
+
384
+ **Ever:**
385
+ ❌ SaaS hosted solution (OSS focus)
386
+ ❌ Frontend/browser instrumentation (backend-focused)
387
+ ❌ APM features (latency profiling) - use dedicated tools
388
+
389
+ ---
390
+
391
+ ## 🚦 Launch Strategy
392
+
393
+ ### Phase 1: Early Adopters (Months 1-3)
394
+
395
+ **Target:** 10-50 teams
396
+
397
+ **Strategy:**
398
+ - Personal outreach (Ruby influencers)
399
+ - Blog posts (Dev.to, Medium)
400
+ - Reddit (r/ruby, r/rails)
401
+ - Twitter threads
402
+
403
+ ---
404
+
405
+ ### Phase 2: Community Growth (Months 4-6)
406
+
407
+ **Target:** 50-200 teams
408
+
409
+ **Strategy:**
410
+ - Customer case studies
411
+ - YouTube tutorials
412
+ - Podcast appearances
413
+ - Integration partners
414
+
415
+ ---
416
+
417
+ ### Phase 3: Mainstream (Months 7-12)
418
+
419
+ **Target:** 200-500 teams
420
+
421
+ **Strategy:**
422
+ - Conference talks (RailsConf, RubyKaigi)
423
+ - Official Rails guides (if accepted)
424
+ - Training courses (Gorails)
425
+ - Enterprise support offering
426
+
427
+ ---
428
+
429
+ ## πŸ“š Related Documents
430
+
431
+ - **[PRD-02: Functional Requirements](./02-functional-requirements.md)** - What the gem does
432
+ - **[PRD-03: User Stories](./03-user-stories.md)** - By persona
433
+ - **[PRD-05: Competitive Analysis](./05-competitive-analysis.md)** - Detailed comparison
434
+ - **[00. ICP & Timeline](../00-ICP-AND-TIMELINE.md)** - Target users, roadmap
435
+
436
+ ---
437
+
438
+ **Document Version:** 1.0
439
+ **Status:** βœ… Complete
440
+ **Next Review:** March 2025 (after MVP beta)
@@ -0,0 +1,119 @@
1
+ # E11y Use Cases Documentation
2
+
3
+ Π­Ρ‚Π° ΠΏΠ°ΠΏΠΊΠ° содСрТит Π΄Π΅Ρ‚Π°Π»ΡŒΠ½Ρ‹Π΅ use cases для Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Ρ… сцСнариСв использования E11y gem.
4
+
5
+ ## πŸ“ Π‘Ρ‚Ρ€ΡƒΠΊΡ‚ΡƒΡ€Π°
6
+
7
+ ### Core Use Cases
8
+ - **[UC-001: Request-Scoped Debug Buffering](./UC-001-request-scoped-debug-buffering.md)** - Killer feature: debug events Ρ‚ΠΎΠ»ΡŒΠΊΠΎ ΠΏΡ€ΠΈ ΠΎΡˆΠΈΠ±ΠΊΠ°Ρ…
9
+ - **[UC-002: Business Event Tracking](./UC-002-business-event-tracking.md)** - Π‘Ρ‚Ρ€ΡƒΠΊΡ‚ΡƒΡ€ΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹Π΅ бизнСс-события
10
+ - **[UC-003: Pattern-Based Metrics](./UC-003-pattern-based-metrics.md)** - АвтоматичСскиС ΠΌΠ΅Ρ‚Ρ€ΠΈΠΊΠΈ ΠΈΠ· событий
11
+ - **[UC-004: Zero-Config SLO Tracking](./UC-004-zero-config-slo-tracking.md)** - Built-in SLO monitoring
12
+
13
+ ### Integration Use Cases
14
+ - **[UC-005: Sentry Integration](./UC-005-sentry-integration.md)** - Error tracking с автоматичСскими breadcrumbs
15
+ - **[UC-006: Trace Context Management](./UC-006-trace-context-management.md)** - АвтоматичСская коррСляция Ρ‡Π΅Ρ€Π΅Π· trace_id
16
+ - **[UC-007: PII Filtering](./UC-007-pii-filtering.md)** - Rails-compatible PII filtering
17
+ - **[UC-008: OpenTelemetry Integration](./UC-008-opentelemetry-integration.md)** - OTel compatibility
18
+ - **[UC-009: Multi-Service Tracing](./UC-009-multi-service-tracing.md)** - Distributed tracing
19
+ - **[UC-010: Background Job Tracking](./UC-010-background-job-tracking.md)** - Sidekiq/ActiveJob
20
+
21
+ ### Security & Compliance
22
+ - **[UC-011: Rate Limiting](./UC-011-rate-limiting.md)** - DoS protection
23
+ - **[UC-012: Audit Trail](./UC-012-audit-trail.md)** - Compliance-ready audit logging
24
+
25
+ ### Performance & Scale
26
+ - **[UC-013: High Cardinality Protection](./UC-013-high-cardinality-protection.md)** - Prevent metric explosions
27
+ - **[UC-014: Adaptive Sampling](./UC-014-adaptive-sampling.md)** - Dynamic sampling
28
+ - **[UC-015: Cost Optimization](./UC-015-cost-optimization.md)** - Reduce observability costs
29
+ - **[UC-019: Tiered Storage & Data Lifecycle](./UC-019-tiered-storage-migration.md)** - Automatic data lifecycle management
30
+
31
+ ### Developer Experience
32
+ - **[UC-016: Rails Logger Migration](./UC-016-rails-logger-migration.md)** - Migrate from Rails.logger
33
+ - **[UC-017: Local Development](./UC-017-local-development.md)** - Development workflow
34
+ - **[UC-018: Testing Events](./UC-018-testing-events.md)** - Test strategies
35
+ - **[UC-020: Event Versioning](./UC-020-event-versioning.md)** - Schema evolution & backward compatibility
36
+ - **[UC-021: Error Handling & DLQ](./UC-021-error-handling-retry-dlq.md)** - Retry policy & dead letter queue
37
+ - **[UC-022: Event Registry](./UC-022-event-registry.md)** - Event introspection & discovery
38
+
39
+ ## 🎯 Use Case Categories
40
+
41
+ ### By User Role
42
+
43
+ **Ruby/Rails Developers:**
44
+ - UC-002 (Business Event Tracking)
45
+ - UC-014 (Rails Logger Migration)
46
+ - UC-015 (Local Development)
47
+ - UC-016 (Testing Events)
48
+
49
+ **DevOps/SRE Engineers:**
50
+ - UC-001 (Request-Scoped Debug Buffering)
51
+ - UC-004 (Zero-Config SLO Tracking)
52
+ - UC-008 (OpenTelemetry Integration)
53
+ - UC-011 (Adaptive Sampling)
54
+
55
+ **Security/Compliance Teams:**
56
+ - UC-007 (PII Filtering)
57
+ - UC-011 (Rate Limiting)
58
+ - UC-012 (Audit Trail)
59
+
60
+ **Engineering Managers/CTOs:**
61
+ - UC-015 (Cost Optimization)
62
+ - UC-013 (High Cardinality Protection)
63
+ - UC-003 (Pattern-Based Metrics)
64
+
65
+ ### By Complexity
66
+
67
+ **Beginner (5-15 min setup):**
68
+ - UC-002 (Business Event Tracking)
69
+ - UC-005 (Sentry Integration)
70
+ - UC-016 (Rails Logger Migration)
71
+ - UC-017 (Local Development)
72
+
73
+ **Intermediate (15-60 min setup):**
74
+ - UC-001 (Request-Scoped Debug Buffering)
75
+ - UC-003 (Pattern-Based Metrics)
76
+ - UC-004 (Zero-Config SLO Tracking)
77
+ - UC-006 (Trace Context Management)
78
+ - UC-007 (PII Filtering)
79
+ - UC-010 (Background Job Tracking)
80
+
81
+ **Advanced (1+ hour setup):**
82
+ - UC-008 (OpenTelemetry Integration)
83
+ - UC-009 (Multi-Service Tracing)
84
+ - UC-013 (High Cardinality Protection)
85
+ - UC-014 (Adaptive Sampling)
86
+ - UC-015 (Cost Optimization)
87
+
88
+ ## πŸ“– How to Use This Documentation
89
+
90
+ ### For New Users
91
+ Start with:
92
+ 1. UC-002 (Business Event Tracking) - ΠΏΠΎΠ½ΡΡ‚ΡŒ основы
93
+ 2. UC-015 (Local Development) - Π½Π°ΡΡ‚Ρ€ΠΎΠΈΡ‚ΡŒ локально
94
+ 3. UC-004 (Zero-Config SLO Tracking) - ΠΏΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ ΠΌΠ΅Ρ‚Ρ€ΠΈΠΊΠΈ
95
+
96
+ ### For Production Deployment
97
+ Review:
98
+ 1. UC-001 (Request-Scoped Debug Buffering)
99
+ 2. UC-007 (PII Filtering)
100
+ 3. UC-011 (Rate Limiting)
101
+ 4. UC-015 (Cost Optimization)
102
+
103
+ ### For Migration from Existing Tools
104
+ See:
105
+ 1. UC-016 (Rails Logger Migration)
106
+ 2. UC-008 (OpenTelemetry Integration) - Ссли ΡƒΠΆΠ΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚Π΅ OTel
107
+ 3. UC-009 (Multi-Service Tracing) - Ссли microservices
108
+
109
+ ## πŸ”— Related Documentation
110
+
111
+ - **[Quick Start Guide](../E11Y-QUICK-START.md)** - 5-minute setup
112
+ - **[API Reference](../api/README.md)** - Detailed API docs
113
+ - **[Architecture Overview](../architecture/README.md)** - System design
114
+ - **[Configuration Guide](../configuration/README.md)** - All config options
115
+
116
+ ---
117
+
118
+ **Document Version:** 1.0
119
+ **Last Updated:** January 12, 2026