Software Engineering

Observability: Why Logs and Metrics Aren't Enough Anymore

Dashboards and log searches work well when you know which questions to ask. In distributed systems, the hardest incidents are the ones nobody predicted. We explain what observability adds beyond monitoring, why distributed tracing and high-cardinality data matter, and how OpenTelemetry is standardising the instrumentation.

By EthicalHat Research · · 3 min read
Infographic: Monitoring vs observability

For years, running software in production meant three things: metrics on dashboards, logs you could search, and alerts when a threshold was crossed. That works well for a monolith on a handful of servers, where failures tend to look like failures you have seen before.

Distributed systems break that model. A single user request may touch fifteen services, three queues and two databases. Failures are partial and intermittent, and often specific to one customer, one region or one version. The dashboards are green, the logs are enormous, and the user still says "checkout is slow".

This is the gap observability is meant to fill.

Monitoring vs observability

The term comes from control theory: a system is observable if you can work out its internal state from its outputs. Applied to software, the useful distinction is:

  • Monitoring answers questions you knew to ask in advance: Is CPU high? Is the error rate above 1%?
  • Observability lets you ask new questions of your telemetry during an incident, without shipping new code: Which customers are affected? Is it only requests that hit the new cache on version 2.4.1 in eu-west?

You need both. Monitoring tells you something is wrong. Observability helps you find out why, especially when the "why" is something nobody predicted.

Why the "three pillars" are not enough

Observability is often described as logs, metrics and traces. That is a reasonable list of data types, but collecting all three separately does not make a system observable. Common problems include:

  • Metrics lose context. A latency percentile for the whole service cannot tell you which tenant or endpoint is slow. Adding those dimensions to traditional metrics systems quickly becomes expensive ("cardinality explosion").
  • Logs lack structure and correlation. Free-text logs from fifteen services, with no shared request ID, turn investigation into guesswork.
  • Signals are siloed. Jumping between three tools with different query languages, trying to line up timestamps, is slow.

What makes telemetry genuinely useful is rich context attached to every event, and the ability to follow a single request through the system.

Distributed tracing

A trace records the path of one request through the system as a tree of spans. Each span is a unit of work with a start time, duration and attributes.

gantt
  dateFormat X
  axisFormat %L ms
  section checkout-api
  POST /checkout           :0, 480
  section cart-service
  GET /cart                :20, 60
  section pricing-service
  POST /price              :90, 210
  section payments-service
  POST /charge             :230, 450
  section fraud-service
  POST /score (slow)       :250, 440

In a trace like this, the cause of a slow checkout is obvious: the fraud check called by the payments service. Finding the same answer from metrics and logs alone could take an hour.

OpenTelemetry: instrument once

Historically, each observability vendor had its own agents and SDKs, so switching vendors meant re-instrumenting everything. OpenTelemetry, formed in 2019 by merging OpenTracing and OpenCensus, is fixing that. Its tracing specification reached 1.0 in February, it became a CNCF incubating project in August, and metrics support is maturing quickly.

With OpenTelemetry, you instrument your code once and export to any compatible back end:

python
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter

trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
tracer = trace.get_tracer("checkout")

def checkout(cart, user):
    with tracer.start_as_current_span("checkout") as span:
        span.set_attribute("user.tier", user.tier)
        span.set_attribute("tenant.id", user.tenant_id)
        span.set_attribute("cart.items", len(cart.items))
        span.set_attribute("app.version", APP_VERSION)
        return charge(cart, user)

Automatic instrumentation for common frameworks (HTTP servers, database clients and message queues) covers much of the work, and context propagation (for example the W3C traceparent header) links spans across services.

Alert on what users feel: SLOs

More telemetry can mean more alerts and more noise. Service level objectives (SLOs) help focus on what matters:

  • Define a service level indicator (SLI): for example, the percentage of checkout requests that succeed in under 500 ms.
  • Set an objective: 99.5% over 28 days.
  • Alert on error budget burn rate: page someone when the budget is being consumed fast enough to matter, not when a single server has high CPU.

This keeps on-call engineers focused on user impact, and observability tools then help them find the cause.

A practical starting point

  1. Adopt structured logging with a request or trace ID on every line.
  2. Instrument one critical user journey end to end with OpenTelemetry tracing.
  3. Add business context (tenant, plan, version, region) as attributes.
  4. Define two or three SLOs for that journey and alert on burn rate.
  5. Practise: in your next incident review, ask whether telemetry let you answer the questions you needed to, and fix the gaps.

Security benefits

Good observability data is also good security data. Traces show which services talk to which, making unexpected paths visible. Rich request context helps investigate abuse, and consistent logging is the foundation any SOC needs. Just remember that telemetry can contain sensitive data: avoid recording secrets, and treat observability platforms as systems that hold production data.

Our secure SDLC team builds observability into every system we deliver, and our managed security services put the same telemetry to work for detection.

EthicalHat Research

The EthicalHat research team: penetration testers, SOC analysts and engineers writing about security, software engineering and AI.

Want an expert opinion on your own systems?

Email info@ethicalhat.com or call +1-844-838-4422. Our security engineers are happy to talk it through.