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

Plat 252 change exporter #2

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

Conversation

ylascauxoc
Copy link

No description provided.

Copy link

@PCovesOC PCovesOC left a comment

Choose a reason for hiding this comment

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

Looks good to me.

As said in the comments, I'd play it safer when dealing with various maps with possibly missing keys.
But the original authors don't bother so 🤷

When it comes to configuration, I can only trust you.
You said it works, I'm ok with this.
We won't add tests here anyway.

main.py Show resolved Hide resolved
boto3==1.28.62
botocore==1.31.65
boto3==1.35.8
botocore==1.35.8
Copy link

Choose a reason for hiding this comment

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

You said you wanted to put this in another PR : why ?
Just to split the chores ? Or does it impact the actual code in any way ?

Copy link
Author

Choose a reason for hiding this comment

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

I don't try this lib with IRSA on AWS.

@@ -62,20 +49,41 @@ def validate_configs(config):
logging.error("All the target AWS accounts should have the same set of keys (labels)!")
sys.exit(1)

for config_metric in config["metrics"]:

if config_metric["group_by"]["enabled"]:
Copy link

Choose a reason for hiding this comment

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

This may fail with a runtime error if keys are missing.

Maybe use config_metric.get("group_by", None) and handle error case ?
Or put the whole block on a try/except and handle the KeyError ?

Copy link

Choose a reason for hiding this comment

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

Also, I see the other authors don't care about this so feel free to ignore me on this.

main.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants