Skip to content

Conversation

@klnyzzz33
Copy link
Contributor

No description provided.

gabortodor and others added 30 commits October 22, 2025 11:13
# Conflicts:
#	flask_monitoringdashboard/core/exceptions/exception_collector.py
#	flask_monitoringdashboard/database/exception_occurrence.py
…-issues

Feature/config for GitHub issues
# Conflicts:
#	flask_monitoringdashboard/core/exceptions/exception_collector.py
Email notification, modifiable notifcation type
Copy link
Member

@mircealungu mircealungu left a comment

Choose a reason for hiding this comment

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

amazing work folks.
a few small points and I look forward to deploying this.


[alerting]
ENABLED=False
TYPE=email
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need the TYPE? We can simply test in the code for the existence of the ENVVARS? Or is there a case where we want to have the TYPE defined independently from the enviers?

Choose a reason for hiding this comment

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

We kept the type property, since we think the config/code is more readable this way. But we can remove it if you want to, it shouldn't really be an issue

Copy link
Member

Choose a reason for hiding this comment

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

Ok. Let's keep it then. But then I have another question: what happens if someone sets TYPE=email but forgets SMTP_HOST? Do we handle this situation?

Choose a reason for hiding this comment

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

Yes, we log that the config is invalid and would turn off the email alerting until SMTP_HOST provided


At the moment the secrets and variables for the issue are saved in a .env file

There is a template with file name `.env_template` that can be used to fill in the info needed for the issue creation alert to work.
Copy link
Member

Choose a reason for hiding this comment

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

I don't see such a file. And also, I see that the file above -- config.cfg -- already definies secrets and variables. So is this still needed?

Choose a reason for hiding this comment

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

No it is not needed and should be deleted. Was a part of previous setup. Now the config.cfg is used

Choose a reason for hiding this comment

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

Yeah, we will delete this README and provide some info in a separate rst doc file

template = template_env.get_template('report.html')


class AlertContent:
Copy link
Member

Choose a reason for hiding this comment

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

A small comment explaining the use of this class would be good

Copy link
Member

Choose a reason for hiding this comment

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

I don't know why but alert. Seems like a strange name for this module. Either alerting or alerts would somehow be more understandable for me.

Choose a reason for hiding this comment

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

Agree

Choose a reason for hiding this comment

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

Will be renamed to alerting


def create_teams_payload(alert_content: AlertContent):
return {
"type": "message",
Copy link
Member

Choose a reason for hiding this comment

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

haha. Why am I not surprised that the Microsoft alternative is the most complicated one?

@@ -0,0 +1,16 @@
class GitHubRequestInfo:
Copy link
Member

Choose a reason for hiding this comment

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

Do you really need this class?

Choose a reason for hiding this comment

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

I guess we could do it without. Is that preferred?

Choose a reason for hiding this comment

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

We will delete it

Copy link
Member

Choose a reason for hiding this comment

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

cool. Tak!

e_copy = _get_copy_of_exception(e)

if config.alert_enabled:
_notify(e_copy, session, config)
Copy link
Member

Choose a reason for hiding this comment

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

Why do I need a copy? Maybe at the comment too? It's not evident

Choose a reason for hiding this comment

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

I'm not sure, we will look into it.

return new_exc


def _notify(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe move to the alerts package?

Choose a reason for hiding this comment

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

Yes, we could do that.

templateUrl: 'static/pages/database_management.html',
controller: ['$scope', '$http', 'menuService', 'endpointService', 'modalService', DatabaseManagementController]
})
.when('/alerting_settings', {
Copy link
Member

Choose a reason for hiding this comment

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

oh. we have also a UI for the alerting settings :) COOL!

Choose a reason for hiding this comment

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

^_^

:return: A JSON-object with alert configuration details
"""
# TODO
# post_to_back_if_telemetry_enabled(**{'name': 'deploy_alert_config'})
Copy link
Member

Choose a reason for hiding this comment

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

what is this for? not for sending telemetry info about the installation is it? because then email is too private to collect it.

Choose a reason for hiding this comment

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

It should be posting back telemetry data about the endpoint being called. It doesn't send any sensitive info, just the name of the endpoint. We think it should be enabled, as it is enabled for every other endpoint. Do you agree with this?

Copy link
Member

Choose a reason for hiding this comment

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

what's this method used for then? Why does it return email info? Is that not going to the telemetry?

Choose a reason for hiding this comment

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

This method provides the information for the alerting settings UI

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.

4 participants