

validate insurance claim, calculate premium), record meaningful attributes, log custom events, and build explicit span hierarchies that reflect your domain’s control flow. This requires developer effort and access to the codebase, but it produces the richest, most actionable telemetry.
Another middle-ground option is library-based instrumentation. These are OpenTelemetry instrumentation packages that instrument specific third-party libraries for you (for example, opentelemetry-instrumentation-flask). They provide coverage for library-level interactions without requiring you to manually add spans around those calls.

| Method | Code Changes Required | Typical Coverage | Visibility into Business Logic | Setup Time | Best Use Cases |
|---|---|---|---|---|---|
| Zero-code (Auto) | None (agent-based) | Broad (HTTP, DB, messaging, common frameworks) | Low | Short | Rapid baseline telemetry, initial troubleshooting |
| Library-based | Minimal (add instrumentation packages) | Focused on popular third-party libs | Medium | Short–Medium | When a dependency needs better visibility without full manual spans |
| Manual (Code-based) | Yes (developer effort) | Targeted, depends on implementation | High | Medium–Long | Business-critical flows, async control paths, domain-specific operations |

- Enable zero-code auto-instrumentation first to get immediate, wide coverage and rapid feedback.
- Review traces to identify blind spots (missing business spans, confusing span hierarchies, or async gaps).
- Add targeted manual spans for business-critical logic and complex flows.
- Apply library-based instrumentation for third-party libraries that the agent doesn’t cover or where a library-specific implementation is preferable.

A practical cadence: enable auto-instrumentation, inspect traces to find coverage gaps, then add targeted manual or library-based instrumentation where business value or debugging needs justify the effort.
- OpenTelemetry Instrumentation Overview — language-specific guides, agent docs, and library listings.
- Language docs (examples): Python, Java, .NET.
- Instrumentation libraries (search for packages like
opentelemetry-instrumentation-*) on the OpenTelemetry docs and package registries.
