2680 bug event rules not turning logs into events #2838
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2838
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2838/head"
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?
Imported from GitHub pull request.
Original GitHub pull request: #2684
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2684
Original created: 2026-02-03T06:45:46Z
Original updated: 2026-02-03T22:47:43Z
Original head: carverauto/serviceradar:2680-bug-event-rules-not-turning-logs-into-events
Original base: staging
Original merged: 2026-02-03T22:47:26Z by @mfreeman451
User description
IMPORTANT: Please sign the Developer Certificate of Origin
Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include
a DCO sign-off statement indicating the DCO acceptance in one commit message. Here
is an example DCO Signed-off-by line in a commit message:
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
PR Type
Bug fix, Enhancement
Description
Add log-promotion consumer to subscribe to processed logs and invoke promotion rules
Create
ocsf_eventshypertable migration with OCSF Event Log Activity schemaImplement log payload parser for normalized log extraction from JetStream subjects
Wire configuration, supervision, and health telemetry for promotion pipeline visibility
Enable log promotion consumer in demo and helm deployments by default
Diagram Walkthrough
File Walkthrough
5 files
New JetStream pull consumer for log promotionNew parser for processed log payload normalizationNew OCSF events hypertable migration with indexesAdd log promotion consumer to supervision treeTrack log promotion consumer health status4 files
Add log promotion consumer configuration and environment variablesAdd log promotion consumer enabled environment variableEnable log promotion consumer by defaultEnable log promotion consumer in demo deployment1 files
Add tests for log promotion parser1 files
Remove ash_authentication from formatter imports5 files
Document log promotion pipeline restoration proposalDocument design decisions and migration planDocument log-to-event promotion requirementsDocument OCSF events canonical table requirementDocument implementation tasks and checklistImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2684#issuecomment-3839395386
Original created: 2026-02-03T06:46:32Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
No security concerns identified
No security vulnerabilities detected by AI analysis. Human verification advised for critical code.🎫 #2680
should be promoted into events).
ingestion to UI query source).
Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status: Passed
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Unbounded retry loop: The consumer creation logic retries indefinitely (with fixed sleep) and the payload parser
silently drops invalid JSON, which can mask real failures and cause noisy/stuck behavior
without actionable error context.
Referred Code
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status:
Potential sensitive logs: Error logs include
inspect(reason)/inspect(error)which may serialize database errors orother data that could include sensitive content depending on upstream failures and log
shipping configuration.
Referred Code
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status:
Unbounded attribute ingest: The parser merges essentially all non-reserved keys from external log payloads into
attributeswithout size/shape limits or sanitization, which could allowoversized/untrusted data to be stored and processed downstream.
Referred Code
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2684#issuecomment-3839402121
Original created: 2026-02-03T06:47:56Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Filter out nil children
After flattening the list of supervisor children, add a step to reject any
nilentries to prevent the application from crashing if a child process is
conditionally disabled.
elixir/serviceradar_core/lib/serviceradar/application.ex [152]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 8
__
Why: This suggestion prevents a potential runtime crash by filtering out
nilvalues from the supervisor's child list, which is a critical fix for application stability.Fix inconsistent metric counter logic
In
handle_message, avoid incrementingprocessed_countwhen thelogslist isempty to ensure the metric consistently counts individual logs rather than
messages.
elixir/serviceradar_core/lib/serviceradar/observability/log_promotion_consumer.ex [79-98]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies an inconsistency in how the
processed_countmetric is updated, which leads to inaccurate metrics if a message contains no logs.Use error codes for robust error handling
In
create_consumer, replace the fragile error string matching for an existingconsumer with a more robust check on the specific NATS API error code (
err_code:10012).elixir/serviceradar_core/lib/serviceradar/observability/log_promotion_consumer.ex [192-220]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that matching on error strings is fragile and proposes a more robust solution by matching on a specific error code, improving maintainability.
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2684#issuecomment-3844079085
Original created: 2026-02-03T22:31:37Z
CI Feedback 🧐
A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
Action: build
Failed stage: Configure SRQL fixture database for tests [❌]
Failed test name: ""
Failure summary:
The action failed during environment/secret validation because the required secret
SRQL_TEST_DATABASE_CA_CERTwas not configured (it is empty in the jobenv).The workflow explicitly
checks for this secret to verify the SRQL test fixture TLS and aborts with:
SRQL_TEST_DATABASE_CA_CERT secret must be configured to verify SRQL fixture TLS., exiting with code1.
Relevant error logs: