From e3153822f75ee8e737a492cd9c22fd1ca7911a2a Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Sat, 15 Nov 2025 05:19:35 +0100 Subject: [PATCH] perf: Exclude vector-sync status polling from distributed tracing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skip tracing for /app/vector-sync/status to reduce noise from HTMX polling. Metrics collection continues for this endpoint. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- docker-compose.yml | 3 +- nextcloud_mcp_server/auth/viz_routes.py | 181 ++++++++++++------ .../observability/middleware.py | 8 +- nextcloud_mcp_server/search/algorithms.py | 2 +- nextcloud_mcp_server/search/fuzzy.py | 2 +- nextcloud_mcp_server/search/keyword.py | 2 +- 6 files changed, 136 insertions(+), 62 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 38f72db..66a615c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ services: - ./app-hooks:/docker-entrypoint-hooks.d:ro # Mount OIDC development directory outside /var/www/html to avoid rsync conflicts # The post-installation hook will register /opt/apps as an additional app directory - - ./third_party:/opt/apps:ro + #- ./third_party:/opt/apps:ro environment: - NEXTCLOUD_TRUSTED_DOMAINS=app - NEXTCLOUD_ADMIN_USER=admin @@ -82,6 +82,7 @@ services: - NEXTCLOUD_HOST=http://app:80 - NEXTCLOUD_USERNAME=admin - NEXTCLOUD_PASSWORD=admin + - NEXTCLOUD_PUBLIC_ISSUER_URL=http://localhost:8080 # Vector sync configuration (ADR-007) - VECTOR_SYNC_ENABLED=true diff --git a/nextcloud_mcp_server/auth/viz_routes.py b/nextcloud_mcp_server/auth/viz_routes.py index e7ae535..2292c8e 100644 --- a/nextcloud_mcp_server/auth/viz_routes.py +++ b/nextcloud_mcp_server/auth/viz_routes.py @@ -64,6 +64,13 @@ async def vector_visualization_html(request: Request) -> HTMLResponse: else "unknown" ) + # Get Nextcloud host for generating links to apps + # Use public issuer URL if available (for browser-accessible links), + # otherwise fall back to NEXTCLOUD_HOST + import os + + nextcloud_host = os.getenv("NEXTCLOUD_PUBLIC_ISSUER_URL") or settings.nextcloud_host + html_content = f""" @@ -93,11 +100,15 @@ async def vector_visualization_html(request: Request) -> HTMLResponse: box-shadow: 0 2px 4px rgba(0,0,0,0.1); }} .controls {{ - display: grid; - grid-template-columns: 1fr 1fr; - gap: 20px; margin-bottom: 20px; }} + .control-row {{ + display: grid; + grid-template-columns: 2fr 1fr auto; + gap: 12px; + margin-bottom: 12px; + align-items: end; + }} .control-group {{ margin-bottom: 15px; }} @@ -107,7 +118,7 @@ async def vector_visualization_html(request: Request) -> HTMLResponse: font-weight: 500; color: #333; }} - input[type="text"], select {{ + input[type="text"], input[type="number"], select {{ width: 100%; padding: 8px 12px; border: 1px solid #ddd; @@ -117,6 +128,9 @@ async def vector_visualization_html(request: Request) -> HTMLResponse: input[type="range"] {{ width: 100%; }} + select[multiple] {{ + min-height: 100px; + }} .weight-display {{ display: inline-block; min-width: 40px; @@ -136,6 +150,19 @@ async def vector_visualization_html(request: Request) -> HTMLResponse: .btn:hover {{ background: #0052a3; }} + .btn-secondary {{ + background: #6c757d; + color: white; + border: none; + padding: 6px 12px; + border-radius: 4px; + cursor: pointer; + font-size: 13px; + margin-bottom: 12px; + }} + .btn-secondary:hover {{ + background: #5a6268; + }} #plot {{ width: 100%; height: 600px; @@ -145,11 +172,17 @@ async def vector_visualization_html(request: Request) -> HTMLResponse: padding: 40px; color: #666; }} - .weight-controls {{ - display: none; + .advanced-section {{ + margin-top: 16px; + padding: 16px; + background: #f8f9fa; + border-radius: 4px; + border: 1px solid #dee2e6; }} - .weight-controls.active {{ - display: block; + .advanced-grid {{ + display: grid; + grid-template-columns: 1fr 1fr; + gap: 20px; }} .info-box {{ background: #e3f2fd; @@ -170,15 +203,16 @@ async def vector_visualization_html(request: Request) -> HTMLResponse:
-
-
- - -
+ +
+ + +
-
- - @@ -186,56 +220,71 @@ async def vector_visualization_html(request: Request) -> HTMLResponse:
-
- - - - Hold Ctrl/Cmd to select multiple. Select "All Types" for cross-app search. - +
+
-
- +
+ +
+
+ + +
+

Advanced Options

+ +
+
+ + + + Hold Ctrl/Cmd to select multiple + +
+ +
+
+ + +
+ +
+ + +
+
+
+ + +
+ +
- +
- +
- +
- -
-
- - -
- -
- - -
- -
- -
-
@@ -251,7 +300,9 @@ async def vector_visualization_html(request: Request) -> HTMLResponse:

Search Results ()