Skip to main content
The openinference-instrumentation package provides core utilities for instrumenting Java applications with OpenInference semantic conventions.

Installation

OITracer

The OITracer class is a wrapper around OpenTelemetry’s Tracer that provides convenience methods for creating spans with OpenInference semantic conventions.

Package

com.arize.instrumentation.OITracer

Basic Usage

With TraceConfig

Creating Spans

TraceConfig

The TraceConfig class allows you to configure what data is captured or hidden in traces, useful for privacy and compliance requirements.

Package

com.arize.instrumentation.TraceConfig

Configuration Options

Default Configuration

Example: Privacy-Focused Configuration

Example: Hide Only User Inputs

Manual Instrumentation Example

Here’s a complete example of manually instrumenting an LLM call:

Integration with OpenTelemetry

OITracer works seamlessly with OpenTelemetry’s context propagation:

Dependencies

The base instrumentation package depends on:
  • OpenTelemetry API (1.49.0)
  • OpenTelemetry SDK (1.49.0)
  • OpenTelemetry Instrumentation API
  • OpenInference Semantic Conventions
  • Jackson for JSON handling
  • SLF4J for logging

Next Steps