Stage 6 · Operate
OpenTelemetry Pipelines
OpenTelemetry SDKs
Configuring OpenTelemetry SDKs, resources, meters, tracers, loggers, and semantic conventions.
SDK Overview
OpenTelemetry SDKs provide the API and implementation for producing telemetry. Each language has its own SDK package. The SDK configures exporters, processors, samplers, and resources that define your telemetry pipeline.
| Language | SDK Package | Auto-Instrumentation |
|---|---|---|
| Go | go.opentelemetry.io/otel | Manual + contrib |
| Java | io.opentelemetry:opentelemetry-sdk | Java agent |
| Python | opentelemetry-sdk | opentelemetry-instrument |
| Node.js | @opentelemetry/sdk-node | Auto-instrumentation |
Resource Configuration
A Resource describes the entity producing telemetry. It includes service.name, service.version, deployment.environment, and custom attributes. Resources are attached to every signal (traces, metrics, logs) from the service.
from opentelemetry.sdk.resources import Resource, SERVICE_NAME
resource = Resource.create({
SERVICE_NAME: "payment-service",
"service.version": "2.3.1",
"deployment.environment": "production",
"team": "payments",
})Meter Setup
The Meter produces metrics. Configure the Meter with a name (usually service.name), version, and resource. The Meter creates counters, histograms, and gauges that are exported via OTLP.
Tracer Setup
The Tracer produces spans. Configure the Tracer with a name (usually service.name) and version. The Tracer creates spans that represent individual operations within a request trace.
Logger Setup
The Logger produces log records. OTel log support is newer and still evolving. Configure the Logger with the same resource as traces and metrics to enable correlation between signals.
Semantic Conventions
Semantic conventions define standard names for attributes across languages and libraries. Using conventions ensures consistency. HTTP, database, messaging, and RPC all have defined conventions.
HTTP:
http.request.method
http.response.status_code
url.full
server.address
Database:
db.system
db.statement
db.name
Messaging:
messaging.system
messaging.destination.name
messaging.operation.typeEach language SDK includes semantic convention packages. Import semconv instead of hardcoding attribute names. This ensures you use the latest standard names and makes migration easier when conventions change.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.