Repository navigation
feat: the browser's logs reach Loki over OTel, and the collector decides what to drop - #451
Merged
Merged
Conversation
…des what to drop LogTape's OpenTelemetry sink sends every record from every build to /otlp/v1/logs; nginx rate-limits that path and passes it to a logs-only collector receiver that labels everything service_name=browser. filter/browser drops lines below warning when ENVIRONMENT is production. Window listeners log uncaught errors and unhandled rejections. Nothing goes to the browser console any more.
HardMax71
enabled auto-merge (squash)
October 22, 2026 18:01
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Closes #365 with its last item. The browser logs only to the user's devtools console, so a page breaking for a user leaves nothing in Loki. The Kubernetes events item is dropped: the pod monitor already fails executions on image pull errors and crash loops, and prod's only cluster warning is DNS noise.
Changes
Every build sends every LogTape record over OTel, like the backend: LogTape's own sink feeds an OTel
LoggerProviderthat posts OTLP JSON to/otlp/v1/logs. Nothing goes to the console. nginx takes POST only, 64 KB, 30 a minute per address, and passes it to a logs-only collector receiver that setsservice.name=browser, so a posted record can't pass as another service.filter/browserdrops lines below warning whenENVIRONMENT=production. Window listeners log uncaught errors and unhandled rejections. The Errors dashboard and alert need no change.Note
@logtape/otel 2.4 asks for OTel 0.208, whose
@opentelemetry/corecarries GHSA-8988-4f7v-96qf. The overrides move its SDK and exporters to 0.223 and keepapi-logsat 0.208, since it importsNOOP_LOGGER. Client JS grows 14.5 KB gzip.Type of Change
Test Plan
cd backend && uv run pytest tests/unit)cd frontend && npm run test)docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')cd frontend && npm run test:e2e)./deploy.sh openapi, then./deploy.sh types), never edited by handValidation: throwaway Loki, collector and this branch's image. In Chromium an uncaught error and a rejection land as
service_name="browser"with exception type, message and stack. Of four posted levels, production keeps warning and error, development all four. nginx answers 403 on GET, 413 over 64 KB, 429 after 30. Lint, check, build, Vitest, strict mkdocs andnpm auditpass; Playwright runs in CI.Checklist
pre-commit run --all-filesand all checks passSummary by cubic
The browser now sends all its LogTape records to Loki over OTel, and the collector decides which lines to drop based on environment. Nothing goes to the browser console anymore, finishing the observable errors item from #365 (the Kubernetes events item is dropped as the pod monitor already covers those failures).
Key changes
/otlp/v1/logs; nginx takes POST only, limits to 30 requests per minute per address and 64 KB bodies, and passes to a logs-only collector receiver that labels every recordservice_name=browser.warningwhenENVIRONMENT=production; other environments keep everything.@logtape/oteland the OTel packages are overridden to 0.223 from 0.208 to mitigate GHSA-8988-4f7v-96qf; client JS grows about 14.5 KB gzip.service_name.Written for commit 307bf09. Summary will update on new commits.