log crate — no log statement changes needed. Traces are added by configuring a tracer provider alongside the log provider.
Prerequisites
- Rust 1.70 or later
- Cargo
- A running OTel Collector configured to forward logs to Bronto — see Connect Open Telemetry to Bronto
- OpenTelemetry Rust SDK documentation
Install dependencies
Cargo.toml
| Crate | Purpose |
|---|---|
opentelemetry_sdk | SdkLoggerProvider, processors |
opentelemetry-otlp | OTLP/HTTP exporter |
opentelemetry-appender-log | Bridges the log crate into OTel |
log | Standard Rust logging facade |
Configure the log bridge
Set up aSdkLoggerProvider with an OTLP exporter and register the OpenTelemetryLogBridge as the global log logger.
otel_logging.rs
Configure the OTLP exporter
Thewith_endpoint call in the snippet above connects to the OTel Collector on localhost:4318. If your Collector runs on a different host or port, update the URL 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::new in the setup above.
Complete example
main.rs
log::info!(), log::warn!(), and log::error!() calls require no changes.
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_logging()is called before the firstlog::macro.provider.shutdown()is called before process exit to flush buffered records.
Traces
Install tracing dependencies
Add the tracing feature flags to your existing dependencies:Cargo.toml
Configure the tracer provider
otel_tracing.rs
Resource used for logging so both signals share service.name and service.namespace.
Creating spans
Complete example
main.rs
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 |

