Course contentsShow
← Cloud and Infrastructure
Lesson 2075 of 2,98944. Observability - TracingFree lesson

Instrumentation Types: Automatic vs Manual

Comparing automatic instrumentation with language-specific agents versus manual instrumentation using the OTel API.

Instrumentation Types: Automatic vs Manual

What you'll learn: How automatic and manual instrumentation differ in OpenTelemetry and when to use each approach.

Two Paths to Observability

OpenTelemetry offers two ways to add tracing to your applications: automatic instrumentation using language-specific agents, and manual instrumentation using the OTel API directly.

Automatic Instrumentation

Think of automatic instrumentation like installing cruise control in your car—it handles the common scenarios without you touching the steering wheel. Language-specific agents (like the Java agent or Python auto-instrumentation) inject tracing code into your application at runtime.

Benefits:

  • Zero code changes required
  • Instant visibility into frameworks and libraries (HTTP servers, database clients, message queues)
  • Great for getting started quickly

Limitations:

  • Only instruments known libraries and patterns
  • Limited control over span names and attributes
  • May not capture business-specific context

Manual Instrumentation

Manual instrumentation is like driving with full control—you decide exactly what to trace. You use the OpenTelemetry API to create spans, add attributes, and propagate context explicitly in your code.

Benefits:

  • Fine-grained control over what gets traced
  • Can add business-specific attributes (user IDs, transaction types, custom metrics)
  • Trace internal functions and business logic

Limitations:

  • Requires code changes
  • More development effort
  • Must maintain instrumentation as code evolves

The Hybrid Approach

Most production systems use both: automatic instrumentation for infrastructure-level visibility (HTTP, databases) and manual instrumentation for critical business flows and custom context.

Key Takeaway: Automatic instrumentation gives you quick, broad coverage with language agents; manual instrumentation provides precise, business-aware tracing through the OTel API—use both together for comprehensive observability.