GitNexus/gitnexus/package.json
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

126 lines
3.6 KiB
JSON

{
"name": "gitnexus",
"version": "1.6.4",
"description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
"author": "Abhigyan Patwari",
"license": "PolyForm-Noncommercial-1.0.0",
"homepage": "https://github.com/abhigyanpatwari/GitNexus#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/abhigyanpatwari/GitNexus.git",
"directory": "gitnexus"
},
"bugs": {
"url": "https://github.com/abhigyanpatwari/GitNexus/issues"
},
"keywords": [
"mcp",
"model-context-protocol",
"code-intelligence",
"knowledge-graph",
"cursor",
"claude",
"codex",
"ai-agent",
"gitnexus",
"static-analysis",
"codebase-indexing"
],
"type": "module",
"bin": {
"gitnexus": "dist/cli/index.js"
},
"files": [
"dist",
"hooks",
"scripts",
"skills",
"vendor",
"web"
],
"scripts": {
"build": "node scripts/build.js",
"serve": "tsx src/cli/index.ts serve",
"dev": "tsx watch src/cli/index.ts",
"test": "vitest run",
"test:unit": "vitest run test/unit",
"pretest:integration": "node scripts/build.js",
"test:integration": "vitest run test/integration",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"postinstall": "node scripts/build-tree-sitter-dart.cjs && node scripts/build-tree-sitter-proto.cjs",
"prepare": "node scripts/build.js",
"prepack": "node scripts/build.js"
},
"dependencies": {
"@huggingface/transformers": "^4.1.0",
"@ladybugdb/core": "^0.16.1",
"@modelcontextprotocol/sdk": "^1.0.0",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/exporter-prometheus": "^0.217.0",
"@opentelemetry/resources": "^2.7.1",
"@opentelemetry/sdk-metrics": "^2.7.1",
"@opentelemetry/semantic-conventions": "^1.40.0",
"@scarf/scarf": "^1.4.0",
"cli-progress": "^3.12.0",
"commander": "^14.0.3",
"cors": "^2.8.5",
"express": "^4.19.2",
"express-rate-limit": "^8.4.1",
"glob": "^13.0.6",
"graphology": "^0.26.0",
"graphology-indices": "^0.17.0",
"graphology-utils": "^2.3.0",
"ignore": "^7.0.5",
"js-yaml": "^4.1.1",
"jsonc-parser": "^3.3.1",
"lru-cache": "^11.0.0",
"mnemonist": "^0.40.3",
"onnxruntime-node": "^1.24.0",
"pandemonium": "^2.4.0",
"pino": "^10.3.1",
"pino-pretty": "^13.1.3",
"tree-sitter": "^0.21.1",
"tree-sitter-c": "0.21.4",
"tree-sitter-c-sharp": "0.23.1",
"tree-sitter-cpp": "0.23.2",
"tree-sitter-go": "^0.23.0",
"tree-sitter-java": "^0.23.5",
"tree-sitter-javascript": "^0.23.0",
"tree-sitter-php": "^0.23.0",
"tree-sitter-python": "0.23.4",
"tree-sitter-ruby": "^0.23.1",
"tree-sitter-rust": "0.23.1",
"tree-sitter-typescript": "^0.23.2",
"uuid": "^14.0.0"
},
"optionalDependencies": {
"node-addon-api": "^8.0.0",
"node-gyp-build": "^4.8.0",
"tree-sitter-dart": "file:./vendor/tree-sitter-dart",
"tree-sitter-kotlin": "^0.3.8",
"tree-sitter-proto": "file:./vendor/tree-sitter-proto",
"tree-sitter-swift": "file:./vendor/tree-sitter-swift"
},
"devDependencies": {
"@types/cli-progress": "^3.11.6",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/js-yaml": "^4.0.9",
"@types/node": "^25.6.0",
"@types/uuid": "^11.0.0",
"@vitest/coverage-v8": "^4.0.18",
"gitnexus-shared": "file:../gitnexus-shared",
"tsx": "^4.0.0",
"typescript": "^5.4.5",
"vitest": "^4.0.18"
},
"overrides": {
"@huggingface/transformers": {
"onnxruntime-node": "$onnxruntime-node"
}
},
"engines": {
"node": ">=22.0.0"
}
}