neiam
/vigil
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
Slice 6: performance
5944a1f · gmorell · 2026-12-02 02:42
Files changed
modified
ROADMAP.md
+12
−1
@@ -349,7 +349,7 @@ The `/api/0` API:
| 349 | 349 | - The release page's "regressed" list is approximate ("earlier issues seen in this release"), since no regression history is kept yet. |
| 350 | 350 | - Tested end to end with the real sentry-cli 2.58.2: releases, deploys, set-commits, and `sourcemaps upload --wait` to a symbolicated event. |
| 351 | 351 | |
| 352 | −### 6. Performance · large | |
| 352 | +### 6. Performance · large · **done** | |
| 353 | 353 | - **Storage:** |
| 354 | 354 | - Elixir sends `transaction` items with `spans[]`; Python 3.x sends `span` v2 items (`is_segment` marks the root). |
| 355 | 355 | - Both normalise into one `spans` table, partitioned daily, with trace id, span id, parent, segment, op, name, status, start, duration and attributes. |
@@ -362,6 +362,17 @@ The `/api/0` API:
| 362 | 362 | - Errors and spans linked through `contexts.trace.trace_id`. |
| 363 | 363 | - **Later:** N+1 query detection (repeated `db` spans under one parent), as GlitchTip's MCP tools offer. |
| 364 | 364 | - **Exit:** a Phoenix app with sentry-elixir tracing shows endpoints and waterfalls. |
| 365 | +- **As built:** | |
| 366 | + - Ingest: | |
| 367 | + - `transaction` items (sentry-elixir: the transaction is the segment, `spans[]` its children) and `span` v2 items (sentry-python 3.0 streams spans only) normalise into `spans`, partitioned daily with 14 days kept. | |
| 368 | + - Each segment upserts its `transaction_groups` row (name, op, method), adding to count, errors, duration total and a histogram bucket in one statement, plus its hour in `transaction_counts`. | |
| 369 | + - Failure follows Sentry: any status but ok, cancelled, unknown or unset. | |
| 370 | + - Counts go in the hour the item arrived, so a skewed SDK clock can't miss a partition. | |
| 371 | + - Errors carry `issue_events.trace_id`, taken from `contexts.trace`, and a trace lists the errors raised in it. | |
| 372 | + - Pages: the project's transactions list (tpm, avg, p50/p95, error rate; sort and search in the URL; live), a transaction's detail (lifetime stats, hourly throughput and duration histogram charts, recent and slowest samples), an org-level trace waterfall (spans from every visible project), and "View trace" on error events. The org dashboard's chart is now the shared `VigilWeb.ChartComponents.bars/1`. | |
| 373 | + - Tested with the real sentry-elixir 14.1 through OpenTelemetry (it turns tracing off without `opentelemetry_exporter` and `opentelemetry_semantic_conventions`) and the real sentry-python 3.0.2 (which also traces its own envelope POSTs as `http.client` spans). | |
| 374 | + - `mix vigil.test ORG PROJECT --kind transaction` sends sample traced requests. | |
| 375 | + - Not done: N+1 detection ("Later"). The trace page queries twice per visit, once for the static render and once on connect. | |
| 365 | 376 | |
| 366 | 377 | ### 7. Cron monitors · medium |
| 367 | 378 | This is new: GlitchTip throws `check_in` items away. |
modified
test/mix/vigil_test_task_test.exs
+4
−1
@@ -35,7 +35,10 @@ defmodule Mix.Tasks.Vigil.TestTaskTest do
| 35 | 35 | assert [%{type: :error, count: 4}, %{count: 1}] = issues(project) |
| 36 | 36 | end |
| 37 | 37 | |
| 38 | − test "--kind transaction sends traced requests to three endpoints", %{org: org, project: project} do | |
| 38 | + test "--kind transaction sends traced requests to three endpoints", %{ | |
| 39 | + org: org, | |
| 40 | + project: project | |
| 41 | + } do | |
| 39 | 42 | out = |
| 40 | 43 | capture_io(fn -> |
| 41 | 44 | Mix.Tasks.Vigil.Test.run([org.slug, "web", "--kind", "transaction", "--count", "6"]) |
Parents: d4408ac