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 __meta_ec2_region and __meta_lightsail_region SD meta labels #11326

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

candlerb
Copy link
Contributor

Fixes #11320


@juliusv:
I don't know whether model.LabelValue with an empty string is valid. However, as far as I can see, d.cfg.Region can never be empty string anyway (if it were, the AWS API client would return an error). Hence I haven't checked for this condition.

I have tested this with EC2 only. I don't use Lightsail, but I've made the corresponding change for that too for consistency.

I have not put anything in CHANGELOG, I don't know which branch this will end up being applied to.

Fixes prometheus#11320

Signed-off-by: Brian Candler <b.candler@pobox.com>
@juliusv juliusv changed the title Add __meta_ec2_region label Add __meta_ec2_region and __meta_lightsail_region SD meta labels Sep 19, 2022
@juliusv
Copy link
Member

juliusv commented Sep 19, 2022

Ah great, thanks for including Lightsail as well. Yes, I think d.cfg.Region should always be set, and even if it wasn't, labels with empty values are discarded upon ingestion, so it shouldn't hurt much if we are wrong about that.

main is the right branch 👍

@juliusv juliusv merged commit 4a493db into prometheus:main Sep 19, 2022
@juliusv
Copy link
Member

juliusv commented Sep 19, 2022

(oh and I allowed myself to change the title of the PR to include the other label as well, so that whoever writes the changelog entries for the next release doesn't miss Lightsail)

@candlerb
Copy link
Contributor Author

BTW I didn't know where else to report this, but these two lines are crossed-over in the release notes for Pre-release v2.39.0-rc.0 - 2.39.0-rc.0 / 2022-09-27:

[ENHANCEMENT] AWS Lightsail SD: Add __meta_ec2_region label. #11326
[ENHANCEMENT] AWS EC2 SD: Add ____meta_lightsail_region label. #11326

It should say:

[ENHANCEMENT] AWS EC2 SD: Add __meta_ec2_region label. #11326
[ENHANCEMENT] AWS Lightsail SD: Add ____meta_lightsail_region label. #11326

valyala added a commit to VictoriaMetrics/VictoriaMetrics that referenced this pull request Sep 30, 2022
valyala added a commit to VictoriaMetrics/VictoriaMetrics that referenced this pull request Sep 30, 2022
@juliusv
Copy link
Member

juliusv commented Sep 30, 2022

@candlerb Ah thanks for flagging that! That was done in #11344. I sent a PR to fix it in #11377.

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.

ec2_sd_configs: make 'region' available as a metadata label
2 participants