Prerequisites
- Ruby 3.0 or later
- Bundler
- A running OTel Collector configured to forward logs to Bronto — see Connect Open Telemetry to Bronto
- OpenTelemetry Ruby SDK documentation
Install dependencies
Gemfile
| Gem | Purpose |
|---|---|
opentelemetry-api | Core OTel API |
opentelemetry-sdk | SDK — resource configuration |
opentelemetry-logs-api | Logs API |
opentelemetry-logs-sdk | LoggerProvider, processors |
opentelemetry-exporter-otlp-logs | OTLP/HTTP log exporter |
Configure the log bridge
Set up aLoggerProvider with an OTLP exporter and register it as the global logs provider.
configure_logging.rb
configure_otel_logging once at application startup, before the first log statement.
Configure the OTLP exporter
TheOtlpLogs::LogsExporter in the snippet above connects to the OTel Collector on localhost:4318. If your Collector runs on a different host or port, update the endpoint accordingly.
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 setup above.
Complete example
app.rb
A direct bridge to Ruby’s standard
Logger class is not yet available in the official SDK. The example above emits log records via the OTel Logs API directly. Community bridges for popular frameworks (Rails, Sidekiq) are in development.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. configure_otel_loggingis called before the first log emission.
Traces
Install tracing dependencies
Add the tracing gems to your Gemfile:Gemfile
Configure the tracer provider
Theopentelemetry-sdk gem covers both logs and traces. Configure tracing via OpenTelemetry::SDK.configure:
configure_tracing.rb
Creating spans
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 |

