Skip to content
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 query management functionality #1

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open

Add query management functionality #1

wants to merge 45 commits into from

Conversation

Paulchen5
Copy link

Goal

  • Implement Functionality the query all pasts alerts from the prometheus api

How I try to achieve this goal

The code starts 2 queries. Each query ist separated into little query pieces due to a maximum of request data from prometheus api. After that the query results are filtered and then stored into a new created directory. After the query process finished all data are collected into one single file (per query). The collected data are also filtered.

@Paulchen5 Paulchen5 requested a review from viennaa January 28, 2025 10:01
main.py Show resolved Hide resolved
Comment on lines +88 to +91
for query_uuid in query_uuids:
if len(qm.queues[query_uuid].query_objects) == 0:
continue
qm.queues[query_uuid].schedule_queries()

Choose a reason for hiding this comment

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

Can be expressed as list comprehension.

Copy link
Author

Choose a reason for hiding this comment

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

[
    qm.queues[query_uuid].schedule_queries()
    for query_uuid in query_uuids
    if not len(qm.queues[query_uuid].query_objects) == 0
]

Produces the following linting note:

Expression "[qm.queues[query_uuid].schedule_queries() for query_uuid in query_uuids if not len(qm.queues[query_uuid].query_objects) == 0]" is assigned to nothing | Pylint(W0106:expression-not-assigned)

main.py Outdated Show resolved Hide resolved
utilities/data_cleaner.py Show resolved Hide resolved
utilities/data_cleaner.py Outdated Show resolved Hide resolved
utilities/data_cleaner.py Outdated Show resolved Hide resolved
utilities/data_cleaner.py Outdated Show resolved Hide resolved
utilities/data_cleaner.py Outdated Show resolved Hide resolved
utilities/data_filter.py Outdated Show resolved Hide resolved
utilities/semaphore.py Outdated Show resolved Hide resolved
utilities/semaphore.py Outdated Show resolved Hide resolved
utilities/query_management.py Outdated Show resolved Hide resolved
utilities/query_management.py Outdated Show resolved Hide resolved
utilities/query_management.py Outdated Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
main.py Outdated Show resolved Hide resolved
main.py Outdated Show resolved Hide resolved
main.py Outdated Show resolved Hide resolved
main.py Outdated Show resolved Hide resolved
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.

3 participants