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

Scrapers Support Multiple Metrics #5

Merged
merged 4 commits into from Nov 5, 2021

Conversation

jonwinton
Copy link
Collaborator

Description

As discussed in the issue, there is case for a Scraper supporting multiple timeseries from a single scrape function. This PR aims to add that functionality.

The approach taken is to add a map of Metric structs to the Scraper so that each individual timeseries has an alias on the Scraper. This then translates into Scraper Functions returning a map of ScraperResult structs, with each key of the returned map matching the alias of the Metric on the Scraper.

This is a large refactor, and thus changes a lot of things: docs, tests, and each individual scraper. Because of that, the PR includes the following:

  • Update the scraper docs to match the new structure
  • Consolidate scrapers which collect the same type of metric.
    • iam-quota and iam-resource-usage are consolidated
    • vpc-info and subnet-available-ips are consolidated
  • The Collector has to update to know to iterated through the Metrics property on a Scraper
  • The commands to list the scrapers need to update to look into Metrics
  • Metric docs are updated with the new metrics that are now exported

Link To Issue

Closes issue #1

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Because the API is not yet stable, I'm marking this as a new feature.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link
Collaborator

@bakayolo bakayolo left a comment

Choose a reason for hiding this comment

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

LGTM

@jonwinton jonwinton merged commit 8fbcb6b into main Nov 5, 2021
@jonwinton jonwinton deleted the jonwinton/scraper-multi-metrics branch November 5, 2021 18:05
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

3 participants