Cloud teams already stitch requests together with OpenTelemetry (OTel). Db2 for z/OS can join that picture: accept W3C trace context on inbound work, optionally emit span records as extended SMF type 1161, and let the z/OS OpenTelemetry Emitter export them to the same backends as your microservices. This page covers instrumentation, propagation, OTel records, monitoring, and the START / STOP / DISPLAY OTEL commands for DB2.
A user hits a mobile API. The API gateway and Java service create OTel spans and forward traceparent (and optional tracestate) headers. When the service calls Db2—through JDBC, native REST, or another supported attach—Db2 reads that context. For valid sampled traces, Db2 can generate a span for the Db2 unit of work and write it as an extended SMF record. The z/OS Data Gatherer OpenTelemetry Emitter ships those spans through an OTLP collector into your observability backend.
IBM introduced this for Db2 13 (function levels from V13R1M100 upward) via APARs such as PH67971 (distributed tracing support) and related attach APARs (for example IMS). z/OS needs the Data Gatherer emitter support (APAR OA66345 family). Always confirm the PTF list for your release before production enablement.
Db2’s role in the first delivery is primarily inbound: it consumes context other components propagate. Middleware must be OTel-enabled. Db2 alone cannot invent a cloud-side parent span that never existed.
Trace propagation is how context moves. The W3C Trace Context specification defines HTTP headers and equivalent carrier formats. On REST invokes, those headers ride with the JSON body. On JDBC, the driver and application frameworks must forward context into the Db2 conversation. If sampling says “do not record,” Db2 will not invent full emit traffic for unsampled work—watch DISPLAY OTEL counters to see valid versus sampled parents.
| Path | Notes |
|---|---|
| JDBC / DRDA clients | Propagate W3C context through the driver / middleware stack |
| Native REST | HTTP trace headers on service invokes |
| IMS attach | Related APAR support for IMS OpenTelemetry paths into Db2 |
| RRS / type-2 styles | Supported local attach patterns per IBM APAR documentation |
OTel instrumentation on the distributed side usually means auto instrumentation for Java/Node plus explicit context when calling Db2. On z/OS, CICS, IMS, MQ, and z/OS Connect are also adding OTel-aligned tracing so a request can keep its Trace ID from the edge all the way into Db2 SQL.
Practical checklist for a Java → Db2 pilot:
OTel Db2 records are extended SMF type 1161, subtype 1, span records. Db2 emits one span record per unique Db2 unit of work on a thread when the inbound context is valid and sampled and emission is enabled. These are not a replacement for SMF 101/103 accounting—they are correlation-friendly span payloads for OTel pipelines.
Capacity planning still matters. Emitting spans for every tiny UOW on a huge subsystem increases SMF volume. Use sampling on the distributed side and EMIT controls on Db2. Start with a busy-but-bounded application name before enabling everywhere.
| Command | Meaning |
|---|---|
| -START OTEL EMIT(YES) | Start OTel and emit SMF 1161 span records |
| -START OTEL EMIT(NO) | Start OTel processing without emitting spans |
| -STOP OTEL | Stop all Db2 OTel functions |
| -DISPLAY OTEL | Show status and emit counts |
| -DISPLAY OTEL DETAIL | Add trace context counters and timestamps |
Command syntax follows IBM’s Command Reference style:
1234-START OTEL EMIT(YES) -DISPLAY OTEL -DISPLAY OTEL DETAIL -STOP OTEL
-START OTEL starts OpenTelemetry processing so Db2 propagates/handles OTel information. EMIT(YES) (default in the documented form) enables writing extended SMF 1161 subtype 1 span records. EMIT(NO) starts processing without emission—useful when validating context acceptance before you accept SMF growth.
-STOP OTEL stops all Db2 OTel functions: context handling and span emission. If OTel is already started or stopped, Db2 may ignore a redundant command and issue a message such as DSNW303I indicating OTEL already has that status.
-DISPLAY OTEL reports status. Typical fields include STATUS (STARTED), EMIT (YES/NO), RECORDS EMITTED successful and failed counts, and LAST STARTED time. With DETAIL, expect Trace Parent counters (sampling on, valid, invalid) and Trace State counters (valid, truncated, invalid). Rising INVALID counts mean clients are sending broken headers—fix instrumentation before blaming Db2.
12345678910DSNW300I !I9A2 DSNWVCM3 DISPLAY OTEL REPORT FOLLOWS: STATUS = STARTED EMIT = YES RECORDS EMITTED: SUCCESSFUL = 822 FAILED = 0 TRACE PARENT: SAMPLING ON = 903 VALID = 983 INVALID = 0 LAST STARTED 12:20:50 NOV 4, 2025 DISPLAY OTEL REPORT COMPLETE.
In data sharing, repeat START and DISPLAY on each member. There is no group-scope shortcut for these commands in the initial support.
OTel monitoring is mostly DISPLAY OTEL plus emitter/collector health. Watch successful versus failed emits. Failures can mean SMF or emitter issues downstream of Db2. Correlate with distributed backend dashboards: if cloud spans exist but Db2 child spans do not, check EMIT, sampling, and whether the attach path is supported.
Keep classic Db2 monitoring. OTel explains which business trace waited in Db2; accounting classes still explain why (CPU, lock, I/O). Use both.
End-to-end success needs three parties: the application (instrumented), Db2 (START OTEL), and z/OS export (Data Gatherer emitter + collector). z/OS Connect, API gateways, and service meshes should forward trace headers unchanged. Native REST services are a natural fit because HTTP already carries W3C headers alongside JSON.
Security note: trace headers are not authentication. You still need SAF auth on REST or JDBC. Avoid putting secrets in tracestate baggage. Sampling policies belong to the platform team so you do not emit every health-check ping into the SIEM-sized backend.
The current Db2 command reference includes START OTEL, STOP OTEL, and DISPLAY OTEL—treat those pages as the authoritative syntax source when your shop’s maintenance level advances and options expand.
Imagine every online order gets a sticker with a tracking number as it moves from the website to the warehouse to the truck. OpenTelemetry is that sticker system. When the order needs something from Db2, the sticker comes along. Db2 can stamp “I worked on this order” onto a postcard (SMF 1161) and send it to the same tracking board the website uses. START OTEL tells Db2 to watch for stickers; EMIT(YES) tells it to send postcards; DISPLAY OTEL counts how many postcards went out.
1. What does OpenTelemetry support add to Db2 for z/OS?
2. What does -START OTEL EMIT(YES) do?
3. How do you check OTel status on a member?
4. In data sharing, START OTEL must be:
5. Db2 OTel support in the initial delivery focuses on: