Prerequisites
- Node.js 14 or later
- npm or yarn
- A running OTel Collector configured to forward logs and traces to Bronto — see Connect Open Telemetry to Bronto
- OpenTelemetry JavaScript SDK documentation
Install dependencies
| Package | Purpose |
|---|---|
@opentelemetry/sdk-logs | SDK — LoggerProvider, processors |
@opentelemetry/exporter-logs-otlp-http | OTLP/HTTP exporter |
@opentelemetry/resources | Resource builder |
@opentelemetry/semantic-conventions | Standard attribute key constants |
@opentelemetry/winston-transport | Bridges Winston into OTel |
Configure the OTel logger provider
Set up aLoggerProvider with an OTLP exporter. This is the same regardless of which logger you use.
otel-logging.js
Configure the log bridge
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 constructor in the provider setup above.
Complete example
app.js
Verify delivery
After running your application, check both signals in Bronto:- Logs: open the Search page and filter by the dataset name you set in
service.name— your log records should appear within a few seconds. - Traces: open the Explore Traces page and filter by the same
service.name— your spans should appear within a few seconds.
- 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. otel-logging.jsis required before any logger is created — theOpenTelemetryTransportV3picks up the globalLoggerProvideron instantiation.BatchLogRecordProcessorexports on a background timer — for short-lived scripts, callloggerProvider.shutdown()before exit to flush pending records.
Traces
Install tracing dependencies
| Package | Purpose |
|---|---|
@opentelemetry/sdk-trace-node | NodeTracerProvider with automatic context propagation |
@opentelemetry/exporter-trace-otlp-http | OTLP/HTTP span exporter |
Configure the tracer provider
otel-tracing.js
resource object used for logging so both signals share service.name and service.namespace.
Creating spans
trace_id and span_id attached via the OpenTelemetryTransportV3.
Complete example
app.js
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 |

