Skip to main content
One AddOpenTelemetry() block sends logs, metrics, and traces from your .NET application to Bronto. Existing ILogger calls feed the log pipeline, instruments feed the meter provider, and activities feed the tracer provider — all three sharing one resource identity and one OTLP exporter. 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.

Prerequisites

Install dependencies

The two instrumentation packages produce request and HTTP client spans and metrics automatically. See .NET instrumentation libraries for the full list, including Entity Framework Core and gRPC.

Initialise the SDK

Configure all three signals in Program.cs:
Program.cs
UseOtlpExporter enables the exporter for logs, metrics, and traces in one call, appending the signal path (/v1/logs, /v1/metrics, /v1/traces) to the base URL. ConfigureResource applies across all three signals, so service.name and service.namespace are shared automatically. 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.
For console applications and workers, use Host.CreateApplicationBuilder(args) in place of WebApplication.CreateBuilder(args). The AddOpenTelemetry() block is identical.

Instrument your application

ILogger calls need no changes. Add a Meter and an ActivitySource for your own measurements and spans:
The AddSource and AddMeter names in Program.cs must match the ActivitySource and Meter names here, or their telemetry is dropped. Any ILogger call made inside an active Activity automatically carries that span’s trace_id and span_id, so you can jump from a log line to its trace in Bronto with no manual context propagation.

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 OtlpExportProtocol.HttpProtobuf matches the Collector receiver you are pointing at — port 4318 is HTTP, 4317 is gRPC.
  • Check that every ActivitySource and Meter name is registered with AddSource / AddMeter.
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 the base URL at your Bronto region:
Program.cs
and supply your API key through the standard OTLP header variable, which UseOtlpExporter reads:
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. .NET GenAI telemetry is library-specific — each has its own opt-in, and each emits from its own activity source, which you register with AddSource: These APIs are experimental and version-sensitive, so verify the attributes emitted by the version you deploy against each library’s current documentation.

Capture prompts and responses

Content capture is controlled by the .NET library rather than the cross-language OTel variables — OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT, used by the Python, JavaScript, and Java instrumentations, is not a .NET-wide switch. Semantic Kernel uses its own sensitive-diagnostics opt-in:
Microsoft.Extensions.AI uses the EnableSensitiveData option on UseOpenTelemetry() instead. Prompt and response content can contain sensitive data, so enable it deliberately.

Manual spans

Where no instrumentation exists for your provider, set the same attributes yourself:
See the GenAI span conventions for the full attribute list. For the recommended attribute set and Bronto search queries, see LLM Observability.