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 holmes generate alertmanager-tests command #56

Merged
merged 4 commits into from
Jun 23, 2024

Conversation

aantn
Copy link
Contributor

@aantn aantn commented Jun 22, 2024

and add flags to holmes investigate alertmanager to use that data instead of connecting to a live alertmanager

and add flags to `holmes investigate alertmanager` to use that data instead of connecting to a live alertmanager
holmes.py Outdated Show resolved Hide resolved
@Avi-Robusta
Copy link
Contributor

for tests
poetry run python3 ./holmes.py investigate alertmanager --alertmanager-file ... when no url is specified you will get a pydantic exception

pydantic_core._pydantic_core.ValidationError: 1 validation error for Issue                                                                                                                                                                                                     
source_instance_id                                 

since it uses the url and its none in the alertmanager source
I would change the line in AlertManagerSource for source_instance_id to

        return [
            Issue(
                id=alert.unique_id,
                name=alert.name,
                source_type="prometheus",
                source_instance_id= self.filepath if self.filepath else self.url,

Copy link
Contributor

@Avi-Robusta Avi-Robusta left a comment

Choose a reason for hiding this comment

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

LGTM,
2 changes requested

@aantn
Copy link
Contributor Author

aantn commented Jun 23, 2024

for tests poetry run python3 ./holmes.py investigate alertmanager --alertmanager-file ... when no url is specified you will get a pydantic exception

pydantic_core._pydantic_core.ValidationError: 1 validation error for Issue                                                                                                                                                                                                     
source_instance_id                                 

since it uses the url and its none in the alertmanager source I would change the line in AlertManagerSource for source_instance_id to

        return [
            Issue(
                id=alert.unique_id,
                name=alert.name,
                source_type="prometheus",
                source_instance_id= self.filepath if self.filepath else self.url,

Good catch, will fix.

aantn added a commit that referenced this pull request Jun 23, 2024
Move contents of holmes.py to holmes/main.py. This is necesssary to make
the entrypoint installable.

Note: this includes changes from #56 as well, so will be easier to
review once that is merged. (I didn't base this PR off master as that
would have caused conflicts once #56 is merged as they both touch
holmes.py.)
@Avi-Robusta Avi-Robusta merged commit a96123a into master Jun 23, 2024
9 checks passed
@Avi-Robusta Avi-Robusta deleted the alertmanager-testing branch June 23, 2024 10:06
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.

2 participants