Send Java logs and traces to Bronto via OpenTelemetry
Instrument a Java application to send logs and traces to Bronto using the OpenTelemetry Java SDK.
This page covers instrumenting a Java application with the OpenTelemetry SDK to send logs and traces to Bronto over OTLP/HTTP via a local OTel Collector. Logs are bridged via the Logback or Log4j2 appender — no log statement changes needed. Traces are added by configuring a tracer provider alongside the log provider.
If you don’t have a Collector and want to export directly from your application to Bronto, see Direct export to Bronto at the bottom of this page.
captureExperimentalAttributes includes thread name and logger name as OTel attributes. captureCodeAttributes includes the source file, class, method, and line number.
Create an OpenTelemetrySdk instance with a SdkLoggerProvider and install it as the global instance. Call OpenTelemetryAppender.install() to wire the Logback appender to the SDK.
After running your application, open the Search page in Bronto. Filter by the dataset name you set in service.name — your log records should appear within a few seconds.If no logs appear, check:
The OTel Collector is running and reachable at the configured endpoint.
The Collector’s pipeline includes a logs pipeline with an otlp receiver and the Bronto exporter — see Connect Open Telemetry to Bronto.
OpenTelemetryAppender.install() is called before the first log statement.
BatchLogRecordProcessor exports on a background thread — for short-lived programs, add a shutdown hook: loggerProvider.shutdown().
The OpenTelemetry Java Agent provides zero-code auto-instrumentation for Spring, Hibernate, gRPC, Kafka, JDBC, and many more frameworks. Download the jar and attach it at startup with -javaagent:opentelemetry-javaagent.jar — no SDK code changes are needed. It is the recommended starting point for most Java applications.
No additional packages are needed — opentelemetry-sdk and opentelemetry-exporter-otlp already include tracing support.Create a SdkTracerProvider and combine it with the SdkLoggerProvider in the same OpenTelemetrySdk builder:
If you are not using an OTel Collector, export directly to Bronto by replacing the exporter configurations with the Bronto OTLP endpoints and your API key: