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

Update cloudwatch exporter dependency #839

Merged
merged 31 commits into from
Sep 3, 2024

Conversation

andriikushch
Copy link
Contributor

@andriikushch andriikushch commented May 14, 2024

PR Description

This PR adds a new configuration parameter for the Cloudwatch exporter. It allows to specify the AWS SDK version to use. v1 is the default version.

It was achieved by updating and integrating the version of the github.com/nerdswords/yet-another-cloudwatch-exporter package and all dependencies that it depends on.

According to the https://github.com/nerdswords/yet-another-cloudwatch-exporter/blob/a275f94e5d33b3b5330ecfced86c290e1db05928/pkg/config/feature_flags.go#L10 , using the AWS SDK v2, should improve performance.

After this change, using aliases for the AWS service names will produce warnings.

Which issue(s) this PR fixes

N.A.

A related change in the Agent project:

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@andriikushch andriikushch marked this pull request as ready for review May 16, 2024 14:29
@andriikushch andriikushch added outdated-dependency Related to an outdated dependency. dependencies Pull requests that update a dependency file labels May 16, 2024
@clayton-cornell clayton-cornell requested a review from a team May 16, 2024 22:14
@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label May 16, 2024
@clayton-cornell
Copy link
Contributor

Doc changes look OK.

Should this be backported? Or only in next?

@andriikushch
Copy link
Contributor Author

Doc changes look OK.

Should this be backported? Or only in next?

@clayton-cornell It would be nice to backport it. The same change is in the Agent repository:

@clayton-cornell
Copy link
Contributor

Added backports to Alloy v1.0 and v1.1

There's a parallel Agent PR already in process, so added the label backport-to-agent:no

@kgeckhart kgeckhart requested a review from thepalbi May 22, 2024 17:58
@@ -37,6 +40,7 @@ type Arguments struct {
Discovery []DiscoveryJob `alloy:"discovery,block,optional"`
Static []StaticJob `alloy:"static,block,optional"`
DecoupledScrape DecoupledScrapeConfig `alloy:"decoupled_scraping,block,optional"`
AWSSDKVersion string `alloy:"aws_sdk_version,attr,optional"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Given there's only two options v1 and v2 with v1 being deprecated with an EOL date I think this should really be a boolean to enable or disable sdk v2 vs a string like this. We aren't anticipating the need to support a v3 anytime soon.

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

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -26,6 +28,7 @@ var defaults = Arguments{
Enabled: false,
ScrapeInterval: 5 * time.Minute,
},
AWSSDKVersion: "v2",
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 we should default to v1 for now to prevent breaking anyone on upgrade. We can make v2 the default following YACE changing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's do it 👍

…porter-dependency-

# Conflicts:
#	docs/sources/reference/components/prometheus.exporter.cloudwatch.md
.github/workflows/test.yml Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
sts_region = "us-east-2"

sts_region = "us-east-2"
aws_sdk_version_v2 = "false"
discovery {
type = "sqs"
Copy link
Contributor

Choose a reason for hiding this comment

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

type=sqs is deprecated now - we need to search for all the examples everywhere and remove the usage of aliases

Copy link
Contributor Author

@andriikushch andriikushch Sep 2, 2024

Choose a reason for hiding this comment

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

I will update doc and the tests. 👍

We kept it to test and show the backward compatibility.

A few commits ago, based on the discussion above, we added a compatibility layer to keep support for the aliases.

The idea was to generate warnings but keep the support.

@thampiotr, shall we use this approach or drop the support completely?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm aware that there is compatibility and the old configs will work, my comment was more about using in our examples the official, correct names, not the aliases which are deprecated :)

@thampiotr thampiotr dismissed tpaschalis’s stale review September 3, 2024 14:24

I believe your concerns are addressed now! Please comment if not :)

@thampiotr thampiotr merged commit 08573df into main Sep 3, 2024
18 checks passed
@thampiotr thampiotr deleted the andriikushch/update-cloudwatch-exporter-dependency- branch September 3, 2024 14:53
Copy link
Contributor

github-actions bot commented Sep 3, 2024

The backport to release/v1.0 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-839-to-release/v1.0 origin/release/v1.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 08573dfe866c1ef16f911479f69c3a9e62de4e4b
# Push it to GitHub
git push --set-upstream origin backport-839-to-release/v1.0
git switch main
# Remove the local backport branch
git branch -D backport-839-to-release/v1.0

Then, create a pull request where the base branch is release/v1.0 and the compare/head branch is backport-839-to-release/v1.0.

Copy link
Contributor

github-actions bot commented Sep 3, 2024

The backport to release/v1.1 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-839-to-release/v1.1 origin/release/v1.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 08573dfe866c1ef16f911479f69c3a9e62de4e4b
# Push it to GitHub
git push --set-upstream origin backport-839-to-release/v1.1
git switch main
# Remove the local backport branch
git branch -D backport-839-to-release/v1.1

Then, create a pull request where the base branch is release/v1.1 and the compare/head branch is backport-839-to-release/v1.1.

Copy link
Contributor

github-actions bot commented Sep 3, 2024

The backport to release/v1.2 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-839-to-release/v1.2 origin/release/v1.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 08573dfe866c1ef16f911479f69c3a9e62de4e4b
# Push it to GitHub
git push --set-upstream origin backport-839-to-release/v1.2
git switch main
# Remove the local backport branch
git branch -D backport-839-to-release/v1.2

Then, create a pull request where the base branch is release/v1.2 and the compare/head branch is backport-839-to-release/v1.2.

Copy link
Contributor

github-actions bot commented Sep 3, 2024

The backport to release/v1.3 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-839-to-release/v1.3 origin/release/v1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 08573dfe866c1ef16f911479f69c3a9e62de4e4b
# Push it to GitHub
git push --set-upstream origin backport-839-to-release/v1.3
git switch main
# Remove the local backport branch
git branch -D backport-839-to-release/v1.3

Then, create a pull request where the base branch is release/v1.3 and the compare/head branch is backport-839-to-release/v1.3.

@clayton-cornell
Copy link
Contributor

Removed backport labels.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file frozen-due-to-age outdated-dependency Related to an outdated dependency. type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants