Skip to content

Consider improved API ergonomics for enhanced metrics factory integration #1829

@tristanburgess

Description

@tristanburgess

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions