Java

Send OpenTelemetry traces, metrics, and logs from any Java server to Sophonz using the official OpenTelemetry Java agent — no Sophonz package required.

There is no @sophonz/java-sdk, and you don't need one. Sophonz's collector speaks standard OTLP, so any Java service can send it traces, metrics, and logs using the official OpenTelemetry Java agent — a JVM agent you attach with a flag, configured entirely through environment variables.

What you get

  • Zero-code instrumentation for 100+ libraries and frameworks — Spring, Servlet containers, JDBC, Kafka, gRPC, common HTTP clients, and Reactor, among others — via the OpenTelemetry Java agent's built-in instrumentation modules.
  • Traces, metrics, and logs exported over OTLP, all driven by the same set of OTEL_* environment variables — no code changes to your application.
  • The official OpenTelemetry API if you want to add custom spans — pull in io.opentelemetry:opentelemetry-api and the agent bridges your manual spans into the same trace.

How it works

  1. Download opentelemetry-javaagent.jar — a single JVM agent published by the OpenTelemetry project.
  2. Attach it to your JVM with -javaagent: (or JAVA_TOOL_OPTIONS).
  3. Point it at Sophonz with environment variables: the collector endpoint, protocol, and your API key.

The agent instruments bytecode at class-load time, so supported frameworks are traced automatically — no manual span creation, no SDK initialization code.

CAUTION — Telemetry without a valid service.key is dropped silently

Sophonz's collector runs in enforce mode: it accepts the OTLP payload over the wire but silently drops anything that doesn't carry a resolvable service.key resource attribute. There's no error in your app and no rejected request — the console will simply stay empty. Double-check OTEL_RESOURCE_ATTRIBUTES (and OTEL_EXPORTER_OTLP_HEADERS) before assuming something else is broken.

TIP — Where to next

Head to Installation for the exact download command, environment variable table, and framework notes.