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

[WIP] Add static labels to the CloudWatch jobs #1974

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

andriikushch
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented Jan 3, 2025

In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically.
To do so, a Grafana Labs employee must trigger the cloud acceptance tests workflow manually.

@andriikushch andriikushch changed the title Add static labels to the CloudWatch jobs [WIP] Add static labels to the CloudWatch jobs Jan 3, 2025
@andriikushch andriikushch marked this pull request as ready for review January 3, 2025 10:52
@andriikushch andriikushch requested review from a team as code owners January 3, 2025 10:52
@@ -82,6 +92,7 @@ resource "grafana_cloud_provider_aws_cloudwatch_scrape_job" "test" {
- `export_tags` (Boolean) When enabled, AWS resource tags are exported as Prometheus labels to metrics formatted as `aws_<service_name>_info`.
- `regions_subset_override` (Set of String) A subset of the regions that are configured in the associated AWS Account resource to apply to this scrape job. If not set or empty, all of the Account resource's regions are scraped.
- `service` (Block List) One or more configuration blocks to configure AWS services for the CloudWatch Scrape Job to scrape. Each block must have a distinct `name` attribute. When accessing this as an attribute reference, it is a list of objects. (see [below for nested schema](#nestedblock--service))
- `static_labels` (Block List) Zero or more configuration blocks to configure static labels to add to all metrics exported by this scrape job. (see [below for nested schema](#nestedblock--static_labels))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the name of the field needs to be static_label to match the TF config, going on what's in the examples. Same for the data source.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tristanburgess, you are right 👍 Nice catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

RegionsSubsetOverrideUsed bool `json:"regionsSubsetOverrideUsed"`
DisabledReason string `json:"disabledReason"`
Provenance string `json:"provenance"`
StaticLabels map[string]string `json:"staticLabels"`
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this should be moved to below the CustomNamespaces field, since it's not a "computed field beyond the original request", but instead is a field that is part of the original request

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.

2 participants