[P1] Log search experience #104
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent Epic
#100
Problem
Logs are the #1 debugging tool for developers. If they have to keep Grafana/Loki open alongside Cameleer for log search, they'll stay there. Currently, logs exist only as a tab on the exchange detail panel and in the Runtime instance view — there's no dedicated, searchable log experience.
Current State
Proposed Solution
1. Dedicated Logs Page
Add a fourth content tab: Exchanges | Dashboard | Runtime | Logs
2. Key Features
Search syntax:
level:ERROR,app:backend-app,route:route3,agent:pod-namelevel:ERROR app:backend-app "timeout"Exchange correlation:
Live tail:
Level filtering:
3. Integration with Sidebar Scope
Architecture Notes
logstable already exists with 10K+ rows/api/v1/logs/searchendpoint with pagination, filtering, and text searchAcceptance Criteria
Competitive Reference
Design Specification
ClickHouse Infrastructure
Existing
logstable has ngram bloom filter indexes onmessageandstack_trace. Key columns:timestamp(DateTime64(3)),application,instance_id,level,logger_name,message,stack_trace,exchange_id,mdc(Map(String,String)).New API:
GET /api/v1/logs/searchqlevelWARN,ERRORapplicationagentIdexchangeIdloggerfrom/tocursorlimitsortascordesc(defaultdesc)Response:
Frontend: Logs Tab (4th tab)
Search Syntax
Free text = substring match on
message. Field prefixes:level:ERROR,app:order-service,logger:OrderProcessor,exchange:ABC-123,mdc.traceId:abc. Multiple terms AND-ed. Autocomplete for field names and app/level values.Log Entry Component
Collapsed: timestamp (HH:mm:ss.SSS) + level badge + app badge + abbreviated logger + thread + message (truncated 200 chars) + [Stack]/[Exchange] chips.
Expanded (click): Full logger, thread, instance, exchange link, stack trace in CodeBlock, MDC map, action buttons [View Exchange] [View Surrounding Logs] [Copy Message].
Live Tail
Polling every 2s (adaptive 1-5s based on volume). Append mode (newest at bottom, auto-scroll). Pause on scroll-up with "47 new entries" indicator. Buffer limit 5K entries. Auto-pause after 5min inactivity. Requires at least one filter active.
Cross-Navigation
[Exchange]chip navigates to/exchanges/{app}/{route}/{exchangeId}. Route resolved frommdc['camel.routeId']or executions table lookup.[View Logs]button on ExchangeHeader navigates to/logs?exchangeId={id}&from={start-5s}&to={end+5s}.Sidebar Integration
/logs/:appId?/:routeId?routes. Sidebar app selection → application filter. Route selection → MDC-based filtering (mdc['camel.routeId']).Performance
Virtual scrolling via
@tanstack/react-virtual. 300ms debounce on text inputs. 10s ClickHouse query timeout. TanStack Query cache: 30s staleTime, 5min gcTime.Implementation Phases
Implemented
Commits:
b73f5e6,4d66d6a,8c7c991,5629770What was delivered
Backend:
GET /api/v1/logswith cursor pagination, multi-level filtering, optional application scoping, level count aggregationexchangeId,instanceId,application,mdcfields to log responsesClickHouseLogStorewith keyset pagination (N+1 pattern),ILIKEfor case-insensitive search across message + stack_trace + logger_nameLogSearchRequest/LogSearchResponsecore domain recordsFrontend:
/logs/:appIdattributeBadgeColorhash)Not included (future)
field:valueparsing and autocomplete