feat: embedding metrics, Grafana dashboard overhaul & monitoring stack#137
Merged
feat: embedding metrics, Grafana dashboard overhaul & monitoring stack#137
Conversation
Metrics: - InstrumentedEmbedder wrapper: transparent proxy that records embedding latency (histogram) and error count (counter) per provider - Refactored metrics module into sub-modules (http, embedding, worker, security, render, types, middleware) for maintainability - Source detection middleware (api/mcp/sdk/internal) via header inspection Grafana Dashboard: - Complete rebuild: 5 categorized rows (Overview, HTTP Traffic, HTTP Latency, Embedding, Infrastructure) with 37 panels - Split p50/p95/p99 into separate panels for HTTP and Embedding latency - English descriptions on all panels with route reference legends - Added pie charts, entity queue pressure, build info panels Monitoring Stack (opt-in): - Prometheus + Grafana services under 'monitoring' docker-compose profile - Zero impact on normal 'docker compose up' workflow - Entity worker env vars (ENTITY_WORKER_COUNT/POOL_SIZE/QUEUE_SIZE) exposed via docker-compose for tuning Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8f2e1b8 to
1d9e95d
Compare
XuPeng-SH
approved these changes
Mar 25, 2026
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
Adds embedding latency/error observability, completely rebuilds the Grafana dashboard, and provides an opt-in monitoring stack via docker-compose.
Metrics Code
EmbeddingProviderthat records per-provider latency histograms and error countershttp,embedding,worker,security,render,types,middleware)api/mcp/sdk/internalvia header inspectionGrafana Dashboard
Monitoring Stack (opt-in, zero impact on normal workflow)
monitoringdocker-compose profiledocker compose --profile monitoring up -dto enableENTITY_WORKER_COUNT/POOL_SIZE/QUEUE_SIZE) exposed for tuningLoad Test Validation