Part 8 · Blueprint 49
Large-Scale Log Aggregation & Search Pipeline (Datadog / Splunk Scale)
12 min reading · Sources · Editorial review pending
A successful application response can coexist with lost or delayed telemetry.
Page details
Published date · Last edited:
Draft edition. Editorial review and supplementary reading recommendations are still being completed.
Format: Architecture walkthrough. Prerequisites: the beginner bootcamp. Chapter prerequisites: Message Queues & Event Streams: Kafka vs. RabbitMQ, Observability, Distributed Tracing & Error Budget SLOs, Time-Series Database Engine (Prometheus / InfluxDB / Gorilla).
Sixty-second mental model
Problem: A successful application response can coexist with lost or delayed telemetry.
Use: Bound ingestion, isolate tenants and expose dropped-event evidence.
Design boundary: Collect operational logs with explicit loss, privacy, retention and query budgets. Search indexing is a derived path; ingestion success must say whether data is durable or only buffered.
Layer 1 · Intuition
Hypothetical scenario: Northwind is designing log aggregation. Maya represents product requirements, Dev implementation and Priya reliability. The team must agree what one log event means and which component owns the log event identity and policy.
Think of a searchable dispatch archive with bounded retention. Separate the requester from log event identity and policy, then identify the retained evidence needed after failure.
- Authority
- The entitled state owner.
- Invariant
- A rule preserved across concurrency and failures.
Architecture and worked reasoning
Design boundary: Collect operational logs with explicit loss, privacy, retention and query budgets. Search indexing is a derived path; ingestion success must say whether data is durable or only buffered.
Responsibilities on the request path
Workload and limiting resource
Hypothetical 20,000 records/s at 500 bytes/record is 10 MB/s raw, or 864 GB/day. Seven raw days are 6.048 TB before compression, replicas and indexes. Indexing every arbitrary field can multiply storage and cardinality work.
Keep the units attached to each intermediate result. The assumptions above describe a hypothetical exercise, not observed vendor capacity. A real capacity decision also needs a measured service curve, skew, recovery traffic and an explicit admission policy for overload.
Mutation or publication path
- Redact/structure records near the source.
- Buffer with bounded disk and backpressure policy.
- Persist/index under the selected tenant and retention scheme.
Observation and recovery path
- Search by time and bounded indexed fields.
- Distinguish delayed indexing from missing logs.
- Restrict access to sensitive fields and exports.
Failure that changes the decision
Hypothetical scenario: An incident raises log volume exactly when downstream storage slows. Decide which records can be sampled/dropped and expose loss counters instead of claiming complete history.
Attempt this decision before reading the explanation
Should logs contain full credentials or private request bodies to simplify debugging?
No. Redaction, access control and bounded retention are architectural requirements. Diagnostic usefulness does not justify uncontrolled secret collection.
Supporting mechanism analysis
Hypothetical scenario: Northwind. Maya represents product, Dev implementation and Priya reliability. The following workflow develops the underlying mechanism.
Dev: “We need its numerator, denominator and observation point before treating it as success.”
Before you continue: Can two separately healthy charts establish that the same requests met both conditions?
This preserves the question the service promised to answer. Use supporting spans and records to investigate failures without substituting an easier internal measurement.
Now reservation acceptance and completed payment add other boundaries. Keep separate indicators where they answer different product questions. A pending provider outcome can be truthful behavior under its workflow contract while still consuming time the buyer cares about. Telemetry should expose that distinction rather than collapse it into a generic green state.
Hypothetical scenario. An eligible attempt gets outcome identity U, while trace T links its internal waits. Preserve U even if tracing is unsampled, a client never reports completion or collection fails. A trace is explanatory evidence; the outcome indicator needs its own declared population and missing-data policy.
Burn-rate alerts need a window, denominator and actionable owner. A missing heartbeat or traffic collapse may require an independent alert because a request-based success ratio can have no eligible observations. Avoid recording secrets or unrestricted tenant payloads merely to make correlation convenient; authorize telemetry access and retain only the evidence the diagnosis needs.
Now add tenant identity with 1,000 possible values. Under the same full-combination assumption, the space becomes 120 × 1,000 = 120,000 series. Actual observed combinations may be fewer, but neither an average request rate nor a quiet dashboard bounds that growth. With one selected sample per series every fifteen seconds, a minute has 60 ÷ 15 = 4 samples per series. The two models yield 120 × 4 = 480 versus 120,000 × 4 = 480,000 samples per minute before other metrics or replicas. This is sample-count arithmetic, not a storage-byte or ingestion-capacity benchmark.
Removing the label at query time does not undo the ingestion already incurred. Review the exported dimensions at the instrumentation boundary, then verify the actual active-series and sample populations. Investigation context remains useful; it needs a representation whose cost and access rules match its purpose.
Add evidence at a boundary that can observe the missing journey, such as an independently operated external check or upstream request accounting. Decide how an absent denominator is represented; silently interpreting no data as perfect success creates an unjustified conclusion.
“Every error trace is retained.” A selection policy can target received errors without guaranteeing every failing path was instrumented and delivered.
“The slowest span is the root cause.” The span can include waiting caused elsewhere, omit uninstrumented work or reflect a downstream symptom. Investigate the causal path rather than assigning blame from duration alone.
Keep metric dimensions bounded and put selected high-cardinality investigation context in an appropriately controlled evidence store. Apply access and retention rules to operation identifiers and trace attributes. Correlation can expose sensitive relationships even without the full payload.
Layer 3 · Internals
A log pipeline separates collection, transport, storage/indexing and query. OpenTelemetry's log data model describes fields such as timestamps, severity, body and resource context, with trace context available when appropriate. The collector's acceptance boundary and the application's business acceptance boundary are different: an application can succeed while a bounded telemetry buffer drops records.
Indexing every arbitrary attribute increases both cardinality and cost. Decide which fields support interactive search, which remain in compressed payloads and which must be removed before ingestion. Tenant isolation must apply to query results, exports and operational tools, not just the primary ingestion API. A retrying collector needs event identities or an explicit duplicate policy, while a full local buffer needs visible loss accounting. Retention includes legal and privacy requirements as well as storage arithmetic. A trace identifier helps join evidence; it should not become a credential or expose another tenant's raw request body in a support workflow.
Trade-offs and limits
| Approach | Provides | Requires |
|---|---|---|
| Index selected attributes | Keeps common investigations responsive. | A new query may need a slower payload scan. |
| Index broad dynamic fields | Offers flexible interactive filtering. | Mapping growth, sensitive fields and cardinality need stronger controls. |
Recovery decision
Hypothetical scenario: An incident raises log volume exactly when downstream storage slows. Decide which records can be sampled/dropped and expose loss counters instead of claiming complete history.
No. Redaction, access control and bounded retention are architectural requirements. Diagnostic usefulness does not justify uncontrolled secret collection.
Write your design before revealing the review
Should logs contain full credentials or private request bodies to simplify debugging?
Drafts and self-review are stored only in this browser. They are separate from reading completion.
Compare your decision
No. Redaction, access control and bounded retention are architectural requirements. Diagnostic usefulness does not justify uncontrolled secret collection.
An incident raises log volume exactly when downstream storage slows. Decide which records can be sampled/dropped and expose loss counters instead of claiming complete history.
Check your understanding
Should logs contain full credentials or private request bodies to simplify debugging?
No. Redaction, access control and bounded retention are architectural requirements. Diagnostic usefulness does not justify uncontrolled secret collection.
How would you recover from this failure: An incident raises log volume exactly when downstream storage slows. Decide which records can be sampled/dropped and expose loss counters instead of claiming complete history.
Start with the exact boundary that failed. Redact/structure records near the source. Buffer with bounded disk and backpressure policy. Persist/index under the selected tenant and retention scheme. Then recover evidence through the observation path: Search by time and bounded indexed fields. Distinguish delayed indexing from missing logs. Restrict access to sensitive fields and exports. Preserve the distinction between a confirmed state change and an unavailable response.
Which assumption in the worked calculation would a burst or concentrated tenant invalidate first?
Hypothetical 20,000 records/s at 500 bytes/record is 10 MB/s raw, or 864 GB/day. Seven raw days are 6.048 TB before compression, replicas and indexes. Indexing every arbitrary field can multiply storage and cardinality work. Recompute the affected resource rather than multiplying unrelated storage and network budgets by the same factor. Collect operational logs with explicit loss, privacy, retention and query budgets. Search indexing is a derived path; ingestion success must say whether data is durable or only buffered.
Which component in this topology could be removed from a smaller first deployment?
Log agents, Ingest buffer, Index storage, Search service name responsibilities, not a requirement for separate processes. Co-locate responsibilities when their transaction, trust and capacity boundaries permit it. Redact/structure records near the source.
What evidence must a caller have before relying on the observation path?
Search by time and bounded indexed fields. Distinguish delayed indexing from missing logs. Restrict access to sensitive fields and exports. No. Redaction, access control and bounded retention are architectural requirements. Diagnostic usefulness does not justify uncontrolled secret collection.
45-minute interview rubric
- 00–05: scope log event and log event identity and policy.
- 05–12: identify the limiting resource and derive the domain workload above, retaining units and assumptions.
- 12–28: draw log event identity and policy, numbered writes and reads.
- 28–40: challenge recovery: Bound ingestion, isolate tenants and expose dropped-event evidence.
- 40–45: defend event_id placement, observations and remaining assumptions.
Go deeper
- Logs Data Model | OpenTelemetry · Primary document · opentelemetry.io. Bound ingestion, isolate tenants and expose dropped-event evidence. Verified 2026-10-26.
- Sampling | OpenTelemetry · Primary document · opentelemetry.io. Bound ingestion, isolate tenants and expose dropped-event evidence. Verified 2026-10-26.
- Instrumentation | Prometheus · Primary document · prometheus.io. Bound ingestion, isolate tenants and expose dropped-event evidence. Verified 2026-10-26.
- Trace Context · Primary document · www.w3.org. Bound ingestion, isolate tenants and expose dropped-event evidence. Verified 2026-10-26.
Decision log
Bound ingestion, isolate tenants and expose dropped-event evidence.
Preserve log event identity and log event identity and policy ownership.
Revisit changed workload, observations or recovery objectives.