Skip to content

Troubleshooting

Telemetry fails quietly: no exception when nothing is granted, when a collector refuses the page's origin, or when a backend rejects a key. Belemetry keeps the evidence - in the browser script's counters, in the Bit.Belemetry log category and on the Bit.Belemetry meter. This page is the checklist, in the order worth following, with a live check of the page you are reading.

Check this page

In any app, the first two calls to make in the browser console are BitBelemetry.getContext() - what is granted, and the session - and BitBelemetry.getStats() - what the script dropped and why, and what became of its requests. The button runs both on this page and reads the answer for you.

LivegetContext() and getStats()

The check runs once the page is interactive.

Nothing arrives

  1. Is the script on the page? View the page source. <BelemetryScript /> renders a <script type="application/json" id="bit-belemetry-config"> element and the module after it; in the console, window.BitBelemetry exists. A literal <BelemetryScript> tag in the HTML means _Imports.razor lacks @using Bit.Belemetry - the component compiled as an unknown element, with only a warning.
  2. Has anything been granted? By default nothing is sent until the user consents (Consent.Default = None). Check getContext().consent in the browser, or IBelemetryConsent.Granted in .NET - and that the app shows a banner at all. Records of features not yet decided are held (getStats().pending), not sent.
  3. What did the script drop? getStats().dropped counts every record that never left, by reason (the table below).
  4. Did the backend accept it? getStats().requests.rejected means the backend refused requests for good - a wrong key, a wrong endpoint, a body it cannot read. On .NET each refusal is a warning in the Bit.Belemetry log category, naming the exporter and the URL.
  5. Turn on the diagnostics. options.Debug raises Belemetry's own log messages from Debug to Information, options.Browser.Debug writes the script's to console.debug, and a console exporter prints every record the pipeline hands over.
builder.Services.AddBitBelemetryServices(options =>
{
    if (builder.Environment.IsDevelopment())
    {
        options.Debug = true;              // Belemetry's own messages at Information, in the Bit.Belemetry category
        options.Browser.Debug = true;      // the script's diagnostics in console.debug
        options.AddConsoleExporter();      // every record, printed
    }

    options.Metrics.Meters.Add("Bit.Belemetry");   // what was dropped and exported, as metrics
});

// appsettings.Development.json - make sure the console logger shows the category:
// { "Logging": { "LogLevel": { "Bit.Belemetry": "Information" } } }

What getStats() counts

Counted since the page loaded. The reasons are the same words as the belemetry.reason attribute of the .NET belemetry.records.dropped counter, where both sides drop for the same cause (see .NET instrumentation).

dropped reasonMeansLook at
not_consentedTheir feature was not granted when the user decidedThe consent the app asks for, and Consent.Default
consent_revokedTheir feature was revoked while they were queuedExpected after a revoke
pending_fullMore than Consent.PendingLimit records waited for a decision; the oldest went firstA banner the user never answers
queue_fullMore than Browser.MaxQueueSize records waited for an export; the oldest went firstAn endpoint that does not answer, or a flood of records
error_limitAn identical error within Errors.DuplicateWindow, or over Errors.MaxPerMinuteThe error loop it held back
sampled_outThis session is outside Browser.SessionSampleRatioExpected with a ratio below 1
filteredA processor (BitBelemetry.addProcessor) returned falseYour processors
requests outcomeMeans
deliveredAccepted by the backend
rejectedRefused for good - a wrong key, a wrong endpoint, a body it cannot read
keptNot delivered, and stored for a later retry (needs Persistence)
droppedNeither delivered nor stored: lost

queued is what waits for the next export, and pending what is held until the user decides on consent.

Symptoms

SymptomCauseFix
CORS errors in the browser console The browser posts to the collector from the page's origin, and the collector does not allow it Allow the origin on the receiver (OTLP), give the exporter a CORS-enabled BrowserEndpoint, or switch to the Relay transport
No .NET telemetry from the server The server pipeline is off by default on ASP.NET Core hosts options.Server.CollectDotnetTelemetry = true (Server pipeline)
Nothing reaches the Aspire dashboard The AppHost hands its resources a gRPC endpoint; an exporter with its protocol fixed to HTTP in code posts HTTP to the gRPC port and fails quietly Leave Protocol unset so OTEL_EXPORTER_OTLP_PROTOCOL=grpc applies, or give the AppHost WithOtlpExporter(OtlpProtocol.HttpProtobuf). An unknown protocol value is reported at startup
Logs and traces from WebAssembly, but no metrics System.Diagnostics.Metrics is off in the app (MetricsSupport=false); Belemetry logs a startup warning saying so Remove <MetricsSupport>false</MetricsSupport>, or - when referencing Bit.Belemetry as a project rather than the package - import buildTransitive/Bit.Belemetry.props
No System.Net.Http spans in WebAssembly The WebAssembly SDK turns HttpClient's tracing off; its requests show up as the script's fetch spans instead <HttpActivityPropagationSupport>true</HttpActivityPropagationSupport> - then HttpClient sends traceparent to every origin, which a cross-origin API must allow
Duplicate HTTP spans in WebAssembly A custom handler strips the traceparent .NET added, so the script cannot tell the request was traced Add the URL to Browser.IgnoreUrls
The browser exports without its API key A server never writes an exporter's Headers into the page; a startup warning names the exporter Move a key meant to be public to BrowserHeaders; keep a secret one in a collector, or use Relay
The endpoint's user:password@ never reaches the collector No export sends user info (HttpClient leaves it out, the browser refuses such a URL), and the page never gets it; a server's startup warning names the exporter Put the credential in Headers (an Authorization header); for the browser's exports, a collector in between or Relay
A 400, 401, 403 - or for OTLP a 408 or 500 - is dropped, not retried Only the statuses the backend's protocol calls transient are retried (Offline persistence) Read the warning in the Bit.Belemetry category: it is the backend's final word on the key, the endpoint or the body
Only one of many identical errors arrives By design: Errors.DuplicateWindow and Errors.MaxPerMinute cap error loops (error_limit) Shorten the window or raise the limit; zero switches either off
An attribute reads REDACTED, [email] or [ip] The privacy rules - a credential name, or a pattern in free text Remove the name from Privacy.RedactedAttributes, or turn off Privacy.ScrubPatterns
A long value ends abruptly MaxValueLength (32768 characters) cuts attribute values, bodies and status messages Raise it, or set 0 to keep strings whole
Nothing at all, not even Belemetry's own diagnostics OTEL_SDK_DISABLED=true in the environment turns Belemetry off, whatever the code says Unset the variable on that host
An unhandled error has occurred. Reload 🗙