Skip to content

feat: add a requests / consumers chart based on referer#11

Draft
BatLeDev wants to merge 6 commits into
masterfrom
feat-x-client
Draft

feat: add a requests / consumers chart based on referer#11
BatLeDev wants to merge 6 commits into
masterfrom
feat-x-client

Conversation

@BatLeDev

@BatLeDev BatLeDev commented Jun 25, 2026

Copy link
Copy Markdown
Member

Replace the removed "processings" chart with a "Requêtes / consommateurs" chart, classifying traffic purely from the already-logged referer (no ingress/log_format change — nginx log slot 10 stays unused).

  • daemon computes a new refererCategory (backoffice/embed/app/mcp/other) from the referer's host (compared to the request's own host) and path, stored like refererDomain
  • daily-api-metric/agg-query/agg-result schemas gain the refererCategory field/filter/split option; the generic agg split handles it with no extra service code
  • UI replaces the removed "Requêtes / traitement" chart with "Requêtes / consommateurs" (Back-office, Vues embarquées, Applications, MCP, Autre)

Why: processing traffic is becoming internal and no longer reaches nginx, so the freed slot isn't reused — this ships a simpler, ingress-free classification instead.

Heads-up: a companion change in data-fair/mcp tags our own hosted MCP server's outgoing calls with a /mcp referer so that traffic lands in the mcp bucket; third-party/self-hosted MCP bridges fall back to other, as expected. Adding refererCategory to the mongo unique index is safe against historic documents (a widened key can't collide). Historic documents without refererCategory render as "Aucune" in the UI.

Processing traffic is becoming internal (routed through the private data-fair
url) and will no longer reach nginx, so the processing dimension is removed:

- daemon no longer reads the x-processing slot (no Processing user-class
  suffix, no processing object stored)
- api drops the "processing" split and the processingId filter
- ui drops the "requests by processing" chart and the processing labels

The daily-api-metric schema keeps the processing $def and the userClass enum,
and the mongo unique index keeps processing._id, so previously collected
documents stay valid and readable. The nginx log slot is left in place (the
daemon just ignores it) until the coordinated log_format change that will
repurpose it for the future x-service header.
@BatLeDev BatLeDev closed this Jul 1, 2026
@BatLeDev BatLeDev deleted the feat-x-client branch July 1, 2026 09:47
@BatLeDev BatLeDev restored the feat-x-client branch July 1, 2026 10:03
@BatLeDev BatLeDev reopened this Jul 1, 2026
@BatLeDev BatLeDev changed the title feat: swap the processing dimension for an x-client consumer dimension feat: add a requests / consumers chart based on referer Jul 1, 2026
@github-actions github-actions Bot added feature and removed feature labels Jul 1, 2026
@github-actions github-actions Bot added feature and removed feature labels Jul 1, 2026
BatLeDev added 2 commits July 1, 2026 14:09
…Category "other"

Requests recorded before refererCategory was introduced have no such field;
treat them as 'other' both in the split aggregation and in the filter, instead
of surfacing them as a separate unlabeled bucket.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant