Skip to content

Add monitor variables#76

Merged
GabrielSalla merged 4 commits intomainfrom
add-monitor-variables
May 24, 2025
Merged

Add monitor variables#76
GabrielSalla merged 4 commits intomainfrom
add-monitor-variables

Conversation

@GabrielSalla
Copy link
Owner

No description provided.

@GabrielSalla GabrielSalla force-pushed the add-monitor-variables branch from 4f1094a to 6c86436 Compare May 24, 2025 00:57
@GabrielSalla GabrielSalla force-pushed the add-monitor-variables branch 11 times, most recently from 090f514 to b016824 Compare May 24, 2025 03:31
@GabrielSalla GabrielSalla requested a review from Copilot May 24, 2025 03:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces monitor variable support by adding new functions to set and get monitor-specific variables and updating the monitor configuration with identification attributes. Key changes include:

  • Adding the functions set_variable and get_variable along with comprehensive tests.
  • Updating the monitor configuration (_configure_monitor) to set SENTINELA_MONITOR_ID, SENTINELA_MONITOR_NAME, and SENTINELA_MONITOR_PATH.
  • Adding a migration for the new Variables table and updating documentation to describe the usage of these functions.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/utils/test_stack.py Added tests to validate the get_caller behavior.
tests/sample_monitor_code.py Introduced a new call_function helper for asynchronous execution within monitors.
tests/monitor_utils/test_variables.py Added tests covering various scenarios for setting and retrieving monitor variables.
tests/models/test_variable.py Added tests to verify the Variable model’s set method and timestamp updates.
tests/conftest.py Updated monitor fixture to set new monitor identification attributes.
tests/components/monitors_loader/test_monitors_loader.py Updated tests to reflect changes in monitor configuration parameters.
src/utils/stack.py Added the get_caller function with detailed stack logging.
src/monitor_utils/variables.py Implemented set_variable and get_variable functions that rely on get_caller.
src/components/monitors_loader/monitors_loader.py Modified _configure_monitor to accept and assign monitor identification attributes.
migrations/versions/…_create_variables_table.py Introduced a migration to create the Variables table.
docs/monitor.md Expanded documentation with a new section for monitor variables.

@GabrielSalla GabrielSalla force-pushed the add-monitor-variables branch from b016824 to 154f33c Compare May 24, 2025 03:33
@GabrielSalla GabrielSalla merged commit 6abdfa7 into main May 24, 2025
5 checks passed
@GabrielSalla GabrielSalla deleted the add-monitor-variables branch May 24, 2025 03:36
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

Comments