SaaS Observability: Logs, Metrics and Traces

Build SaaS observability that finds one tenant's failing request: metrics for symptoms, traces for the path, structured logs for the cause, joined by trace and tenant IDs.

10 min read
Developer at a standing desk tracing a hand-drawn line chart and three connected boxes on white paper with a pencil, two switched-off black monitors beside it in natural daylight, sketching SaaS observability by hand

SaaS observability is the ability to answer, from the telemetry a product already emits, what is broken, for which tenant, and why. It takes three signals working together: metrics that show a symptom, traces that show one request's path across services, and structured logs that hold the detail, joined by a shared trace ID and a tenant attribute.

Security and audit logging answers a different question, about who did what and whether the record can be trusted, and buyers' questions on it sit in our related guide on SaaS security. This article is the operational counterpart: telemetry that keeps the service running and helps support staff find one customer's failed request.

Key Takeaways

  • Metrics tell you something is wrong, traces show where a request failed, and logs explain why.
  • Trace context has to travel across every hop, including queues and background jobs, or the trail breaks.
  • Put the tenant ID on spans and log records, but keep it out of metric labels unless the tenant count is small and bounded.
  • Page on user-facing symptoms such as latency and error rate, and keep internal causes for debugging.
  • Accept the setup only when a synthetic failing request for a test tenant can be followed from alert to trace to log line.

What Do Logs, Metrics and Traces Each Answer?

A monitoring system has to answer what is broken and why, according to the Google SRE book chapter on monitoring distributed systems. OpenTelemetry treats traces, metrics and logs as separate signals, and each answers part of that.

  • Metrics. A metric is a measurement of a service captured at runtime. Request counts, error counts and latency distributions drive dashboards and alerts.
  • Traces. A trace records a request's path as a set of spans, each one unit of work with a start and end time. Child spans share the root span's trace ID and point to their parent span.
  • Logs. A log is a timestamped record, structured (recommended) or unstructured. Logs hold the exception or third-party response that explains why a span failed.

Without identifiers linking the three, an engineer is left matching timestamps by hand.

OpenTelemetry Concepts a SaaS Team Needs

OpenTelemetry is a vendor-neutral way to produce all three signals, and four of its concepts decide whether the data joins up.

  • Context propagation. When Service A calls Service B, it passes a trace ID and span ID so that Service B's span joins the same trace. The default propagator uses the W3C Trace Context traceparent header.
  • Resource attributes. A resource describes the entity producing telemetry, such as a process or pod. The SDK sets service.name to unknown_service unless you set it, so name every service explicitly.
  • Semantic conventions. Common attribute names across traces, metrics, logs and resources, so queries work the same across services and libraries.
  • The Collector. The OpenTelemetry Collector receives, processes and exports telemetry to one or more open source or commercial backends, and is a sensible place for sampling and redaction.

Putting Tenant Context on SaaS Observability Data

Telemetry without a tenant identifier can show whether the service is healthy, but not whether one customer is. Add the tenant ID as an attribute on every span and log record once the request is authenticated.

OpenTelemetry baggage can carry the tenant ID across service boundaries so downstream services can add it to their own telemetry. The OpenTelemetry docs warn against putting credentials, API keys or personal information in baggage, so pass an opaque internal ID rather than a company name or email address.

Keep High-Cardinality IDs Out of Metric Labels

The Prometheus guide to metric and label naming says every unique combination of label values is a new time series, and warns against high-cardinality labels such as user IDs. Its instrumentation guidance suggests that any metric with a cardinality over 100, or the potential to grow that large, calls for another approach.

A tenant label that is workable with a few dozen tenants can become a storage problem as the customer list grows. Per-tenant usage and cost-to-serve figures can sit in traces, logs or an analytics store instead, and that data also feeds plan design, as our related guide on SaaS pricing models explains.

Structured Logs That Carry Trace IDs

A structured log has a stable schema of field names and types that downstream systems can parse reliably. OpenTelemetry SDKs can inject the current trace ID and span ID into each log record, so an engineer can move from a span straight to its log lines.

Alert on User-Facing Symptoms

The Google SRE book names four golden signals for a user-facing system, and recommends paging on symptoms users feel while keeping causes as debugging aids.

  • Latency. Track failed requests separately, because fast errors can make overall latency look better than it is.
  • Traffic. Requests per second, or a demand measure that fits the product.
  • Errors. HTTP 500s, wrong content behind a 200 response, and responses slower than a committed limit.
  • Saturation. How full the most constrained resource is, including forecasts such as a disk about to fill.

The chapter asks whether each page is urgent, actionable and user-visible, and warns that frequent pages lead people to ignore alerts. Service level indicators come from this telemetry; setting targets belongs to SaaS service level agreements, and who responds once a page fires belongs to SaaS incident response.

Sampling Without Losing the Failing Request

Trace volume grows with traffic, and OpenTelemetry describes sampling as one of the most effective ways to cut observability costs.

  • Head sampling decides at the start of a trace, often from the trace ID and a set percentage. It is simple and efficient, but cannot by itself keep every trace containing an error.
  • Tail sampling decides after seeing most of the trace, so it can keep all error or slow traces. It is harder to operate, because the sampling component must be stateful and hold a large amount of data.

Keep error and slow traces in full so the request a customer reports still exists when support looks for it.

Decision Inputs for Product Owners and Development Leads

Agree these inputs before choosing a backend or adding instrumentation.

  • Tenant count: how many tenants you expect, which decides where the tenant ID can live.
  • Support workflow: what support staff know when a customer reports a problem, and which tool they search first.
  • Alert ownership: who is on call, and which symptoms page someone versus open a ticket.
  • Retention and cost: how long logs and traces are kept, and the sampling rules.
  • Data handling: which fields must never appear in telemetry, and where redaction runs.

Operational Failure Modes to Plan For

An observability gap is costly to discover during an incident, when the trace someone needs turns out to be missing.

  • Broken context across queues. A message queue or scheduled job may not carry context automatically. OpenTelemetry's custom propagation guidance is to inject context into a carrier the receiver can read, such as message metadata, and extract it on the other side.
  • Log volume cost. Debug logging at production traffic grows storage and query spend.
  • Alert fatigue. The SRE book suggests removing rarely exercised alert rules and signals no dashboard or alert uses.
  • Personal data in telemetry. Emails and tokens can leak into logs and span attributes. OpenTelemetry's guidance on handling sensitive data recommends data minimisation and lists Collector processors, including redaction, that remove or change fields.
  • Blind spots after failover. The telemetry pipeline has to work in the recovery environment too, so include it in SaaS disaster recovery planning.

SaaS Observability Acceptance Gate

Accept the setup only when a scripted test proves the path from alert to cause for a single tenant.

  • A synthetic request for a dedicated test tenant is forced to fail in a downstream service, for example through a feature flag.
  • The error-rate alert fires within the window the team has set, for example five minutes (illustrative, not a norm).
  • From the alert, an engineer opens one trace covering the API, the queue hop and the worker.
  • Every span and log record in that trace carries the test tenant ID and a named service.
  • A log search by trace ID returns the error line with the failure reason.
  • Support staff given only the tenant and an approximate time find the same trace.
  • No field on the redaction list appears in captured spans or logs, and the test reruns after each release.

Custom industry business systems that run jobs or stock updates across several services benefit from the same gate, because a silent background failure there means missing operational records.

Related Resources

Answers for Tracing One Tenant's Failed Request

1. What Is SaaS Observability?

SaaS observability is the use of metrics, traces and logs, linked by trace IDs and a tenant attribute, to find out what is broken in a hosted product, which customers it affects and why.

2. Should the Tenant ID Be a Metric Label?

Only with care. Prometheus advises against high-cardinality labels and suggests another approach for any metric whose cardinality is over 100 or could grow that large, so a growing tenant list is better recorded on spans and log records.

3. What Is the Difference Between Head and Tail Sampling?

Head sampling decides at the start of a trace, which is simple but cannot guarantee every error trace is kept. Tail sampling decides after seeing the trace, so it can keep all error traces, but needs a stateful component.

4. How Do Logs Connect to Traces?

OpenTelemetry SDKs can inject the current trace ID and span ID into each log record, so a log search by trace ID returns the lines written while handling that request.

Trace One Tenant's Failure End to End

SaaS observability earns its cost when support can go from one customer's report to the failing log line without guesswork. Name every service, carry trace context through queues, tag spans and logs with the tenant, page on symptoms, keep error traces, and prove it with a synthetic failing request after every release.

Ready to build what is next?

Talk to our Melbourne engineering team about modernising your systems or shipping your next product.