Currently, ScrapeAwsData in pkg/job/scrape.go uses a runtime type assertion to check if the clients.Factory implements emconfig.RegionalConfigProvider for enhanced metrics support. This works but is not the most ergonomic API surface.
Once enhancedmetrics is moved out of internal, we could consider alternatives such as:
- An options func pattern
- An alternative factory interface
- Detecting the failed type assertion and returning an explicit error in
pkg/exporter.go (around NewScraper)
Ref: #1827 (comment)
Currently,
ScrapeAwsDatainpkg/job/scrape.gouses a runtime type assertion to check if theclients.Factoryimplementsemconfig.RegionalConfigProviderfor enhanced metrics support. This works but is not the most ergonomic API surface.Once
enhancedmetricsis moved out ofinternal, we could consider alternatives such as:pkg/exporter.go(aroundNewScraper)Ref: #1827 (comment)