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.
- checksums.yaml +7 -0
- data/.rspec +4 -0
- data/.rubocop.yml +69 -0
- data/CHANGELOG.md +26 -0
- data/CODE_OF_CONDUCT.md +64 -0
- data/LICENSE.txt +21 -0
- data/README.md +179 -0
- data/Rakefile +37 -0
- data/benchmarks/run_all.rb +33 -0
- data/config/README.md +83 -0
- data/config/loki-local-config.yaml +35 -0
- data/config/prometheus.yml +15 -0
- data/docker-compose.yml +78 -0
- data/docs/00-ICP-AND-TIMELINE.md +483 -0
- data/docs/01-SCALE-REQUIREMENTS.md +858 -0
- data/docs/ADR-001-architecture.md +2617 -0
- data/docs/ADR-002-metrics-yabeda.md +1395 -0
- data/docs/ADR-003-slo-observability.md +3337 -0
- data/docs/ADR-004-adapter-architecture.md +2385 -0
- data/docs/ADR-005-tracing-context.md +1372 -0
- data/docs/ADR-006-security-compliance.md +4143 -0
- data/docs/ADR-007-opentelemetry-integration.md +1385 -0
- data/docs/ADR-008-rails-integration.md +1911 -0
- data/docs/ADR-009-cost-optimization.md +2993 -0
- data/docs/ADR-010-developer-experience.md +2166 -0
- data/docs/ADR-011-testing-strategy.md +1836 -0
- data/docs/ADR-012-event-evolution.md +958 -0
- data/docs/ADR-013-reliability-error-handling.md +2750 -0
- data/docs/ADR-014-event-driven-slo.md +1533 -0
- data/docs/ADR-015-middleware-order.md +1061 -0
- data/docs/ADR-016-self-monitoring-slo.md +1234 -0
- data/docs/API-REFERENCE-L28.md +914 -0
- data/docs/COMPREHENSIVE-CONFIGURATION.md +2366 -0
- data/docs/IMPLEMENTATION_NOTES.md +2804 -0
- data/docs/IMPLEMENTATION_PLAN.md +1971 -0
- data/docs/IMPLEMENTATION_PLAN_ARCHITECTURE.md +586 -0
- data/docs/PLAN.md +148 -0
- data/docs/QUICK-START.md +934 -0
- data/docs/README.md +296 -0
- data/docs/design/00-memory-optimization.md +593 -0
- data/docs/guides/MIGRATION-L27-L28.md +692 -0
- data/docs/guides/PERFORMANCE-BENCHMARKS.md +434 -0
- data/docs/guides/README.md +44 -0
- data/docs/prd/01-overview-vision.md +440 -0
- data/docs/use_cases/README.md +119 -0
- data/docs/use_cases/UC-001-request-scoped-debug-buffering.md +813 -0
- data/docs/use_cases/UC-002-business-event-tracking.md +1953 -0
- data/docs/use_cases/UC-003-pattern-based-metrics.md +1627 -0
- data/docs/use_cases/UC-004-zero-config-slo-tracking.md +728 -0
- data/docs/use_cases/UC-005-sentry-integration.md +759 -0
- data/docs/use_cases/UC-006-trace-context-management.md +905 -0
- data/docs/use_cases/UC-007-pii-filtering.md +2648 -0
- data/docs/use_cases/UC-008-opentelemetry-integration.md +1153 -0
- data/docs/use_cases/UC-009-multi-service-tracing.md +1043 -0
- data/docs/use_cases/UC-010-background-job-tracking.md +1018 -0
- data/docs/use_cases/UC-011-rate-limiting.md +1906 -0
- data/docs/use_cases/UC-012-audit-trail.md +2301 -0
- data/docs/use_cases/UC-013-high-cardinality-protection.md +2127 -0
- data/docs/use_cases/UC-014-adaptive-sampling.md +1940 -0
- data/docs/use_cases/UC-015-cost-optimization.md +735 -0
- data/docs/use_cases/UC-016-rails-logger-migration.md +785 -0
- data/docs/use_cases/UC-017-local-development.md +867 -0
- data/docs/use_cases/UC-018-testing-events.md +1081 -0
- data/docs/use_cases/UC-019-tiered-storage-migration.md +562 -0
- data/docs/use_cases/UC-020-event-versioning.md +708 -0
- data/docs/use_cases/UC-021-error-handling-retry-dlq.md +956 -0
- data/docs/use_cases/UC-022-event-registry.md +648 -0
- data/docs/use_cases/backlog.md +226 -0
- data/e11y.gemspec +76 -0
- data/lib/e11y/adapters/adaptive_batcher.rb +207 -0
- data/lib/e11y/adapters/audit_encrypted.rb +239 -0
- data/lib/e11y/adapters/base.rb +580 -0
- data/lib/e11y/adapters/file.rb +224 -0
- data/lib/e11y/adapters/in_memory.rb +216 -0
- data/lib/e11y/adapters/loki.rb +333 -0
- data/lib/e11y/adapters/otel_logs.rb +203 -0
- data/lib/e11y/adapters/registry.rb +141 -0
- data/lib/e11y/adapters/sentry.rb +230 -0
- data/lib/e11y/adapters/stdout.rb +108 -0
- data/lib/e11y/adapters/yabeda.rb +370 -0
- data/lib/e11y/buffers/adaptive_buffer.rb +339 -0
- data/lib/e11y/buffers/base_buffer.rb +40 -0
- data/lib/e11y/buffers/request_scoped_buffer.rb +246 -0
- data/lib/e11y/buffers/ring_buffer.rb +267 -0
- data/lib/e11y/buffers.rb +14 -0
- data/lib/e11y/console.rb +122 -0
- data/lib/e11y/current.rb +48 -0
- data/lib/e11y/event/base.rb +894 -0
- data/lib/e11y/event/value_sampling_config.rb +84 -0
- data/lib/e11y/events/base_audit_event.rb +43 -0
- data/lib/e11y/events/base_payment_event.rb +33 -0
- data/lib/e11y/events/rails/cache/delete.rb +21 -0
- data/lib/e11y/events/rails/cache/read.rb +23 -0
- data/lib/e11y/events/rails/cache/write.rb +22 -0
- data/lib/e11y/events/rails/database/query.rb +45 -0
- data/lib/e11y/events/rails/http/redirect.rb +21 -0
- data/lib/e11y/events/rails/http/request.rb +26 -0
- data/lib/e11y/events/rails/http/send_file.rb +21 -0
- data/lib/e11y/events/rails/http/start_processing.rb +26 -0
- data/lib/e11y/events/rails/job/completed.rb +22 -0
- data/lib/e11y/events/rails/job/enqueued.rb +22 -0
- data/lib/e11y/events/rails/job/failed.rb +22 -0
- data/lib/e11y/events/rails/job/scheduled.rb +23 -0
- data/lib/e11y/events/rails/job/started.rb +22 -0
- data/lib/e11y/events/rails/log.rb +56 -0
- data/lib/e11y/events/rails/view/render.rb +23 -0
- data/lib/e11y/events.rb +18 -0
- data/lib/e11y/instruments/active_job.rb +201 -0
- data/lib/e11y/instruments/rails_instrumentation.rb +141 -0
- data/lib/e11y/instruments/sidekiq.rb +175 -0
- data/lib/e11y/logger/bridge.rb +205 -0
- data/lib/e11y/metrics/cardinality_protection.rb +172 -0
- data/lib/e11y/metrics/cardinality_tracker.rb +134 -0
- data/lib/e11y/metrics/registry.rb +234 -0
- data/lib/e11y/metrics/relabeling.rb +226 -0
- data/lib/e11y/metrics.rb +102 -0
- data/lib/e11y/middleware/audit_signing.rb +174 -0
- data/lib/e11y/middleware/base.rb +140 -0
- data/lib/e11y/middleware/event_slo.rb +167 -0
- data/lib/e11y/middleware/pii_filter.rb +266 -0
- data/lib/e11y/middleware/pii_filtering.rb +280 -0
- data/lib/e11y/middleware/rate_limiting.rb +214 -0
- data/lib/e11y/middleware/request.rb +163 -0
- data/lib/e11y/middleware/routing.rb +157 -0
- data/lib/e11y/middleware/sampling.rb +254 -0
- data/lib/e11y/middleware/slo.rb +168 -0
- data/lib/e11y/middleware/trace_context.rb +131 -0
- data/lib/e11y/middleware/validation.rb +118 -0
- data/lib/e11y/middleware/versioning.rb +132 -0
- data/lib/e11y/middleware.rb +12 -0
- data/lib/e11y/pii/patterns.rb +90 -0
- data/lib/e11y/pii.rb +13 -0
- data/lib/e11y/pipeline/builder.rb +155 -0
- data/lib/e11y/pipeline/zone_validator.rb +110 -0
- data/lib/e11y/pipeline.rb +12 -0
- data/lib/e11y/presets/audit_event.rb +65 -0
- data/lib/e11y/presets/debug_event.rb +34 -0
- data/lib/e11y/presets/high_value_event.rb +51 -0
- data/lib/e11y/presets.rb +19 -0
- data/lib/e11y/railtie.rb +138 -0
- data/lib/e11y/reliability/circuit_breaker.rb +216 -0
- data/lib/e11y/reliability/dlq/file_storage.rb +277 -0
- data/lib/e11y/reliability/dlq/filter.rb +117 -0
- data/lib/e11y/reliability/retry_handler.rb +207 -0
- data/lib/e11y/reliability/retry_rate_limiter.rb +117 -0
- data/lib/e11y/sampling/error_spike_detector.rb +225 -0
- data/lib/e11y/sampling/load_monitor.rb +161 -0
- data/lib/e11y/sampling/stratified_tracker.rb +92 -0
- data/lib/e11y/sampling/value_extractor.rb +82 -0
- data/lib/e11y/self_monitoring/buffer_monitor.rb +79 -0
- data/lib/e11y/self_monitoring/performance_monitor.rb +97 -0
- data/lib/e11y/self_monitoring/reliability_monitor.rb +146 -0
- data/lib/e11y/slo/event_driven.rb +150 -0
- data/lib/e11y/slo/tracker.rb +119 -0
- data/lib/e11y/version.rb +9 -0
- data/lib/e11y.rb +283 -0
- 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
|