Commit graph

5 commits

Author SHA1 Message Date
Nathan Hangen
8e2c3dce93 fix(mcp): cache bound config; surface shutdown errors
initMetrics() idempotent re-entry now returns the values bound at first
init rather than re-reading env (which could lie if env mutated between
calls). shutdownMetrics() writes exporter/provider shutdown failures to
stderr instead of swallowing — silent failure during exit hid lost
final-flush data. Adds tests for idempotent re-init and forceEnabled.
2026-05-10 21:33:32 -04:00
Nathan Hangen
9b47ec2dcb chore(mcp): trim metrics comments — keep the why, drop the narration
Comments restated the privacy invariant in four places and narrated what
the next line of code did. Collapse to one canonical site on observe()'s
signature; drop AI-pattern phrasing, #1351 references, and dated bucket
prose. No behavior change; 11 tests still pass.
2026-05-10 21:25:07 -04:00
Nathan Hangen
2d0a4ffef2 feat(mcp): OTel metrics with Prometheus exporter (PoC for #1351)
Adds server-side observability via the OpenTelemetry metrics SDK with a
Prometheus exporter that exposes a /metrics endpoint. Answers the
maintainer's framing: OpenTelemetry format, anonymous, quantized,
Prometheus.

Instruments (meter `gitnexus.mcp`):
  - gitnexus_mcp_tool_requests_total (Counter) — labels: tool, error
  - gitnexus_mcp_tool_request_duration_seconds (Histogram) — labels: tool, error
  - gitnexus_mcp_tool_result_bytes (Histogram) — labels: tool
  - gitnexus_mcp_tool_inflight (UpDownCounter) — labels: tool

Anonymity is type-enforced at the wrap-point: observe() takes a
boolean error detector only, never a message string. Error messages
echo user input (cypher parse errors include the offending clause) and
are recorded as error=true/false labels only. target_info and
otel_scope_info are suppressed on the exporter so the only label keys
that ever appear are { tool, error, le }.

Histogram buckets:
  - Duration:   [0.001, 0.005, 0.025, 0.1, 0.5, 2.5, 10, 30] s
  - Result size: [512, 2048, 8192, 32768, 131072, 524288, 2097152] B

Opt-in via GITNEXUS_OTEL_METRICS=on/true/1. Default off. Binds 127.0.0.1
by default. `gitnexus serve` is the supported scrape target; stdio mode
spawns one process per agent host, so its metrics opt-in is for local
dev only.

Refs #1351.
2026-05-10 20:49:05 -04:00
azizur100389
5497079ab2
fix(search): surface warning when FTS indexes are missing (#1418)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Gitleaks / gitleaks (push) Waiting to run
Release Candidate / Check if release candidate should run (push) Waiting to run
Release Candidate / ci (push) Blocked by required conditions
Release Candidate / Publish release candidate to npm (push) Blocked by required conditions
Release Candidate / Build & Push RC Docker images (push) Blocked by required conditions
Scorecard / Scorecard analysis (push) Waiting to run
Trivy Image Scan / Trivy (gitnexus-cli) (push) Waiting to run
Trivy Image Scan / Trivy (gitnexus-web) (push) Waiting to run
2026-05-08 17:05:18 +01:00
ivkond
00966630c4
feat: cross-repo impact analysis (#794) — @repo MCP routing + group resources (#984) 2026-04-20 11:55:07 +01:00