Skip to content

refactor(logs): make structured severity automatic - #474

Merged
alongubkin merged 1 commit into
mainfrom
alon/alien-546-automatic-log-severity
Aug 22, 2026
Merged

refactor(logs): make structured severity automatic#474
alongubkin merged 1 commit into
mainfrom
alon/alien-546-automatic-log-severity

Conversation

@alongubkin

Copy link
Copy Markdown
Member

Summary

  • normalize supported structured application log levels automatically at stdout/stderr capture boundaries
  • keep system logs and direct OTLP logs unchanged
  • remove the deployment setting from CloudFormation, Helm, runtime environment, and generated core schemas
  • retain the original log body and existing fallback behavior

Validation

  • cargo check for affected runtime/deployment packages
  • 107 CloudFormation generator tests, including rendered template snapshots
  • @alienplatform/core build and 93 tests
  • generated core and Platform OpenAPI artifacts

@alongubkin
alongubkin force-pushed the alon/alien-546-automatic-log-severity branch from 8e349c3 to d747cdd Compare August 22, 2026 07:34
@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR removes the configurable structured-log parsing setting and makes recognized application severity normalization automatic at stdout/stderr capture boundaries while retaining raw log bodies.

  • Removes the log setting from core schemas, deployment environment propagation, CloudFormation, Helm, CLI requests, and generated clients.
  • Makes worker-runtime OTLP capture infer application severity unless a record is marked as a system log.
  • Makes Kubernetes collector ingestion infer structured severity unconditionally, including for non-application containers currently included by the collector.

Confidence Score: 4/5

The PR should not merge until collector severity normalization is restricted to application logs or the collector preserves and checks an equivalent application/system classification.

The worker-runtime path retains an explicit system marker, but the Kubernetes collector now applies application-level parsing to every collected container record despite ingesting system and sidecar logs without such a marker.

Files Needing Attention: crates/alien-operator/src/collector_logs.rs and crates/alien-helm/src/generator.rs

Important Files Changed

Filename Overview
crates/alien-core/src/application_logs.rs Adds a cheap object-shaped input guard while retaining the existing recognized-level parser and conflict behavior.
crates/alien-worker-runtime/src/otlp.rs Removes the parsing flag and automatically normalizes captured application output while preserving stream severity for explicitly marked system records.
crates/alien-operator/src/collector_logs.rs Makes severity parsing unconditional even though this collector ingests logs from all namespace-scoped containers without an application/system distinction.
crates/alien-core/src/stack_settings.rs Removes the obsolete log setting while retaining backward-compatible permissive deserialization of historical unknown fields.
crates/alien-cloudformation/src/generator.rs Removes the obsolete parameter, condition, metadata, and registration setting from generated templates.
crates/alien-helm/src/generator.rs Removes the obsolete operator setting, while the existing broad collector input scope exposes the unconditional normalization issue.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  P[Namespace pod logs] --> C[Fluent Bit collector]
  C --> I[/operator /internal/logs/]
  I --> R[CollectorLogRecord]
  R --> S{Recognized JSON level?}
  S -->|Yes| J[Use structured severity]
  S -->|No| F[Use stdout/stderr fallback]
  J --> O[OTLP storage]
  F --> O
Loading

Fix all with Greploop Fix All in Codex

Prompt To Fix All With AI
### Issue 1
crates/alien-operator/src/collector_logs.rs:326-327
**Collector reclassifies system logs**

When a system or sidecar container emits JSON with a recognized level field, the namespace-wide collector now treats that field as application severity instead of retaining the stdout/stderr fallback, causing incorrect severity-based filtering, alerts, and display.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (2): Last reviewed commit: "refactor(logs): make structured severity..." | Re-trigger Greptile

Comment thread crates/alien-operator/src/collector_logs.rs
@alongubkin
alongubkin force-pushed the alon/alien-546-automatic-log-severity branch from d747cdd to 8ec098c Compare August 22, 2026 15:45
@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown

Too many files changed for review (136 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@alongubkin
alongubkin merged commit 5a14d36 into main Aug 22, 2026
25 checks passed
@alongubkin
alongubkin deleted the alon/alien-546-automatic-log-severity branch August 22, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant