Skip to content

refactor: the app sends traces through the OpenTelemetry Collector - #391

Merged
HardMax71 merged 1 commit into
mainfrom
ci/traces-through-collector
Oct 18, 2026
Merged

HardMax71 merged 1 commit into
mainfrom
ci/traces-through-collector

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Part of #389. Its plan turns spans into metrics with the collector's signaltometrics connector, so every span has to pass through the collector first. Today the SDK exports straight to Jaeger (OTLP_TRACES_ENDPOINT = "http://jaeger:4317"), a carry-over from replacing the Jaeger agent settings in #175.

Changes

config.toml points OTLP_TRACES_ENDPOINT at http://otel-collector:4317. The collector's traces pipeline already ran tail_sampling into Jaeger, but nothing used it, so Jaeger now keeps traces with an error, traces over 1 s and a 10 % sample of the rest, 10 to 20 s after they end. The connector itself comes with the first area PR, since the collector refuses a signaltometrics block with no metric defined. The tracing doc also stops saying FastAPI is instrumented in the lifespan, which #388 changed.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or tooling changes

Test Plan

  • Backend unit tests pass (cd backend && uv run pytest tests/unit)
  • Frontend unit tests pass (cd frontend && npm run test)
  • Backend E2E tests pass (docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')
  • Frontend E2E tests pass (cd frontend && npm run test:e2e)
  • API spec and client regenerated if routes or schemas changed (./deploy.sh openapi, then ./deploy.sh types), never edited by hand
  • Manual testing performed

Validation: the repo's collector config and Jaeger 2.20.0 ran locally, and the OpenTelemetry SDK sent 20 plain spans and 1 error span to the collector. About 26 s later Jaeger had the error trace and 2 of the 20 plain ones. Tests export no traces (config.test.toml leaves the endpoint empty), so CI doesn't cover this path.

Checklist

  • My code follows the project's style guidelines
  • I have run pre-commit run --all-files and all checks pass
  • I have added tests that prove my fix/feature works
  • I have updated documentation if needed
  • My changes don't introduce new warnings

Summary by cubic

Sends traces through the OpenTelemetry Collector instead of exporting them straight to Jaeger, so the collector's signaltometrics connector can turn spans into metrics as planned in #389.

Jaeger now only receives what the collector's existing tail sampling keeps: traces with errors, traces over 1 second, and a 10% random sample, arriving 10 to 20 seconds after they end. The tracing docs also drop the outdated note that FastAPI is instrumented in the lifespan, which #388 already moved into create_app.

Written for commit acdcf96. Summary will update on new commits.

View guided diff Turn on auto-fix

…stead of straight to Jaeger

Every span now reaches the collector, which #389 needs so its connectors can turn spans into metrics before tail sampling drops most of them. Jaeger gets what the collector's existing tail sampling keeps: traces with an error, traces over 1 s and a 10 % sample, 10 to 20 s after they end. The tracing doc also no longer says FastAPI is instrumented in the lifespan, since #388 moved that into create_app.
@HardMax71
HardMax71 enabled auto-merge (squash) October 18, 2026 20:17
@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87bc1142-4664-4bf8-a3ec-ab51224552ab
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area: api FastAPI routes, auth, rate limiting, settings labels Oct 18, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
backend-unit 72.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend 91.69% <ø> (ø)
Frontend 92.60% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HardMax71
HardMax71 merged commit d431e24 into main Oct 18, 2026
20 checks passed
@HardMax71
HardMax71 deleted the ci/traces-through-collector branch October 18, 2026 20:19
@HardMax71 HardMax71 mentioned this pull request Oct 18, 2026
5 of 17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: api FastAPI routes, auth, rate limiting, settings documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants