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

[OSD-12400] Collect Hosted Zones per Account #50

Merged
merged 1 commit into from
Sep 4, 2022

Conversation

mrWinston
Copy link
Contributor

@mrWinston mrWinston commented Aug 31, 2022

This PR implements the last part of OSD-12400, collecting the number of hosted zones per account.
It also parallelizes the collection of the RecordSetsPerHostedZone-metric, so it doesn't take forever.

Testing
first, make sure you're actually logged in to an aws account. Then run the following to disable the unneeded exporters

$ cat << EOF > ./aws-resource-exporter-config.yaml
rds:
  enabled: false
  regions:
    - "us-east-1"
vpc:
  enabled: false
  regions:
    - "us-east-1"
    - "eu-central-1"
  timeout: 30s
route53:
  enabled: true
  region: "us-east-1"
  timeout: 300s
  interval: 300s
ec2:
  enabled: false
  regions:
    - "us-west-1"
  timeout: 30s
EOF

# then, build & run the exporter:
$ go build
$ ./aws-resource-exporter

Wait until you see the message:

level=info ts=2022-08-31T13:49:06.561Z caller=route53.go:154 msg="Route53 metrics Updated"

on the console. This means, that all the r53 metrics have been collected and can now be retrieved from the cache.
In a separate shell window, run the following:

$ curl localhost:9115/metrics | grep "hostedzonesperaccount"

Make sure this prints out the newly implemented metrics, for example:

# HELP aws_resources_exporter_route53_hostedzonesperaccount_quota Quota for maximum number of Route53 hosted zones in an account
# TYPE aws_resources_exporter_route53_hostedzonesperaccount_quota gauge
aws_resources_exporter_route53_hostedzonesperaccount_quota 2000
# HELP aws_resources_exporter_route53_hostedzonesperaccount_total Number of Resource records
# TYPE aws_resources_exporter_route53_hostedzonesperaccount_total gauge
aws_resources_exporter_route53_hostedzonesperaccount_total 487

@maorfr maorfr merged commit 135776a into app-sre:master Sep 4, 2022
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