Skip to content

Add alerting connector data source #607

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

Merged
merged 24 commits into from
Apr 23, 2024

Conversation

wandergeek
Copy link
Contributor

This PR adds a datasource that allows users to retrieve alerting connectors.

@wandergeek wandergeek self-assigned this Apr 16, 2024
@wandergeek wandergeek requested review from dimuon and tobio April 16, 2024 07:29
Copy link
Member

@tobio tobio left a comment

Choose a reason for hiding this comment

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

Couple of comments, but the main one is the acceptance test.

dimuon
dimuon previously approved these changes Apr 17, 2024
Copy link
Contributor

@dimuon dimuon left a comment

Choose a reason for hiding this comment

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

LGTM.
Covering more connector types in acc tests will be nice.

@wandergeek wandergeek force-pushed the connector-data-source branch from b6f4fe9 to 7c63a69 Compare April 18, 2024 10:19
@wandergeek wandergeek enabled auto-merge (squash) April 18, 2024 10:27
@wandergeek wandergeek requested a review from tobio April 23, 2024 01:20
diag.Errorf("error while creating elasticstack_kibana_action_connector datasource: connector with name [%s/%s] and type [%s] not found", spaceId, connectorName, connectorType)
}

if len(foundConnectors) > 1 {
Copy link
Member

Choose a reason for hiding this comment

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

I do wonder if it would have been better for this DS to output a list of matching connectors TBH.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the use case that I want to use this with, I think this would cause confusion. What I'm trying to facilitate here is the ability to grab a connector by name (eg o11y-alertbot) and use it in an alert without having to create a new connector in the module. If the DS returns >1 connector then its ambiguous what connector is actually being used, particularly if it has been created erroneously.

Copy link
Member

@tobio tobio Apr 23, 2024

Choose a reason for hiding this comment

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

Yea, I understand. You could still achieve that by having a check block do the assertion on a single result, whilst the DS would be more flexible for other consumers.

@wandergeek wandergeek merged commit 5e8af6d into elastic:main Apr 23, 2024
17 checks passed
@wandergeek wandergeek deleted the connector-data-source branch April 23, 2024 02:27
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