Skip to main content
One setup function sends logs, metrics, and traces from your Rust application to Bronto. Logs are bridged from the log crate, metrics flow through a meter provider, and traces through a tracer provider — all three sharing one Resource. The application exports to an OpenTelemetry Collector, which forwards to Bronto. If you don’t run a Collector, export directly to Bronto instead — only the endpoint and an API key header change.
The OpenTelemetry Rust SDK is still evolving and its builder APIs have changed between releases. Pin your versions and check the OpenTelemetry Rust documentation for the release you deploy.

Prerequisites

Install dependencies

Cargo.toml

Initialise the SDK

otel.rs
Two resource attributes determine how Bronto organises your data:
http://localhost:4318 is the standard OTLP/HTTP address for a Collector on the same host. Use the address reachable from your application if the Collector runs in another container, pod, or host. No authentication is needed between the application and the Collector — the Collector holds the Bronto API key.

Instrument your application

Existing log::info!, log::warn!, and log::error! calls need no changes:
main.rs
Middleware instrumentation for Actix Web, Axum, and Tonic is available through community crates — see the OpenTelemetry Rust registry.

Verify

Run your application, then check each signal in Bronto, filtering by the service.name you set:
  • Logs — the Search page, in the dataset named after your service
  • Metrics — the Metric Explorer
  • Traces — the Explore Traces page
If nothing arrives:
  • Confirm the Collector is running and reachable at the configured endpoint, and that its pipelines include an otlp receiver and the Bronto exporters.
  • Confirm configure_otel() runs before the first log:: macro or span.
  • The batch exporters run on background tasks — keep the shutdown() call so short-lived programs flush before exit.
For signal-specific reference material, see Send Metrics to Bronto and Send Traces to Bronto.

Direct export to Bronto

Without a Collector, the application exports straight to Bronto over OTLP/HTTP. Point OTLP_ENDPOINT at your Bronto region and add your API key to each exporter:
Apply the same .with_headers(...) call to the metric and span exporters. See API Keys for how to create a key with ingestion permissions.
Prefer the Collector for multi-service environments — it batches, filters, and enriches telemetry, and keeps the API key out of every application. Direct export suits single services and simple architectures.

GenAI semantic conventions

If your application calls an LLM, OpenTelemetry’s GenAI semantic conventions define gen_ai.* span attributes for model, token usage, and prompt and response content.

Manual spans

There is no first-party GenAI instrumentation for Rust, so set the attributes yourself around each model call:
Message content (gen_ai.input.messages / gen_ai.output.messages) is opt-in by convention and off by default in the languages that have auto-instrumentation. Since you are setting attributes by hand, apply the same discipline — gate prompt and response content behind your own config flag rather than always sending it. See the GenAI span conventions for the full attribute list. For the recommended attribute set and Bronto search queries, see LLM Observability.