Skip to content

distribution: resources report

Administrator requested to merge distribution/resources-report into master

Created by: bobheadxi

closes #10116

Current "usage": once a day, a GitHub action will run resources-report and throw up a slack message in some slack channel with a link to a spreadsheet with all disk, compute, and cluster resources created in the past x days

  • report disk, compute, cluster resources
    • GCP query with beta Resources.SearchAll API (thank you google 🙏 ) turns out this doesn't allow me to get the create time of resources, and I've changed this to query services individually like the AWS ones to allow filtering by time
    • AWS query by manually defining queries. I tried fenangling with a bunch of different APIs but the closest thing to a "query everything i own" was AWS Config (https://github.com/sourcegraph/sourcegraph/commit/6fd48b15b14b1d3681ad29dcb4c9fdf954060d79), which itself costs moneys and still requires you to manually define resource types to query. At that point I figured might as well just define those queries ourselves (current state of the impl)
  • github action workflow
  • slack reporting (see test channel https://sourcegraph.slack.com/archives/C013V78N0Q2)
  • query for past x days with --window, default 2 days
  • leave report in google sheets
go build && ./resources-report --aws --gcp --dry --verbose

docs: https://github.com/sourcegraph/sourcegraph/blob/distribution/resources-report/internal/cmd/resources-report/README.md

Merge request reports

Loading