diff --git a/CLAUDE.md b/CLAUDE.md index c1aa5139..11080ae6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -85,7 +85,8 @@ java -jar cameleer3-server-app/target/cameleer3-server-app-1.0-SNAPSHOT.jar - `EnvironmentAdminController` — CRUD /api/v1/admin/environments, PUT /{id}/jar-retention - `ExecutionController` — GET /api/v1/executions (search + detail) - `SearchController` — POST /api/v1/search, GET /routes, GET /top-errors, GET /punchcard -- `LogQueryController` — GET /api/v1/logs, GET /tail +- `LogQueryController` — GET /api/v1/logs (filters: source, application, agentId, exchangeId, level, logger, q, environment, time range) +- `LogIngestionController` — POST /api/v1/data/logs (accepts `List` JSON array, each entry has `source`: app/agent) - `ChunkIngestionController` — POST /api/v1/ingestion/chunk/{executions|metrics|diagrams} - `UserAdminController` — CRUD /api/v1/admin/users, POST /{id}/roles, POST /{id}/set-password - `RoleAdminController` — CRUD /api/v1/admin/roles diff --git a/HOWTO.md b/HOWTO.md index 5a9af249..fb4641cf 100644 --- a/HOWTO.md +++ b/HOWTO.md @@ -242,19 +242,18 @@ curl -s -X POST http://localhost:8081/api/v1/data/metrics \ -H "Authorization: Bearer $TOKEN" \ -d '[{"agentId":"agent-1","metricName":"cpu","value":42.0,"timestamp":"2026-03-11T00:00:00Z","tags":{}}]' -# Post application log entries (batch) +# Post application log entries (raw JSON array — no wrapper) curl -s -X POST http://localhost:8081/api/v1/data/logs \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ - -d '{ - "entries": [{ - "timestamp": "2026-03-25T10:00:00Z", - "level": "INFO", - "loggerName": "com.acme.MyService", - "message": "Processing order #12345", - "threadName": "main" - }] - }' + -d '[{ + "timestamp": "2026-03-25T10:00:00Z", + "level": "INFO", + "loggerName": "com.acme.MyService", + "message": "Processing order #12345", + "threadName": "main", + "source": "app" + }]' ``` **Note:** The `X-Protocol-Version: 1` header is required on all `/api/v1/data/**` endpoints. Missing or wrong version returns 400. diff --git a/docs/SERVER-CAPABILITIES.md b/docs/SERVER-CAPABILITIES.md index 00afa294..53f501f4 100644 --- a/docs/SERVER-CAPABILITIES.md +++ b/docs/SERVER-CAPABILITIES.md @@ -127,7 +127,7 @@ All ingestion endpoints require JWT with `AGENT` role. | `POST /api/v1/data/executions` | Execution chunks (route + processor traces) | Buffered, flushed periodically | | `POST /api/v1/data/diagrams` | Route graph definitions | Single or array | | `POST /api/v1/data/events` | Agent lifecycle events | Triggers registry state transitions | -| `POST /api/v1/data/logs` | Application log batches | Buffered, 503 if buffer full | +| `POST /api/v1/data/logs` | Log entries (JSON array, `source`: app/agent) | Buffered, 503 if buffer full | | `POST /api/v1/data/metrics` | Metrics snapshots | Buffered, 503 if buffer full | --- @@ -187,7 +187,7 @@ All query endpoints require JWT with `VIEWER` role or higher. | Endpoint | Description | |----------|-------------| -| `GET /api/v1/logs` | Cursor-based log search with level aggregation | +| `GET /api/v1/logs` | Cursor-based log search with level aggregation. Filters: `source` (app/agent), `application`, `agentId`, `exchangeId`, `level`, `logger`, `q` (text), `environment`, time range | ### Diagrams @@ -373,7 +373,7 @@ Used for all observability data. Schema managed by `ClickHouseSchemaInitializer` | `processor_executions` | MergeTree | Per-processor trace data | 365d | | `agent_events` | MergeTree | Agent lifecycle audit trail | 365d | | `route_diagrams` | ReplacingMergeTree | Route graph definitions | - | -| `logs` | MergeTree | Application logs | 365d | +| `logs` | MergeTree | Application + agent logs (`source` column: app/agent, `mdc` Map) | 365d | | `usage_events` | MergeTree | UI action tracking | 90d | | `stats_1m_all` | AggregatingMergeTree | Global 1-minute rollups | - | | `stats_1m_app` | AggregatingMergeTree | Per-application rollups | - |