{"id":28561273,"url":"https://github.com/duneanalytics/prometheus-trusted-advisor-exporter","last_synced_at":"2025-06-10T10:42:09.237Z","repository":{"id":103252511,"uuid":"463590993","full_name":"duneanalytics/prometheus-trusted-advisor-exporter","owner":"duneanalytics","description":"Prometheus metrics exporter for AWS Trusted Advisor","archived":false,"fork":false,"pushed_at":"2025-06-04T08:36:41.000Z","size":42,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-06-04T15:53:00.543Z","etag":null,"topics":["aws","prometheus","prometheus-exporter","trusted-advisor"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duneanalytics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-25T15:54:26.000Z","updated_at":"2025-06-04T08:36:38.000Z","dependencies_parsed_at":"2025-04-16T08:46:31.633Z","dependency_job_id":null,"html_url":"https://github.com/duneanalytics/prometheus-trusted-advisor-exporter","commit_stats":null,"previous_names":["pluies/prometheus-trusted-advisor-exporter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fprometheus-trusted-advisor-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fprometheus-trusted-advisor-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fprometheus-trusted-advisor-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fprometheus-trusted-advisor-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duneanalytics","download_url":"https://codeload.github.com/duneanalytics/prometheus-trusted-advisor-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fprometheus-trusted-advisor-exporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259058153,"owners_count":22799307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","prometheus","prometheus-exporter","trusted-advisor"],"created_at":"2025-06-10T10:41:47.917Z","updated_at":"2025-06-10T10:42:09.219Z","avatar_url":"https://github.com/duneanalytics.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prometheus-trusted-advisor-exporter\n\nA Prometheus exporter for [AWS Trusted Advisor](https://aws.amazon.com/premiumsupport/technology/trusted-advisor/).\n\n## Why?\n\nTrusted Advisor [exposes metrics in Cloudwatch](https://docs.aws.amazon.com/awssupport/latest/user/cloudwatch-metrics-ta.html), so one could be tempted to use the [Cloudwatch exporter](https://github.com/prometheus/cloudwatch_exporter) to get Trusted Advisor metrics.\n\nHowever, this approach suffers from various issues:\n- Trusted Advisor only publishes metrics when it refreshes its checks, which creates large gaps in the metrics\n- In turn, this makes the Cloudwatch exporter highly unreliable - with Cloudwatch being full of holes, the metrics exported to Prometheus will be inconsistent as well\n- You can _partly_ work around that issue by configuring the Cloudwatch exporter to request old data with `range_seconds`, but scrapes then become extremely long (120+ seconds) and the whole setup will start being expensive, as Cloudwatch isn't cheap\n- A minor issue in comparison - Trusted Advisor only publishes its metrics in us-east-1, so your Cloudwatch exporter needs to be configured for that region\n\nInstead, this exporter retrieves data directly from the [Support API](https://docs.aws.amazon.com/sdk-for-go/api/service/support/) in order to always get up-to-date and correct data. This means you will need a [support plan of Business or above](https://aws.amazon.com/premiumsupport/plans/) to use this exporter.\n\nFinally, unlike Cloudwatch, this API is free. Well, \"free\" in the sense that it's included in the cost of your support contract. 🙂\n\n## Credentials and permissions\n\n`prometheus-trusted-advisor-exporter` uses the standard AWS authentication methods provided by the AWS SDK for Go, so you should be able to authenticate using the standard environment variables, shared credentials file, IAM roles for EC2, etc. See [Specifying Credentials](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials) for more details.\n\nIt requires the following permissions:\n- `support:DescribeTrustedAdvisorChecks`\n- `support:DescribeTrustedAdvisorCheckResult`\n\n## Configuration\n\nThe exporter is configured via the following environment variables:\n\n| Variable         | Description   | Default value |\n|------------------| ------------- |---------------|\n| `LISTEN_ADDR`    | Address and port the exporter will listen to  | `:2112`       |\n| `REFRESH_PERIOD` | How often to refresh all checks and their values, in seconds  | `300`         |\n| `CONCURRENCY`    | How many concurrent goroutines to use to refresh all checks and their values  | `10`         |\n\n## Build and run\n\n```bash\ngo build\n./prometheus-trusted-advisor-exporter\n```\n\nOr use the Docker container:\n\n```bash\ndocker build . -t prometheus-trusted-advisor-exporter\ndocker run -p 2112:2112 -it prometheus-trusted-advisor-exporter\n```\n\nA pre-built version of this container [is available on the ECR public gallery](https://gallery.ecr.aws/r0t8x2e9/prometheus_trusted_advisor_exporter):\n\n```bash\ndocker run -p 2112:2112 -it public.ecr.aws/r0t8x2e9/prometheus_trusted_advisor_exporter\n```\n\n## Exposed metrics\n\n`prometheus-trusted-advisor-exporter` exposes a single gauge at `/metrics`:\n\n```\n# HELP aws_trusted_advisor_check AWS Trusted Advisor check result\n# TYPE aws_trusted_advisor_check gauge\naws_trusted_advisor_check{category=\"cost_optimizing\",checkid=\"1e93e4c0b5\",name=\"Amazon EC2 Reserved Instance Lease Expiration\",status=\"ok\"} 0\naws_trusted_advisor_check{category=\"cost_optimizing\",checkid=\"1qazXsw23e\",name=\"Amazon Relational Database Service (RDS) Reserved Instance Optimization\",status=\"warning\"} 8\naws_trusted_advisor_check{category=\"cost_optimizing\",checkid=\"1qw23er45t\",name=\"Amazon Redshift Reserved Node Optimization\",status=\"ok\"} 0\naws_trusted_advisor_check{category=\"cost_optimizing\",checkid=\"51fC20e7I2\",name=\"Amazon Route 53 Latency Resource Record Sets\",status=\"ok\"} 0\naws_trusted_advisor_check{category=\"security\",checkid=\"DqdJqYeRm5\",name=\"IAM Access Key Rotation\",status=\"error\"} 36\n(...)\n```\n\nAll Trusted Advisor checks are exported for every scrape, regardless of their status. They will get a status of \"ok\" (green), \"warning\" (yellow), \"error\" (red), or \"not_available\" if the check failed to refresh.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduneanalytics%2Fprometheus-trusted-advisor-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduneanalytics%2Fprometheus-trusted-advisor-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduneanalytics%2Fprometheus-trusted-advisor-exporter/lists"}