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

Support partner events buses #1359

Conversation

HristoStoyanovYotpo
Copy link
Contributor

AWS/Events partner buses are currently not fetched by YACE, because their names contain / character.
This is written here on the EventBus Name property: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html

Name
The name of the new event bus.

Custom event bus names can't contain the / character, but you can use the / character in partner event bus names. In addition, for partner event buses, the name must exactly match the name of the partner event source that this event bus is matched to.

This PR is expected to make metrics for buses with names containing / character to also be captured by YACE

@T0tt1
Copy link

T0tt1 commented Apr 3, 2024

+1
This bites me. If we can have it resolved at the earliest convenience will be great.

@PavelDamyanov
Copy link

+1

1 similar comment
@vbabitskiy
Copy link

+1

@teo9806
Copy link

teo9806 commented Apr 4, 2024

It would be awesome if this is going to be resolved as early as possible.

Copy link
Collaborator

@cristiangreco cristiangreco left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Would you mind adding a test like https://github.com/nerdswords/yet-another-cloudwatch-exporter/blob/18356f659ab27c10556abae1f00f8003904770ca/pkg/job/maxdimassociator/associator_mq_test.go (or any other similar test in that folder)? It would allow to check how the regex matches resource ARNs.

@HristoStoyanovYotpo
Copy link
Contributor Author

Thanks for the contribution!

Would you mind adding a test like https://github.com/nerdswords/yet-another-cloudwatch-exporter/blob/18356f659ab27c10556abae1f00f8003904770ca/pkg/job/maxdimassociator/associator_mq_test.go (or any other similar test in that folder)? It would allow to check how the regex matches resource ARNs.

Thank you sir! There was actually existing test that was failing, I decided to just updated the regex so that it works for both regular and partner event buses. I would expect everything to be alright now.

@@ -915,7 +915,7 @@ var SupportedServices = serviceConfigs{
aws.String("events"),
},
DimensionRegexps: []*regexp.Regexp{
regexp.MustCompile(":rule/(?P<EventBusName>[^/]+)/(?P<RuleName>[^/]+)$"),
regexp.MustCompile(":rule/(?P<EventBusName>.+)/(?P<RuleName>[^/]+)$"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering whether we need a separate regex for partner events instead, like e.g.

		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":rule/(?P<EventBusName>[^/]+)/(?P<RuleName>[^/]+)$"),
			regexp.MustCompile(":rule/aws.partner/(?P<EventBusName>.+)/(?P<RuleName>[^/]+)$"),
		},

Can you check if this works for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @cristiangreco, according to the docs it seems like partner busses are always prepended with aws.partner: https://docs.aws.amazon.com/eventbridge/latest/onboarding/amazon_eventbridge_partner_onboarding_guide.html#AWS_EventBridge_Partner_Onboarding_Names
I'll update the PR as suggested.

@cristiangreco cristiangreco merged commit d3c2e91 into nerdswords:master Apr 15, 2024
3 checks passed
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.

None yet

6 participants