Prerequisites
- Kotlin 1.8 or later, JVM 8 or later
- Gradle or Maven
- A running OTel Collector configured to forward logs to Bronto — see Connect Open Telemetry to Bronto
- OpenTelemetry Java SDK documentation (the Java SDK is used for Kotlin)
Install dependencies
Configure the log bridge
Add theOpenTelemetryAppender to your logback.xml. Every log record Logback handles will be forwarded to the OTel pipeline.
logback.xml
Configure the OTLP exporter
Create anOpenTelemetrySdk instance and call OpenTelemetryAppender.install() to wire the Logback appender to the SDK.
OtelConfig.kt
configureOtelLogging() once at application startup, before the first log statement.
Set resource attributes
Resource attributes are attached to every log record exported from this process. Two attributes drive how Bronto organises incoming logs:| OTel attribute | Bronto concept | Description |
|---|---|---|
service.name | Dataset | Groups logs from one service |
service.namespace | Collection | Groups related services or a team’s services |
Resource.create() in the SDK configuration above.
Complete example
main.kt
Verify log collection
After running your application, open the Search page in Bronto. Filter by the dataset name you set inservice.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
logspipeline with anotlpreceiver and the Bronto exporter — see Connect Open Telemetry to Bronto. OpenTelemetryAppender.install()is called before the first log statement.BatchLogRecordProcessorexports on a background thread — for short-lived programs, add a shutdown call:loggerProvider.shutdown().
Traces
Configure the tracer provider
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:
OtelConfig.kt
resource ensures service.name and service.namespace are identical on both logs and traces.
Creating spans
trace_id and span_id attached.
Direct export to Bronto
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:| Region | Logs endpoint | Traces endpoint |
|---|---|---|
| EU | https://ingestion.eu.bronto.io/v1/logs | https://ingestion.eu.bronto.io/v1/traces |
| US | https://ingestion.us.bronto.io/v1/logs | https://ingestion.us.bronto.io/v1/traces |

