-
Notifications
You must be signed in to change notification settings - Fork 0
Add files for event support to time-in-area project #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add files for event support to time-in-area project #27
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe pull request restructures the alerting pipeline from direct MQTT output to a two-stage, event-driven workflow. It introduces heartbeat-based alarm state monitoring via a new Starlark processor, adds metric duplication to emit both primary and secondary alerting frames, applies namepass filters to existing processors, and routes state changes through an event-producer binary. Changes
Sequence Diagram(s)sequenceDiagram
participant Input as Input Metrics
participant Threshold as Threshold Filter
participant RateLimit as Rate Limiter
participant Overlay as Overlay Transform
participant AlarmState as Alarm State Processor
participant EventOutput as Event Output
participant EventBinary as Event Producer
Input->>Threshold: time_in_area metric
activate Threshold
Threshold->>Threshold: Check threshold
Threshold->>RateLimit: alerting_frame, alerting_frame_two
deactivate Threshold
activate RateLimit
RateLimit->>Overlay: rate_limited_alert_frame
deactivate RateLimit
activate Overlay
Overlay->>AlarmState: overlay transformed metric
deactivate Overlay
activate AlarmState
AlarmState->>AlarmState: Heartbeat-driven state tracking
alt State changed
AlarmState->>EventOutput: alerting_state_change
else No state change
AlarmState->>AlarmState: Suppress metric
end
deactivate AlarmState
activate EventOutput
EventOutput->>EventBinary: JSON via execd
EventBinary->>EventBinary: Process event
deactivate EventOutput
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
Comment |
🎨 Code Formatting RequiredPrettier Formatting IssuesSome files need to be formatted with Prettier (JSON, YAML, Markdown). Files that need prettier formatting:
To fix prettier issues: npx prettier@3.6.0 --write "**/*.{json,yml,yaml,md}" ".github/**/*.{json,yml,yaml,md}" ".*.{yml,yaml,json,md}" --ignore-unknownTrailing Whitespace IssuesSome files have trailing whitespace (spaces/tabs at end of lines). Files with trailing whitespace:
To fix: Remove the trailing spaces/tabs at the end of lines in your favorite editor. After fixing:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
project-time-in-area-analytics/config_output_events.conf (1)
9-10: Clarify the configuration format terminology.The comment states "GKeyFile-formatted input" but the inline configuration uses TOML syntax with
[topics],[settings], and[item.active]sections. Consider updating the comment to "TOML-formatted" or "TOML-style GKeyFile" for clarity, as the syntax shown is more aligned with TOML than traditional GKeyFile format.project-time-in-area-analytics/README.md (1)
136-137: Reminder: Complete the TODO placeholders before merging.Two TODO placeholders need values:
- Minimum Data Agent version:
<TODO: TBD>(line 136)- Required features version note:
<TODO: TBD>(line 137)These should be filled in with the actual minimum version that includes the event handler binary support.
Do you want me to help track down the correct minimum version requirement, or would you like to open an issue to track this task?
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
project-time-in-area-analytics/README.md(6 hunks)project-time-in-area-analytics/config_output_events.conf(1 hunks)project-time-in-area-analytics/config_process_inactivity_monitor.conf(1 hunks)project-time-in-area-analytics/inactivity_monitor.star(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
project-*/**
⚙️ CodeRabbit configuration file
project-*/**: Each example project for the FixedIT Data Agent should be self-contained and designed as a standalone example / tutorial showing how to use the FixedIT Data Agent. The project should be well documented and include all the necessary files to run the example. A reader should be able to understand the background and the purpose of the project, and be able to understand the implementation details and how to use it. If the project includes a dashboard, it should be placed in a new folder in the repo-root/dashboard-deployments/ directory instead of being included in the project folder. In the README for the project, the first time the FixedIT Data Agent is mentioned, we should link to the product page: https://fixedit.ai/products-data-agent/ Emphasize that these solutions are accessible to system integrators and IT professionals without requiring complex C/C++ ACAP development. Highlight that custom edge intelligence can be implemented using familiar IT tools (configuration files, shell scripts, REST APIs) rather than traditional embedded programming approaches. Note that bash does not exist on the Axis devices, so .sh scripts should be written in portable shell syntax.
README Structure: All project README files should follow the standardized template at.project_readme_template.md. This template ensures consistent documentation that serves both audiences: (1) IT professionals who want plug-and-play solutions, and (2) developers who want to customize and extend the examples. The template enforces a logical structure: 1) Introduction and background (project purpose, how it works, why choose this approach) 2) Technical explanation and quick start guide (compatibility, setup, troubleshooting) 3) Developer-oriented notes (local testing, implementation details)
Key README Requirements: - Include compatibility sections for both AXIS OS and FixedIT Data Agent versions - Explain host testing and its limitations and why certain parts require actual Axis d...
Files:
project-time-in-area-analytics/inactivity_monitor.starproject-time-in-area-analytics/config_output_events.confproject-time-in-area-analytics/config_process_inactivity_monitor.confproject-time-in-area-analytics/README.md
**/*
⚙️ CodeRabbit configuration file
This repository serves FixedIT Data Agent users across a spectrum from plug-and-play dashboard deployment to advanced edge device customization. Consider whether changes maintain accessibility for both DevOps professionals (server-side focus) and developers (edge customization focus). If new features are added or existing ones changed significantly, ensure documentation clearly explains the intended audience and usage level. We use prettier for formatting of common file formats like markdown, yaml, json, etc. Example projects should be placed in the repo-root in a directory named project-*/. Whenever referencing Axis device model names like "D4100-VE mk II" or "M3045", prefix it with "AXIS" in capital letters (e.g. "AXIS D4100-VE mk II"). When using Axis as a company name, use "Axis Communications", note that all-caps is only used when "AXIS" is used in their product names, not their company name. When using the name of an Axis product, google on the name to verify that it is correctly identified. Avoid using 'cameras' or 'Axis cameras' unless the solution in related to visual analytics, otherwise prefer using 'Axis devices' to show that the FixedIT Data Agent also works with strobes, speakers, door stations, etc. Images used for the README should be placed in a directory called .images/ in the affected project folder. These images might also be referred to from other sources like the top-level README.md file.
Files:
project-time-in-area-analytics/inactivity_monitor.starproject-time-in-area-analytics/config_output_events.confproject-time-in-area-analytics/config_process_inactivity_monitor.confproject-time-in-area-analytics/README.md
**/*.md
⚙️ CodeRabbit configuration file
**/*.md: Documentation files should clearly communicate the dual audience: (1) server-side dashboard users who want to keep agent with bundled configs, and (2) edge device developers who want to customize agent behavior. Ensure examples and instructions are appropriate for the intended skill level and use case. Since this is a public repository, we should not include any sensitive information, the instructions should be easily understandable for a wide audience, and we should avoid using any jargon or technical terms that are not commonly used.
Headings should not include special characters like emojis or backticks. The table of contents should be generated with themarkdown-toctool, meaning that we should use the<!-- toc -->and<!-- tocstop -->tags.
Files:
project-time-in-area-analytics/README.md
🧠 Learnings (1)
📚 Learning: 2025-10-15T11:36:24.102Z
Learnt from: daniel-falk
Repo: fixedit-ai/fixedit-data-agent-examples PR: 24
File: project-hello-world/README.md:156-179
Timestamp: 2025-10-15T11:36:24.102Z
Learning: The hello-world project (project-hello-world) for the FixedIT Data Agent has no differences between host and device behavior. It works identically on both because it only uses basic echo commands and standard Telegraf features.
Applied to files:
project-time-in-area-analytics/README.md
🔇 Additional comments (7)
project-time-in-area-analytics/config_output_events.conf (1)
13-27: Configuration structure looks good.The inline event configuration is well-structured with clear namespace, topics, and stateful item definition. The boolean
activeitem with defaultfalsealigns with the PR objective of emitting active=1/active=0 events.project-time-in-area-analytics/inactivity_monitor.star (1)
1-7: Clear documentation of the inactivity monitoring purpose.The docstring clearly explains the monitoring logic and use case for detecting when objects leave the monitored area.
project-time-in-area-analytics/config_process_inactivity_monitor.conf (1)
1-6: Heartbeat configuration is correct.The exec input correctly uses portable
sh -csyntax and emits a heartbeat metric every second in influx format.project-time-in-area-analytics/README.md (4)
3-3: Good enhancement to the project description.The updated description clearly explains the new event support functionality, including the emission of active=1 and active=0 events based on detection state.
30-33: Pipeline diagram accurately reflects the new flow.The diagram correctly shows the new inactivity monitoring and event handler steps (E0 and E01) in the pipeline, with proper data flow from
alerting_frame→active_status→ event handler → MQTT output.
153-158: Quick setup instructions updated correctly.The file concatenation command and upload instructions now include the three new files (
config_process_inactivity_monitor.conf,config_output_events.conf, andinactivity_monitor.star), maintaining proper ordering in the pipeline.
638-638: Minor formatting improvement.The added blank line improves readability in the coordinate transformation documentation section.
project-time-in-area-analytics/config_process_inactivity_monitor.conf
Outdated
Show resolved
Hide resolved
0f6a6e9 to
4151b8d
Compare
🎨 Code Formatting RequiredPrettier Formatting IssuesSome files need to be formatted with Prettier (JSON, YAML, Markdown). Files that need prettier formatting:
To fix prettier issues: npx prettier@3.6.0 --write "**/*.{json,yml,yaml,md}" ".github/**/*.{json,yml,yaml,md}" ".*.{yml,yaml,json,md}" --ignore-unknownTrailing Whitespace IssuesSome files have trailing whitespace (spaces/tabs at end of lines). Files with trailing whitespace:
To fix: Remove the trailing spaces/tabs at the end of lines in your favorite editor. After fixing:
|
4151b8d to
dc05bb5
Compare
🎨 Code Formatting RequiredTrailing Whitespace IssuesSome files have trailing whitespace (spaces/tabs at end of lines). Files with trailing whitespace:
To fix: Remove the trailing spaces/tabs at the end of lines in your favorite editor. After fixing:
|
dc05bb5 to
4ff2e04
Compare
daniel-falk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks generally good, but a few things:
project-time-in-area-analytics/config_process_inactivity_monitor.conf
Outdated
Show resolved
Hide resolved
4ff2e04 to
1a0b2eb
Compare
🎨 Code Formatting RequiredPrettier Formatting IssuesSome files need to be formatted with Prettier (JSON, YAML, Markdown). Files that need prettier formatting:
To fix prettier issues: npx prettier@3.6.0 --write "**/*.{json,yml,yaml,md}" ".github/**/*.{json,yml,yaml,md}" ".*.{yml,yaml,json,md}" --ignore-unknownAfter fixing:
|
1a0b2eb to
be8c880
Compare
daniel-falk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good apart from the Starlark script. See comments:
project-time-in-area-analytics/config_process_alarming_state.conf
Outdated
Show resolved
Hide resolved
project-time-in-area-analytics/config_process_alarming_state.conf
Outdated
Show resolved
Hide resolved
be8c880 to
367b692
Compare
🎨 Code Formatting RequiredTrailing Whitespace IssuesSome files have trailing whitespace (spaces/tabs at end of lines). Files with trailing whitespace:
To fix: Remove the trailing spaces/tabs at the end of lines in your favorite editor. After fixing:
|
dc64e55 to
287917c
Compare
This commit adds configuration and helper files for event support in the time-in-area example. These files will monitor AOA detections and send a stateful event when a detection has been in the monitored zone for too long (expressed as active=1), as well as when the detection leaves the monitored area (expressed as active=0).
287917c to
77c6dc0
Compare
|
3ffb092
into
feature/time-in-area-example
| # to two processors | ||
| alerting_metric_two = deepcopy(metric) | ||
| alerting_metric_two.name = "alerting_frame_two" | ||
| return [alerting_metric, alerting_metric_two] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Violates Single Metric Return Convention (Bugbot Rules)
The apply function returns a list of metrics [alerting_metric, alerting_metric_two], but the reviewer explicitly stated this approach is buggy and there's no need to return more than one metric. Telegraf's Starlark processor may not properly handle list returns, and this pattern isn't used anywhere else in the codebase where all processors return either a single metric or None.



This commit adds configuration and helper files for event support in the time-in-area example. These files will monitor AOA detections and send a stateful event when a detection has been in the monitored zone for too long (expressed as active=1), as well as when the detection leaves the monitored area (expressed as active=0).
Summary by CodeRabbit
New Features
Updates
Note
Introduce event-based alerting with stateful active/inactive events, heartbeat-driven inactivity detection, and updated processor wiring/docs.
config_process_alarming_state.confwith 1 Hz heartbeat (alarming_state_heartbeat) and Starlark to emitalerting_state_changeon state transitions usingalerting_frame_two.config_process_threshold_filter.confto emit bothalerting_frameandalerting_frame_twofor downstream processors.namepassfilters inconfig_process_rate_limit.conf(alerting_frame) andconfig_process_overlay_transform.conf(rate_limited_alert_frame).config_output_events.confto sendalerting_state_changevia${EXECUTABLES_DIR}/output_eventwith stateful event config.README.mdflow diagram, compatibility, and setup to include event pipeline (config_process_alarming_state.conf,config_output_events.conf); replace MQTT TODO with event-based alerts.Written by Cursor Bugbot for commit 77c6dc0. This will update automatically on new commits. Configure here.