-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
Support partner events buses #1359
Conversation
+1 |
+1 |
1 similar comment
+1 |
It would be awesome if this is going to be resolved as early as possible. |
There was a problem hiding this 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.
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. |
pkg/config/services.go
Outdated
@@ -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>[^/]+)$"), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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
This PR is expected to make metrics for buses with names containing / character to also be captured by YACE