GitNexus/gitnexus/test
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
..
fixtures fix(csharp): include generic typed properties in context and impact (#1399) 2026-05-09 09:07:24 +01:00
helpers fix(windows): 32767-char tree-sitter crash + VECTOR extension SIGSEGV (#1433) 2026-05-10 16:00:36 +01:00
integration feat: add IncludeExtractor for C++ cross-repo include tracking (group) (#1156) 2026-05-09 09:31:59 +01:00
unit feat(mcp): OTel metrics with Prometheus exporter (PoC for #1351) 2026-05-10 20:49:05 -04:00
utils ci: add macOS to cross-platform test matrix (#208) 2026-03-07 10:38:32 +00:00