पाठ 19 / 35
OpenTelemetry: The Big Picture
यह पाठ अभी हिंदी में अनुवादित नहीं है, इसलिए अंग्रेज़ी में दिखाया जा रहा है।
Explain what OpenTelemetry standardises, the roles of API, SDK, instrumentation, OTLP and the Collector.
लेखक: Rahul Agarwal · 15 साल से वेब डेवलपर
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.
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.
त्वरित जाँच: 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
- 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.