1. Analyze the Request:
* Topic: Shared Observability Taxonomy.
* Key Components: Spans, Metrics (specifically Cardinality), Logs, and SLOs.
* Goal: Create a structured, unified vocabulary/framework that explains how these concepts relate to each other in the context of modern observability.
-
Deconstruct the Components & Relationships:
- Spans: The unit of work in distributed tracing. They represent time and context. They are "high fidelity" but often "high volume."
- Logs: Discrete events/messages. The "atom" of debugging. Text-heavy.
- Metrics: Aggregatable numbers over time. Efficient for trending and alerting. Cardinality is the critical concept here (dimensions vs. cost).
- SLOs (Service Level Objectives): The business/value layer. The "why" we observe.
- Correlation: The glue. How do we link logs to traces, traces to metrics, and metrics to SLOs?
-
Structure the Taxonomy:
- I need a logical flow. A bottom-up approach (Data Signals -> Aggregation -> Business Value) usually works best for taxonomy definitions.
- Layer 1: The Telemetry Signals (The "What") - Spans, Logs, Metrics.
- Layer 2: The Characteristics (The "How") - Cardinality, Context, Fidelity.
- Layer 3: The Governance/Value (The "Why") - SLOs, SLIs.
-
Drafting the Definitions (Iterative refinement):
-
Developing the "Shared" Aspect (The Taxonomy Matrix):
- A taxonomy isn't just definitions; it's how they map.
- Correlation: How logs connect to spans (Trace ID injection). How spans calculate metrics (Span Metrics). How metrics feed SLOs.
- The "Three Pillars" critique: Move away from "Three Pillars" (siloed) to a unified pipeline.
-
Refining the Content & Formatting:
- Use clear headings.
- Use a table for quick comparison.
- Add a section on "Interactions" (The Golden Path).
-
Self-Correction/Review during drafting:
- Initial thought: Just define the words.
- Correction: The prompt asks for a taxonomy. I need to categorize them by their function (Resolution, Prediction, Context).
- Check: Did I cover Cardinality? Yes, need to make sure it's linked to Metrics specifically (though logs have cardinality too, usually metrics are where the pain point lies).
-
Final Polish (producing the output):
- Introduction: Define Observability vs. Monitoring briefly.
- The Signals (Logs, Metrics, Spans): Detailed definitions.
- The Constraints (Cardinality): Deep dive.
- The Objectives (SLOs): The business wrapper.
- The Taxonomy Matrix: A visual/structured way to see them side-by-side.
- The Unified Workflow: How an engineer moves through them.
-
Final Output Generation: (This matches the provided good response).
This taxonomy defines a unified language for observability. It moves beyond simply collecting data to establishing a hierarchy where telemetry (Spans, Logs, Metrics) supports a reliability goal (SLOs).
Here is the shared taxonomy, structured by Signal Type, Structural Characteristics, and Business Alignment.
I. The Signal Layer (The "What")
These are the raw data types emitted by the system. In a shared taxonomy, these are not silos but interconnected signals.
1. Spans (The "Context")
- Definition: A span represents a unit of work or operation. It contains a name, start time, duration, and attributes.
- Taxonomy Role: Spans provide Causality. They link disparate microservices into a trace.
- Key Attributes:
- Trace ID: The unique identifier connecting all spans in a transaction.
- Parent ID: Creates the hierarchical relationship (DAG) of the call stack.
- Kind: Client, Server, Producer, Consumer, or Internal.
- Shared Rule: Every span must have a consistent
service.name and service.version attribute to ensure cross-team correlation.
2. Logs (The "Evidence")
- Definition: Timestamped, immutable records of discrete events that happened at a specific time.
- Taxonomy Role: Logs provide Granularity. They explain the "why" behind a span's behavior (e.g., stack traces, error codes).
- Key Attributes:
- Severity: Debug, Info, Warn, Error.
- Body: The actual message (structured JSON preferred over raw strings).
- Trace Context: Crucial for taxonomy. Logs must inject
trace_id and span_id to be correlated with traces.
- Shared Rule: Logs without trace context are considered "orphaned" and have significantly lower debugging value.
3. Metrics (The "Health")
- Definition: Numerical measurements aggregated over a time interval (e.g., count of requests, memory usage).
- Taxonomy Role: Metrics provide Aggregation. They allow for long-term trend analysis without the storage cost of raw logs/traces.
- Key Attributes:
- Name: What is being measured (e.g.,
http.server.requests).
- Type: Counter (goes up), Gauge (goes up/down), Histogram (distribution).
- Tags/Labels: Key-value pairs for filtering.
II. The Structural Layer (The "How")
This layer defines the constraints and quality of the data collected.
4. Metrics Cardinality (The "Cost Variable")
- Definition: The distinctness of values stored within a metric's labels (tags).
- Taxonomy Role: Cardinality defines the Financial and Performance Boundary.
- The Cardinality Spectrum:
- Low Cardinality: Value sets are small and bounded (e.g.,
status_code: 200, region: us-east-1).
- High Cardinality: Value sets are unbounded or massive (e.g.,
user_id, request_id, ip_address).
- Shared Rule (The Cardinality Pact):
- Metrics are for Low Cardinality data (alerting and dashboards).
- Spans/Logs are for High Cardinality data (debugging specific users).
- Anti-Pattern: Putting a User ID into a Metric tag will crash monitoring systems or explode billing (Metric Explosion).
III. The Business Layer (The "Why")
This layer translates technical signals into business value.
5. SLOs (Service Level Objectives)
- Definition: A target level for the reliability of a service, defined as a percentage (e.g., 99.9% availability).
- Taxonomy Role: SLOs are the Governance Layer. They determine which signals matter.
- Key Components:
- SLI (Service Level Indicator): The metric used to measure reliability (e.g., Ratio of "Good Events" / "Total Events").
- Error Budget: The inverse of the SLO (e.g., 0.1%). This is the allowed amount of unreliability.
- Shared Rule: SLOs dictate the alerting thresholds. If an alert does not consume Error Budget, it is a warning, not an incident.
IV. The Taxonomy Matrix (Summary)
| Dimension | Spans | Metrics | Logs | SLOs |
|---|
| Primary Focus | Causality & Flow | Trends & Aggregation | Events & Context | Reliability & Trust |
| Cardinality | High (Request ID, User ID) | Low (Status Code, Host) | High (Request ID, Stack Trace) | Low (99.9%, 0.1%) |
| Data Resolution | Per Request | Aggregated (Time Window) | Per Event | Calculated over Time |
| Use Case | Identifying where latency/failure originated. | Detecting if the system is unhealthy. | Understanding why a failure occurred. | Determining if customers are happy. |
| Relationship | Derived into Metrics (RED metrics). | Drives Alerts for SLOs. | Enriched by Spans (Trace ID). | Validates the cost of Metrics/Spans. |
V. Putting it together: The Unified Workflow
To make this taxonomy "shared," teams should follow this interaction model:
- The Trigger: A Metric breaches a threshold defined by an SLO (e.g., Error Rate > 0.1%).
- The Pivot: The alert contains a link to the specific Trace/Span causing the issue (enabled by high-cardinality linking).
- The Diagnosis: The engineer examines the Spans to find the slow service, then looks at the structured Logs attached to that Span (via
trace_id) to see the exception stack trace.
- The Prevention: The root cause is identified, and a new Metric or Log pattern is established to catch it earlier next time.