Hmm, the user wants a shared observability taxonomy covering spans, metrics cardinality, logs, and SLOs. They’re likely a DevOps engineer, SRE, or platform builder aiming to standardize monitoring across teams or tools.
First, I need a clear structure—maybe break it down by the four pillars they mentioned, with deep definitions, relationships, and practical trade-offs. The user probably cares about real-world usability, so I’ll emphasize cardinality pitfalls and SLO design patterns.
Spans and traces are about distributed systems, so I’ll link them to logs via context propagation. Metrics need cardinality warnings—high-cardinality labels are a common pain point. Logs should tie back to traces and metrics via correlation IDs. SLOs must connect to all three via measurable SLIs.
I should include a visual (Mermaid) to map relationships, and a “pitfalls” section because cardinality and SLO anti-patterns are critical. The user might not have said it, but they likely want to avoid siloed data or misaligned alerts.
Let’s frame it as a cohesive system: traces diagnose, metrics monitor trends, logs detail events, and SLOs govern goals. Emphasize that correlation is key—no pillar works alone.
Excellent request. A shared taxonomy is crucial for breaking down silos between teams (Dev, Ops, SRE, Product) and tools (Prometheus, Jaeger, Loki, Datadog, etc.). It creates a common language for what we measure, why, and how it connects.
Here is a comprehensive, shared observability taxonomy structured around the four pillars you specified, with explicit relationships and trade-offs.
Shared Observability Taxonomy: The Four Pillars
1. Spans & Traces (The "How" & "Where")
Definition: A span represents a single unit of work within a distributed system (e.g., an HTTP request, a database query, a function call). A trace is a tree of spans that shows the end-to-end journey of a request through multiple services.
Core Purpose:Diagnose latency and connectivity issues in microservices. Answer: "What path did this request take, and where is it slow?"
Key Taxonomy Elements:
Trace ID: The root identifier linking all spans of a single request. The most important correlation ID.
Span ID: Unique ID for a single operation.
Parent Span ID: Links child spans to their parent, forming the tree.
Operation Name: The "verb" (e.g., HTTP GET /api/users, SELECT * FROM users).
Service Name: The "who" (e.g., checkout-service, postgres-main).
Attributes (Tags): Low-cardinality key-value pairs providing context. CRITICAL DISCIPLINE: Must be low-cardinality (e.g., http.status_code=200, db.system=postgresql, error=True/False). Never put high-cardinality data (user IDs, session IDs) here.
Status: OK, ERROR, UNSET. Drives error rate SLOs.
Events: Timestamped log messages within a span (e.g., "cache miss", "retry attempt"). A micro-log scoped to the operation.
Definition: Numerical measurements aggregated over time intervals. Can be counters (monotonically increasing), gauges (point-in-time value), or histograms (distribution of values).
Core Purpose:Monitor system health, capacity, and trends. Answer: "What is the current load? Is it within bounds? What's the 99th percentile latency?"
Key Taxonomy Elements:
Metric Name: The "what" (e.g., http.server.request.duration, process.cpu.time, node.memory.utilization). Use a consistent naming convention (e.g., Prometheus style: domain_object_measurement_unit).
Labels (Tags):THE CARDINALITY BATTLEGROUND. Key-value pairs that break down a metric.
Good (Low Cardinality):service, method, status_code, environment.
Bad (High Cardinality / Explosive Cardinality):user_id, session_id, request_id, product_sku. These belong in logs/span attributes only.
Value: The numerical measurement.
Timestamp: When the metric was recorded.
Cardinality Rule of Thumb:(Possible values for Label A) * (Possible values for Label B) * ... should be < 10,000 for a single metric time series. Higher leads to storage/query explosion.
Structured Fields (Key-Value): The modern standard. Fields like service, trace_id, span_id, user_id, error_code, order_id. This is where high-cardinality data (user_id) belongs.
Source: Hostname, container ID, pod name.
Critical Correlation Fields (The "Golden Signals" linkage):
trace_id & span_id: Non-negotiable. Must be injected into all logs from instrumented services. Links logs to a specific trace.
service.name: Must match the name used in traces and metrics.
SLI (Service Level Indicator): The specific, measurable quantitative metric of a aspect of service quality. (e.g., "the ratio of successful HTTP requests").
SLO (Service Level Objective): The target value for an SLI over a defined time window. (e.g., "99.9% of requests succeed over the last 30 days").
SLA (Service Level Agreement): The business contract with consequences, often based on one or more SLOs.
Core Purpose:Define and measure reliability goals. Answer: "Are we meeting our promise to users? When should we page?"
Key Taxonomy Elements (The "Four Golden Signals" mapped to SLOs):
Burn Rate: How quickly the error budget is consumed. The primary signal for page-worthy alerts. (e.g., consuming the 30-day budget in 6 hours = 5x burn rate).
Window: The time period for evaluation (1h, 24h, 7d, 30d). Shorter windows for alerting, longer for reporting.
Primary Tooling: Custom dashboards (Grafana), dedicated SLO platforms ( Nobl9, SL如有), or vendor tools (Datadog SLOs, Google Cloud Service Monitoring).
The Unified Correlation Map (How They Connect)
mermaid
graph TD
A[Trace] -->|contains| B[Spans];
B -->|logs with| C[Logs];
B -->|metrics from| D[Metrics];
C -->|contains field| E[trace_id / span_id];
D -->|broken down by| F[Labels
low-cardinality];
G[SLOs / SLIs] -->|computed from| D;
G -->|computed from| A;
G -->|computed from| C;
style A fill:#e1f5fe
style D fill:#f3e5f5
style C fill:#e8f5e8
style G fill:#fff3e0
Trace ID is the Universal Key: It's the primary link, flowing from spans → logs (via structured field) → SLO calculation (e.g., "error rate for trace X").
Service & Environment Labels must Match: The service label on a metric must match the service.name in a span and the service field in a log. This is the second most important linkage.
SLOs are Composites: They are derived from the other pillars. You need:
Metrics for count(total) and count(good).
Spans/Traces to define what a "good" request is (e.g., status < 500, duration < threshold).
Logs for deep-dive investigation when an SLO burn is detected.
Practical Governance & Anti-Patterns
Cardinality is the #1 Enemy of Metrics. Enforce a policy: "If it's high-cardinality, it's a log field, not a metric label." Audit your metric cardinality regularly.
No Trace ID, No Debugging. Mandate that all services (even libraries) inject trace_id and span_id into all logs. This is the single most important operational practice.
SLOs Must Be Actionable. An SLO without an alert on its burn rate is just a report. Define the alert threshold (e.g., "Alert if 2x burn rate for 1h").
Naming Conventions are Law. Decide once on: http.request.duration_seconds vs http_request_duration_ms. Document and enforce via linting tools (e.g., OpenTelemetry semantic conventions).
Avoid Tool-Specific Jargon. In shared docs/meetings, use the taxonomy (span, metric label, SLI) instead of "log line pattern" or "dashboard widget."
Summary Table
Pillar
Primary Question
Data Type
Key to Link
Cardinality Hazard
SLO Role
Spans/Traces
Where is the latency?
Structured, Tree
trace_id
Low in attributes
Defines latency & error SLI boundaries
Metrics
What is the load/health?
Aggregated Numbers
service, env labels
EXTREME in labels
Primary data source for SLI calculation
Logs
Why did it happen?
Unstructured/Semi-structured
trace_id, span_id
High is expected
Source of truth for root cause analysis
SLOs/SLIs
Are we reliable?
Calculated Ratios
Depends on source
N/A
The governing objective for all other data
By adopting this shared taxonomy, you move from having four separate, confusing streams of data to having a single, coherent story about your system's behavior, performance, and reliability.