# OpenTelemetry: The Big Picture — Logging, Metrics, Tracing & Alerting

Source: https://www.skillbyai.com/en/observability/ob-otel-overview

> Explain what OpenTelemetry standardises, the roles of API, SDK, instrumentation, OTLP and the Collector.

## One standard for all three signals

Before OpenTelemetry (OTel), every vendor shipped its own agent and its own format, so switching backends meant re-instrumenting every service. **OpenTelemetry** is a CNCF project that standardises how telemetry is *produced and transported*, not where it is stored.

Its parts: the **API** is what your code and libraries call (`start a span`, `record a metric`); it does nothing on its own, so libraries can depend on it safely. The **SDK** is the implementation you configure once per application: samplers, processors, exporters, and the **resource** (attributes describing the service, such as `service.name` and `deployment.environment.name`). **Instrumentation libraries** add telemetry to popular frameworks and clients (Flask, Django, Express, gRPC, database drivers) with little or no code. **OTLP** is the wire protocol over gRPC or HTTP. The **Collector** is a separate process that receives, processes and exports telemetry to any backend. **Semantic conventions** define standard attribute names so that `http.response.status_code` means the same thing in every language.

Traces and metrics are mature across major languages; logs support varies, so check your language's status page.

## Where OpenTelemetry sits

Your **application code** calls the OTel **API**, the configured **SDK** batches and exports data over **OTLP** to the **Collector**, which forwards it to one or more **backends** of your choice.

![Five stages in order: application code, the OpenTelemetry API, the SDK with exporters, the OpenTelemetry Collector, and storage backends.](assets/figures/observability/section-7-map.svg) — Figure 7.1: application code -> OTel API -> SDK -> Collector -> backends

## The universal charging port

When every phone had its own charger, changing phones meant a drawer full of cables. A common port lets any charger work with any phone. OpenTelemetry is that common port for telemetry: instrument once with the standard, then plug in whichever backend (open source or commercial) your team chooses.

## Set service.name on day one

Without a `service.name` resource attribute, many backends group your spans under a default such as `unknown_service`, and dashboards from several services blur together. Set it (and `deployment.environment.name`, called `deployment.environment` in older semantic conventions) through `OTEL_SERVICE_NAME` and `OTEL_RESOURCE_ATTRIBUTES` or in code.

**Quiz:** Why can a third-party library depend on the OpenTelemetry API without forcing a backend on its users?

- [ ] The API automatically chooses the cheapest backend
- [ ] The API sends data directly to a fixed vendor
- [ ] The API stores telemetry in local files
- [x] The API is a no-op until the application installs and configures an SDK

*Answer:* The API is a no-op until the application installs and configures an SDK. The API only defines calls. Without an SDK it does nothing, so library authors can instrument their code and the application owner decides where, or whether, data goes.
