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

Add data source for default scraper configuration #35280

Merged
merged 16 commits into from
Oct 9, 2024

Conversation

bonclay7
Copy link
Contributor

Amazon Managed service for Prometheus proposes a default, AWS-managed scrape configuration for the managed collector. This simplifies even further Prometheus metrics collection for EKS. This PR proposes a data source and documentation updates to use with the scraper.

data "aws_prometheus_scraper_configuration" "this" {}

resource "aws_prometheus_scraper" "this" {
  ...
  scrape_configuration = data.aws_prometheus_scraper_configuration.this.default
}

Relations

Continuation of #34749

Output from Acceptance Testing

% make testacc TESTS=TestAccAMPScraperConfigurationDataSource PKG=amp
==> Checking that code complies with gofmt requirements...
go install
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/amp/... -v -count 1 -parallel 20 -run='TestAccAMPScraperConfigurationDataSource'  -timeout 360m
=== RUN   TestAccAMPScraperConfigurationDataSource_basic
=== PAUSE TestAccAMPScraperConfigurationDataSource_basic
=== CONT  TestAccAMPScraperConfigurationDataSource_basic
--- PASS: TestAccAMPScraperConfigurationDataSource_basic (30.40s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/amp	34.371s
...

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. generators Relates to code generators. service/amp Issues and PRs that pertain to the amp service. labels Jan 12, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 12, 2024
@justinretzolk justinretzolk added new-data-source Introduces a new data source. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 16, 2024
@bonclay7
Copy link
Contributor Author

Any updates on this one @justinretzolk ?

@justinretzolk justinretzolk added the partner Contribution from a partner. label May 16, 2024
bonclay7 and others added 7 commits June 9, 2024 13:14
% make testacc TESTARGS='-run=TestAccAMPScraperConfigurationDataSource_' PKG=amp
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/amp/... -v -count 1 -parallel 20  -run=TestAccAMPScraperConfigurationDataSource_ -timeout 360m
2024/10/09 14:12:44 Initializing Terraform AWS Provider...
=== RUN   TestAccAMPScraperConfigurationDataSource_basic
=== PAUSE TestAccAMPScraperConfigurationDataSource_basic
=== CONT  TestAccAMPScraperConfigurationDataSource_basic
--- PASS: TestAccAMPScraperConfigurationDataSource_basic (8.80s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/amp	13.916s
…aper_configuration'.
@ewbankkit ewbankkit requested a review from a team as a code owner October 9, 2024 18:38
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccAMPDefaultScraperConfigurationDataSource_' PKG=amp
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/amp/... -v -count 1 -parallel 20  -run=TestAccAMPDefaultScraperConfigurationDataSource_ -timeout 360m
2024/10/09 14:32:22 Initializing Terraform AWS Provider...
=== RUN   TestAccAMPDefaultScraperConfigurationDataSource_basic
=== PAUSE TestAccAMPDefaultScraperConfigurationDataSource_basic
=== CONT  TestAccAMPDefaultScraperConfigurationDataSource_basic
--- PASS: TestAccAMPDefaultScraperConfigurationDataSource_basic (8.46s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/amp	13.694s

@ewbankkit
Copy link
Contributor

@bonclay7 Thanks for the contribution 🎉 👏.
I renamed the data source to aws_prometheus_default_scraper_configuration.

@ewbankkit
Copy link
Contributor

% make golangci-lint PKG=amp
make: golangci-lint Checks / 1 of 3...
make: golangci-lint Checks / 2 of 3...
WARN [config_reader] The configuration option `linters.errcheck.ignore` is deprecated, please use `linters.errcheck.exclude-functions`. 
make: golangci-lint Checks / 3 of 3...

@ewbankkit ewbankkit self-assigned this Oct 9, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 9, 2024
@ewbankkit
Copy link
Contributor

@bonclay7 Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 3404798 into hashicorp:main Oct 9, 2024
46 checks passed
@github-actions github-actions bot added this to the v5.71.0 milestone Oct 9, 2024
@bonclay7 bonclay7 deleted the f-prometheus-scraper-config branch October 9, 2024 21:31
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 15, 2024
Copy link

This functionality has been released in v5.72.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. new-data-source Introduces a new data source. partner Contribution from a partner. service/amp Issues and PRs that pertain to the amp service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants