mirror of
https://github.com/gotempsh/temps.git
synced 2026-04-25 06:15:55 +03:00
[PR #22] [MERGED] feat(logs): add structured log aggregator for Docker container observability #23
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/temps#23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
📋 Pull Request Information
Original PR: https://github.com/gotempsh/temps/pull/22
Author: @dviejokfs
Created: 2/26/2026
Status: ✅ Merged
Merged: 2/28/2026
Merged by: @dviejokfs
Base:
main← Head:feat/add-logging📝 Commits (4)
cfb52a8feat(logs): add structured log aggregator with Docker container log collectionfb078e8fix(logs): use i32 project IDs, restore BuildKit build logs, and add log history UIb963847chore: add new configuration for flate2 crate and update .gitignore4eb4006feat(logs): introduce structured log aggregator and frontend log history viewer📊 Changes
57 files changed (+9189 additions, -584 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
Cargo.lock(+70 -496)📝
Cargo.toml(+5 -3)📝
README.md(+1 -0)📝
_typos.toml(+3 -2)📝
crates/temps-auth/src/permissions.rs(+6 -0)📝
crates/temps-cli/Cargo.toml(+1 -0)📝
crates/temps-cli/src/commands/build.rs(+18 -4)📝
crates/temps-cli/src/commands/doctor.rs(+2 -6)📝
crates/temps-cli/src/commands/serve/console.rs(+32 -0)📝
crates/temps-deployer/src/docker.rs(+63 -11)📝
crates/temps-deployer/src/lib.rs(+7 -0)📝
crates/temps-deployments/Cargo.toml(+1 -0)📝
crates/temps-deployments/src/jobs/deploy_image.rs(+21 -0)📝
crates/temps-deployments/src/jobs/pull_external_image.rs(+8 -2)📝
crates/temps-deployments/src/jobs/verify_local_image.rs(+2 -10)📝
crates/temps-deployments/src/utils/docker_inspect.rs(+3 -3)📝
crates/temps-deployments/tests/nodejs_integration_test.rs(+13 -21)📝
crates/temps-entities/src/lib.rs(+4 -0)➕
crates/temps-entities/src/log_chunks.rs(+28 -0)...and 37 more files
📄 Description
Summary
Closes #21
Adds a new
temps-log-aggregatorcrate that provides comprehensive structured log aggregation for Docker containers deployed on the platform.sh.temps.*labels, with reconnect resilience, container-gone detection, and bounded retriesLogsRead/LogsDeletepermission guards on all endpointsChanges
New crate:
temps-log-aggregator(8,200+ lines)parser.rs— Docker JSON log parsing, plain-text level detection, structured field extractionstorage/— Pluggable storage backends (filesystem, S3) with zstd compressionservices/chunk_writer.rs— Per-container buffering with 1MB / 30s flush triggersservices/collector.rs— Docker log streaming with resilience (last_seen_ts tracking, container-gone detection, max consecutive errors)services/metadata.rs— TimescaleDB operations for log_chunks and log_eventsservices/search.rs— Dual-path search routing (index vs archive), field filters, paginationservices/tail.rs— Broadcast-based live tail with filter matchingservices/retention.rs— Chunk cleanup by age with storage deletionhandlers/— HTTP endpoints: POST /logs/search, GET /logs/context, GET /logs/tail (SSE), DELETE /projects/{id}/logsplugin.rs— Platform integration: startup scan, Docker events listener, retention schedulerModified crates
labels: HashMap<String, String>toDeployRequest, applied to container creationsh.temps.project_id,sh.temps.deployment_id,sh.temps.environment_id,sh.temps.service,sh.temps.namespacelabelsLogsDeletepermission to all 5 locations (enum, Display, from_str, all(), Role::permissions)log_chunksandlog_eventsSea-ORM entitiesm20260225_000001_create_log_aggregator_tablesmigrationTEMPS_LOG_STORAGE_BACKENDand S3 config env vars, registers pluginTest Coverage
101 tests (was 89 before this session, +12 new):
No regressions:
temps-auth(102 passed),temps-deployer(39 passed)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.