Splunk Observability Cloud

How to implement a custom OpenTelemetry integration for ACU COBOL software?

javier_oshiro
Explorer

Hi, we are trying to implement a custom OpenTelemetry integration for ACU COBOL software.
We want to sent traces and metrics to a Spunk Observability instance and visualize the data on APM.

We already know there is no OpenTelemetry SDK for COBOL, so we are exploring the following options.

Option 1: Manual Instrumentation via C-Interop (Traces & APM)

The most robust approach to populate Splunk APM maps is to leverage ACUCOBOL’s ability to call external C/C++ libraries.
 
  1. Leverage the OpenTelemetry C++ SDK: Build a small, specialized intermediate shared library (.dll or .so) using the OpenTelemetry C++ SDK.
  2. Expose Lifecycle Functions: Create C functions inside your wrapper to initialize a tracer, start a span, add attributes (such as paragraph or program names), and close a span.
  3. Invoke via COBOL CALL: Use standard ACUCOBOL interop verbs or the CALL "C$SYSTEM" interface to call your custom C wrapper at critical entry/exit points of your COBOL programs.
  4. Export Telemetry: The OTel C++ wrapper will stream the generated trace spans directly to your local Splunk OpenTelemetry Collector.

Option 2: Java Wrapper & Acu4GL Interfacing (Traces & Metrics)

If your ACUCOBOL 10.5.1 application relies heavily on modern modernization extensions or database modules, you can route tracking through a Java subsystem:
 
  • Use the Splunk Java OTel Agent: If you wrap or trigger your COBOL logic from a Java application (such as an enterprise web service), you can attach the standard Splunk Java OpenTelemetry agent to that JVM.
  • Database Tracking via Acu4GL: If your COBOL logic interacts with a relational database using Acu4GL, ensure the database driver calls are monitored from the database/Java side. Splunk APM will automatically visualize the database dependencies as separate remote service spans.


For anyone experienced in developing custom OTel integrations:
How would you proceed to get started over those implementations?
Can we contact you to talk about this?

0 Karma

natecrisler
Path Finder

Hey javier — your breakdown is solid, and you've landed on the right primary path. Option 1 (the C++ wrapper) is the one that actually gets you COBOL-level visibility in APM, because it's the only approach that creates spans from inside the ACUCOBOL runtime. Option 2 is real but complementary — the Java agent only sees the JVM boundary, so it captures a Java tier and its DB calls, not what's happening inside your COBOL programs. I'd build Option 1 and treat Option 2 as a bonus if you already have a Java front end.

A few things I'd lock in before writing much code:

  • Export through a local Collector, not straight to Splunk. Point your C++ wrapper's OTLP exporter at a local Splunk OTel Collector (OTLP gRPC 4317 / HTTP 4318) and let the Collector hold the access token, batch, add resource attributes, and forward to APM. That's exactly your step 4, and it keeps secrets and retry logic off your COBOL hosts. You can bypass the collector and hit the ingest endpoint directly if you must, but I wouldn't for a first build.
  • service.name is everything in APM. Whatever you set as the service.name resource attribute becomes the box on the APM service map, so set it deliberately (one service per COBOL app is a sane start), and add deployment.environment so you can filter prod vs test.
  • Model spans to your code. Program = span, paragraph/section = child span or span event, transaction/batch id as attributes. Set span status to error on abends so failures surface. If this COBOL is called by or calls other instrumented services, propagate W3C traceparent so the spans stitch into the same distributed trace instead of standing alone.

One correction on the interop: CALL "C$SYSTEM" runs an OS command — it's not the hook for invoking your wrapper. What you want is ACUCOBOL-GT's C subroutine interface: expose your functions with a C ABI (extern "C" so the names aren't C++-mangled), make them callable from the runtime, then CALL "start_span" etc. from COBOL. The "Interoperating with C" section of the AcuCOBOL-GT (OpenText/Micro Focus) docs covers the linkage and parameter passing.

The gotcha that bites people: the batch span processor buffers, so on a short-lived batch run you'll lose spans unless you explicitly flush/shut down the tracer provider at program exit. Init the provider once per runtime process and shut it down cleanly on the way out. And don't span every paragraph if volume is high — instrument at meaningful boundaries (program entry/exit, transactions, DB calls) or you'll drown in overhead and cardinality.

How I'd actually get started, smallest provable steps first:

  1. Stand up the Splunk OTel Collector locally with OTLP receivers and confirm it forwards to your APM (send a throwaway test span with otel-cli first).
  2. Build a minimal extern "C" wrapper over the C++ SDK: init plus one start_span/end_span, service.name set, exporter pointed at the local collector. Prove a single hand-made span lands in APM.
  3. Wire the CALL interop from a tiny COBOL test program, one span per run. Confirm the service shows on the map.
  4. Expand: attributes, child spans, error status, then traceparent propagation if you're multi-service.
  5. Add metrics last. Traces are the APM payoff; the C++ metrics SDK works, but get tracing solid first, and you can always push metrics over OTLP to the same collector.

On Option 2: if any COBOL is already fronted by Java (web services, Acu4GL through a JVM), attaching the Splunk Java agent there is basically free APM for that tier and its JDBC calls. Just note APM only sees the DB dependency if the driver runs inside that instrumented JVM — if Acu4GL talks to the database natively from the COBOL runtime, the Java agent won't see it, so that visibility still has to come from your Option 1 spans.

Happy to keep going on the thread — better to keep it public so it helps the next person who tries this. For real-time back-and-forth there's the Splunk community #observability Slack, and for a production COBOL rollout it's worth looping in Splunk PS or a partner SE.

Docs:

What does the COBOL runtime look like — standalone batch, or fronted by a service tier? That changes whether you need traceparent propagation from day one.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Quantify Your Splunk Investment Impact: Introducing Savings Metrics to Value Insights

Building on the foundation established in our initial Value Insights releases, we are introducing the Savings ...

Event Series: Telemetry Pipeline Management

Balancing Scale and Spend: Gaining Control Over High-Volume Metrics in Splunk Observability Cloud As ...

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...