{"id":13573957,"url":"https://github.com/qonto/prometheus-rds-exporter","last_synced_at":"2025-04-06T07:10:44.264Z","repository":{"id":196520417,"uuid":"693053543","full_name":"qonto/prometheus-rds-exporter","owner":"qonto","description":"Prometheus exporter for AWS RDS","archived":false,"fork":false,"pushed_at":"2025-03-27T11:09:27.000Z","size":2428,"stargazers_count":83,"open_issues_count":17,"forks_count":17,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-30T06:06:43.308Z","etag":null,"topics":["aws","prometheus-exporter","rds"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qonto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-18T08:52:47.000Z","updated_at":"2025-03-28T04:30:02.000Z","dependencies_parsed_at":"2023-10-14T20:47:57.484Z","dependency_job_id":"2b68da1e-1f6b-469b-ac2b-079f8fcd00f5","html_url":"https://github.com/qonto/prometheus-rds-exporter","commit_stats":null,"previous_names":["qonto/prometheus-rds-exporter"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qonto%2Fprometheus-rds-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qonto%2Fprometheus-rds-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qonto%2Fprometheus-rds-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qonto%2Fprometheus-rds-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qonto","download_url":"https://codeload.github.com/qonto/prometheus-rds-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445669,"owners_count":20939958,"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-exporter","rds"],"created_at":"2024-08-01T15:00:44.102Z","updated_at":"2025-04-06T07:10:44.240Z","avatar_url":"https://github.com/qonto.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable-next-line --\u003e\n![prometheus-rds-exporter-illustration](https://repository-images.githubusercontent.com/693053543/44064d1c-56a3-44f2-8246-92fa6a1d4205)\n\n# Prometheus RDS exporter\n\nAre you ready to take your AWS RDS monitoring to the next level? Say hello to prometheus-rds-exporter, your ultimate solution for comprehensive, real-time insights into your Amazon RDS instances!\n\nBuilt by SRE Engineers, designed for production: Meticulously crafted by a team of Site Reliability Engineers with years of hands-on experience in managing RDS production systems. Trust in their expertise to supercharge your monitoring.\n\nIt collects key metrics about:\n\n- Hardware resource usage\n- Underlying EC2 instance's hard limits\n- Pending AWS RDS maintenance operations\n- Pending modifications\n- Logs size\n- RDS quota usage information\n\n\u003e [!TIP]\n\u003e Prometheus RDS exporter is part of the [Database Monitoring Framework](https://github.com/qonto/database-monitoring-framework) which provides alerts, along with their handy runbooks for AWS RDS.\n\n## Key metrics\n\n🥇 Advanced Metrics: Gain deep visibility with advanced metrics for AWS RDS. Monitor performance, query efficiency, and resource utilization like never before.\n\n🧩 AWS Quotas Insights: Stay in control with real-time information about AWS quotas. Ensure you never hit limits unexpectedly.\n\n💡 Hard Limits visibility: Know the hard limits of the EC2 instance used by RDS and manage your resources effectively.\n\n🔔 Alerting at Your Fingertips: Easily set up Prometheus alerting rules to stay informed of critical events, ensuring you're always ahead of issues.\n\n🛠️ Simple Setup: Getting started is a breeze! Our clear documentation and examples will have you up and running in no time.\n\n📊 Dashboards: Prometheus-RDS Exporter export adopts the [USE methodology](https://www.brendangregg.com/usemethod.html) and provides well-designed, ready-to-use dashboards.\n\n🌐 Community-Driven: Join a vibrant community of users and contributors. Collaborate, share knowledge, and shape the future of AWS RDS monitoring together.\n\n🚀 When combined with [prometheus-community/postgres_exporter](https://github.com/prometheus-community/postgres_exporter), it provides a production-ready monitoring framework for RDS PostgreSQL.\n\n## Metrics\n\n| Name | Labels | Description |\n| ---- | ------ | ----------- |\n| rds_allocated_disk_iops_average | `aws_account_id`, `aws_region`, `dbidentifier` | Allocated disk IOPS |\n| rds_allocated_disk_throughput_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Allocated disk throughput |\n| rds_allocated_storage_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Allocated storage |\n| rds_api_call_total | `api`, `aws_account_id`, `aws_region` | Number of call to AWS API |\n| rds_backup_retention_period_seconds | `aws_account_id`, `aws_region`, `dbidentifier` | Automatic DB snapshots retention period |\n| rds_ca_certificate_valid_until | `aws_account_id`, `aws_region`, `dbidentifier` | Timestamp of the expiration of the Instance certificate |\n| rds_cpu_usage_percent_average | `aws_account_id`, `aws_region`, `dbidentifier` | Instance CPU used |\n| rds_database_connections_average | `aws_account_id`, `aws_region`, `dbidentifier` | The number of client network connections to the database instance |\n| rds_dbload_average | `aws_account_id`, `aws_region`, `dbidentifier` | Number of active sessions for the DB engine |\n| rds_dbload_cpu_average | `aws_account_id`, `aws_region`, `dbidentifier` | Number of active sessions where the wait event type is CPU |\n| rds_dbload_noncpu_average | `aws_account_id`, `aws_region`, `dbidentifier` | Number of active sessions where the wait event type is not CPU |\n| rds_exporter_build_info | `build_date`, `commit_sha`, `version` | A metric with constant '1' value labeled by version from which exporter was built |\n| rds_exporter_errors_total | | Total number of errors encountered by the exporter |\n| rds_free_storage_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Free storage on the instance |\n| rds_freeable_memory_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Amount of available random access memory. For MariaDB, MySQL, Oracle, and PostgreSQL DB instances, this metric reports the value of the MemAvailable field of /proc/meminfo |\n| rds_instance_age_seconds | `aws_account_id`, `aws_region`, `dbidentifier` | Time since instance creation |\n| rds_instance_baseline_iops_average | `aws_account_id`, `aws_region`, `instance_class` | Baseline IOPS of underlying EC2 instance class |\n| rds_instance_baseline_throughput_bytes | `aws_account_id`, `aws_region`, `instance_class` | Baseline throughput of underlying EC2 instance class |\n| rds_instance_info | `arn`, `aws_account_id`, `aws_region`, `dbi_resource_id`, `dbidentifier`, `deletion_protection`, `engine`, `engine_version`, `instance_class`, `multi_az`, `performance_insights_enabled`, `pending_maintenance`, `pending_modified_values`, `role`, `source_dbidentifier`, `storage_type`, `ca_certificate_identifier` | RDS instance information |\n| rds_instance_log_files_size_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Total of log files on the instance |\n| rds_instance_max_iops_average | `aws_account_id`, `aws_region`, `instance_class` | Maximum IOPS of underlying EC2 instance class |\n| rds_instance_max_throughput_bytes | `aws_account_id`, `aws_region`, `instance_class` | Maximum throughput of underlying EC2 instance class |\n| rds_instance_memory_bytes | `aws_account_id`, `aws_region`, `instance_class` | Instance class memory |\n| rds_instance_status | `aws_account_id`, `aws_region`, `dbidentifier` | Instance status ([refer to supported status list](#supported-rds-status)) |\n| rds_instance_tags | `aws_account_id`, `aws_region`, `dbidentifier`, `tag_\u003cAWS_TAG\u003e`... | AWS tags attached to the instance |\n| rds_instance_vcpu_average | `aws_account_id`, `aws_region`, `instance_class` | Total vCPU for this instance class |\n| rds_max_allocated_storage_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Upper limit in gibibytes to which Amazon RDS can automatically scale the storage of the DB instance |\n| rds_max_disk_iops_average | `aws_account_id`, `aws_region`, `dbidentifier` | Max disk IOPS evaluated with disk IOPS and EC2 capacity |\n| rds_max_storage_throughput_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Max disk throughput evaluated with disk throughput and EC2 capacity |\n| rds_maximum_used_transaction_ids_average | `aws_account_id`, `aws_region`, `dbidentifier` | Maximum transaction IDs that have been used. Applies to only PostgreSQL |\n| rds_quota_max_dbinstances_average | `aws_account_id`, `aws_region` | Maximum number of RDS instances allowed in the AWS account |\n| rds_quota_maximum_db_instance_snapshots_average | `aws_account_id`, `aws_region` | Maximum number of manual DB instance snapshots |\n| rds_quota_total_storage_bytes | `aws_account_id`, `aws_region` | Maximum total storage for all DB instances |\n| rds_read_iops_average | `aws_account_id`, `aws_region`, `dbidentifier` | Average number of disk read I/O operations per second |\n| rds_read_throughput_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Average number of bytes read from disk per second |\n| rds_replica_lag_seconds | `aws_account_id`, `aws_region`, `dbidentifier` | For read replica configurations, the amount of time a read replica DB instance lags behind the source DB instance. Applies to MariaDB, Microsoft SQL Server, MySQL, Oracle, and PostgreSQL read replicas |\n| rds_replication_slot_disk_usage_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Disk space used by replication slot files. Applies to PostgreSQL |\n| rds_swap_usage_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Amount of swap space used on the DB instance. This metric is not available for SQL Server |\n| rds_transaction_logs_disk_usage_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Disk space used by transaction logs (only on PostgreSQL) |\n| rds_usage_allocated_storage_bytes | `aws_account_id`, `aws_region` | Total storage used by AWS RDS instances |\n| rds_usage_db_instances_average | `aws_account_id`, `aws_region` | AWS RDS instance count |\n| rds_usage_manual_snapshots_average | `aws_account_id`, `aws_region` | Manual snapshots count |\n| rds_write_iops_average | `aws_account_id`, `aws_region`, `dbidentifier` | Average number of disk write I/O operations per second |\n| rds_write_throughput_bytes | `aws_account_id`, `aws_region`, `dbidentifier` | Average number of bytes written to disk per second |\n| up | | Was the last scrape of RDS successful |\n\n\u003cdetails\u003e\n  \u003csummary\u003eStandard Go and Prometheus metrics are also available\u003c/summary\u003e\n\n| Name                                       | Labels     | Description                                                        |\n| ------------------------------------------ | ---------- | ------------------------------------------------------------------ |\n| go_gc_duration_seconds                     | `quantile` | A summary of the pause duration of garbage collection cycles.      |\n| go_goroutines                              |            | Number of goroutines that currently exist.                         |\n| go_info                                    | `version`  | Information about the Go environment.                              |\n| go_memstats_alloc_bytes                    |            | Number of bytes allocated and still in use.                        |\n| go_memstats_alloc_bytes_total              |            | Total number of bytes allocated, even if freed.                    |\n| go_memstats_buck_hash_sys_bytes            |            | Number of bytes used by the profiling bucket hash table.           |\n| go_memstats_frees_total                    |            | Total number of frees.                                             |\n| go_memstats_gc_sys_bytes                   |            | Number of bytes used for garbage collection system metadata.       |\n| go_memstats_heap_alloc_bytes               |            | Number of heap bytes allocated and still in use.                   |\n| go_memstats_heap_idle_bytes                |            | Number of heap bytes waiting to be used.                           |\n| go_memstats_heap_inuse_bytes               |            | Number of heap bytes that are in use.                              |\n| go_memstats_heap_objects                   |            | Number of allocated objects.                                       |\n| go_memstats_heap_released_bytes            |            | Number of heap bytes released to OS.                               |\n| go_memstats_heap_sys_bytes                 |            | Number of heap bytes obtained from system.                         |\n| go_memstats_last_gc_time_seconds           |            | Number of seconds since 1970 of last garbage collection.           |\n| go_memstats_lookups_total                  |            | Total number of pointer lookups.                                   |\n| go_memstats_mallocs_total                  |            | Total number of mallocs.                                           |\n| go_memstats_mcache_inuse_bytes             |            | Number of bytes in use by mcache structures.                       |\n| go_memstats_mcache_sys_bytes               |            | Number of bytes used for mcache structures obtained from system.   |\n| go_memstats_mspan_inuse_bytes              |            | Number of bytes in use by mspan structures.                        |\n| go_memstats_mspan_sys_bytes                |            | Number of bytes used for mspan structures obtained from system.    |\n| go_memstats_next_gc_bytes                  |            | Number of heap bytes when next garbage collection will take place. |\n| go_memstats_other_sys_bytes                |            | Number of bytes used for other system allocations.                 |\n| go_memstats_stack_inuse_bytes              |            | Number of bytes in use by the stack allocator.                     |\n| go_memstats_stack_sys_bytes                |            | Number of bytes obtained from system for stack allocator.          |\n| go_memstats_sys_bytes                      |            | Number of bytes obtained from system.                              |\n| go_threads                                 |            | Number of OS threads created.                                      |\n| promhttp_metric_handler_requests_in_flight |            | Current number of scrapes being served.                            |\n| promhttp_metric_handler_requests_total     | `code`     | Total number of scrapes by HTTP status code.                       |\n\n\u003c/details\u003e\n\n### Supported RDS status\n\n|   Id | Meaning                                                     |\n| ---: | :---------------------------------------------------------- |\n|   20 | Renaming, will reboot soon                                  |\n|   11 | Storage optimization                                        |\n|   10 | Storage initialization                                      |\n|    5 | Configuring Enhanced Monitoring                             |\n|    4 | Modifying                                                   |\n|    3 | Starting                                                    |\n|    2 | Backing Up                                                  |\n|    1 | Available                                                   |\n|      |                                                             |\n|    0 | Stopped or can't scrap metrics                              |\n|      |                                                             |\n|   -1 | Unknown status reported by AWS or unmapped by this exporter |\n|   -2 | Stopping                                                    |\n|   -3 | Creating                                                    |\n|   -4 | Deleting                                                    |\n|   -5 | Rebooting                                                   |\n|   -6 | Failed                                                      |\n|   -7 | Storage Full                                                |\n|   -8 | Upgrading                                                   |\n|   -9 | Maintenance                                                 |\n|  -10 | Restore error                                               |\n\n_IDs were arbitrarily chosen when building the exporter but as a rule of thumb, all ID ≤0 means that instance isn't available. [Refer to AWS Documentation for details](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/accessing-monitoring.html)_\n\n## Dashboards\n\n\u003e [!TIP]\n\u003e If you deploy [Grafana operator](https://grafana.github.io/grafana-operator/) in your Kubernetes cluster, dashboards could be automatically deployed and **maintained up-to-date**.\n\u003e Set `dashboards.enabled: true` in your Helm deployment to deploy dashboards as [GrafanaDashboard CRD](https://grafana.github.io/grafana-operator/docs/dashboards/)\n\n\u003cdetails\u003e\n  \u003csummary\u003eWhy are we recommending Grafana operator?\u003c/summary\u003e\n\nWe are committed to providing you with the most efficient and user-friendly experience possible. Therefore, we continuously enhance our dashboards and the metrics produced by our exporters to ensure you have access to the most accurate and relevant data.\n\nTo ensure an optimal user experience, it's vital to keep your dashboards up to date. This practice guarantees that you are always working with the latest features and improvements, enabling you to make the most out of the data presented to you. However, maintaining multiple versions of dashboards can be challenging and is not desirable. It introduces complexity and can lead to inconsistencies between what you see and the actual data.\n\nBy leveraging the Grafana Operator, you can rest assured that the version of your dashboard will always match the metrics presented by your exporter. This synchronization between your dashboards and the underlying data ensures a seamless and accurate monitoring experience. This move towards operator-based deployment is designed to streamline your monitoring process, ensuring accuracy and efficiency in your data visualization efforts.\n\nKubernetes operators aim to simplify deployments, and as part of this evolution, we will eventually stop publishing dashboards on Grafana Labs.\n\u003c/details\u003e\n\nFor convenience, dashboards are also available in `configs/grafana/public/` folder and Grafana labs:\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n![Instances overview](docs/screenshots/instances-overview.png)\nRDS instances\u003c/br\u003e\n\u003ca href=\"configs/grafana/public/rds-instances.json\"\u003eJSON\u003c/a\u003e or \u003ca href=\"https://grafana.com/grafana/dashboards/19647/\"\u003e19647\u003c/a\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\n![Instance details](docs/screenshots/instance-details.png)\n\nRDS instance details\u003c/br\u003e\n\u003ca href=\"configs/grafana/public/rds-instance.json\"\u003eJSON\u003c/a\u003e or \u003ca href=\"https://grafana.com/grafana/dashboards/19646/\"\u003e19646\u003c/a\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\n![RDS exporters](docs/screenshots/rds-exporter.png)\nPrometheus RDS exporter\u003c/br\u003e\n\u003ca href=\"configs/grafana/public/prometheus-rds-exporter.json\"\u003eJSON\u003c/a\u003e or \u003ca href=\"https://grafana.com/grafana/dashboards/19679/\"\u003e19679\u003c/a\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Configuration\n\nConfiguration could be defined in [prometheus-rds-exporter.yaml](https://github.com/qonto/prometheus-rds-exporter/blob/main/configs/prometheus-rds-exporter/prometheus-rds-exporter.yaml) or environment variables (format `PROMETHEUS_RDS_EXPORTER_\u003cPARAMETER_NAME\u003e`).\n\n|Parameter                | Description                                                                                                                | Default                 |\n| ------------------------ | -------------------------------------------------------------------------------------------------------------------------- | ----------------------- |\n| aws-assume-role-arn      | AWS IAM ARN role to assume to fetch metrics                                                                                |                         |\n| aws-assume-role-session  | AWS assume role session name                                                                                               | prometheus-rds-exporter |\n| collect-instance-metrics | Collect AWS instances metrics (AWS Cloudwatch API)                                                                         | true                    |\n| collect-instance-tags    | Collect AWS RDS tags                                                                                                       | true                    |\n| collect-instance-types   | Collect AWS instance types information (AWS EC2 API)                                                                       | true                    |\n| collect-logs-size        | Collect AWS instances logs size (AWS RDS API)                                                                              | true                    |\n| collect-maintenances     | Collect AWS instances maintenances (AWS RDS API)                                                                           | true                    |\n| collect-quotas           | Collect AWS RDS quotas (AWS quotas API)                                                                                    | true                    |\n| collect-usages           | Collect AWS RDS usages (AWS Cloudwatch API)                                                                                | true                    |\n| tag-selections           | Tags to select database instances with. Refer to [dedicated section on tag configuration](#tag-configuration)                      |                         |\n| debug                    | Enable debug mode                                                                                                          |                         |\n| enable-otel-traces       | Enable OpenTelemetry traces. See [configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/) | false                   |\n| listen-address           | Address to listen on for web interface                                                                                     | :9043                   |\n| log-format               | Log format (`text` or `json`)                                                                                              | json                    |\n| metrics-path             | Path under which to expose metrics                                                                                         | /metrics                |\n| tls-cert-path            | Path to TLS certificate                                                                                                    |                         |\n| tls-key-path             | Path to private key for TLS                                                                                                |                         |\n\nConfiguration parameters priorities:\n\n1. `$HOME/prometheus-rds-exporter.yaml` file\n2. `prometheus-rds-exporter.yaml` file\n3. Environment variables\n4. Command line flags\n\n### Tag configuration\n\nIn your chart, add:\n\n```yaml\n  config:\n    tag-selections:\n      ExampleKey:\n      - examplevalue\n```\n\n_Refer to [AWS configuration on TagFilters field](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html#resourcegrouptagging-GetResources-request-TagFilters)_\n\n\u003e [!IMPORTANT]\n\u003e Tag selection cannot be setup using environment variables configuration.\n\n### AWS authentication\n\nPrometheus RDS exporter needs read-only AWS IAM permissions to fetch metrics from AWS RDS, CloudWatch, EC2 and ServiceQuota AWS APIs.\n\nStandard AWS authentication methods (AWS credentials, SSO and assumed role) are supported, see \u003chttps://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html\u003e.\n\nIf you are running on [AWS EKS](https://aws.amazon.com/eks/), we strongly recommend to use [IRSA](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html)\n\n\u003cdetails\u003e\n\u003csummary\u003eMinimal required IAM permissions\u003c/summary\u003e\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"AllowInstanceAndLogDescriptions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"rds:DescribeDBInstances\",\n                \"rds:DescribeDBLogFiles\"\n            ],\n            \"Resource\": [\n                \"arn:aws:rds:*:*:db:*\"\n            ]\n        },\n        {\n            \"Sid\": \"AllowMaintenanceDescriptions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"rds:DescribePendingMaintenanceActions\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"AllowGettingCloudWatchMetrics\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"cloudwatch:GetMetricData\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"AllowRDSUsageDescriptions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"rds:DescribeAccountAttributes\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"AllowQuotaDescriptions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"servicequotas:GetServiceQuota\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"AllowInstanceTypeDescriptions\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ec2:DescribeInstanceTypes\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"AllowInstanceFilterByTags\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"tag:GetResources\"\n            ],\n            \"Resource\": \"*\"\n        }\n    ]\n}\n```\n\nFor convenience, you can download it using:\n\n```bash\ncurl \\\n--fail \\\n--silent \\\n--write-out \"Reponse code: %{response_code}\\n\" \\\nhttps://raw.githubusercontent.com/qonto/prometheus-rds-exporter/main/configs/aws/policy.json \\\n-o /tmp/prometheus-rds-exporter.policy.json\n```\n\nTerraform users can take example on Terraform code in `configs/terraform/`.\n\n\u003c/details\u003e\n\n### Helm\n\nWe recommend deployment using helm [Helm](https://helm.sh/).\n\nSee all available configuration parameters in [configs/helm/values.yaml](https://github.com/qonto/prometheus-rds-exporter/blob/main/configs/helm/values.yaml)\n\n## Installation\n\nSee the [Development environment](#development-environment) to start the Prometheus RDS exporter, Prometheus, and Grafana with dashboards in a minute.\n\n\u003e [!NOTE]\n\u003e You use Istio and have Prometheus within Istio-system? [Do this first.](#istio-specific-steps)\n\n### AWS EKS\n\n**Recommended method** to deploy on AWS EKS using [IRSA](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) and Helm.\n\n\u003e [!IMPORTANT]\n\u003e You need a [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator) already installed in your cluster.\n\n1. Create an IAM policy\n\n    ```bash\n    IAM_POLICY_NAME=prometheus-rds-exporter\n\n    # Download policy payload\n    curl --fail --silent --write-out \"Reponse code: %{response_code}\\n\" https://raw.githubusercontent.com/qonto/prometheus-rds-exporter/main/configs/aws/policy.json -o /tmp/prometheus-rds-exporter.policy.json\n\n    # Create IAM policy\n    aws iam create-policy --policy-name ${IAM_POLICY_NAME} --policy-document file:///tmp/prometheus-rds-exporter.policy.json\n    ```\n\n1. Create and attach an IAM role to your EKS cluster\n\n    [eksctl](https://eksctl.io) will create an IAM role and a Kubernetes Service account\n\n    ```bash\n    EKS_CLUSTER_NAME=default # Replace with your EKS cluster name\n    KUBERNETES_NAMESPACE=monitoring # Replace with namespace of your choice\n\n    IAM_ROLE_NAME=prometheus-rds-exporter\n    KUBERNETES_SERVICE_ACCOUNT_NAME=prometheus-rds-exporter\n    AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query \"Account\" --output text)\n\n    eksctl \\\n    create iamserviceaccount \\\n    --cluster ${EKS_CLUSTER_NAME} \\\n    --namespace ${KUBERNETES_NAMESPACE} \\\n    --name ${KUBERNETES_SERVICE_ACCOUNT_NAME} \\\n    --role-name ${IAM_ROLE_NAME} \\\n    --attach-policy-arn arn:aws:iam::${AWS_ACCOUNT_ID}:policy/${IAM_POLICY_NAME} \\\n    --approve\n    ```\n\n1. Deploy the exporter\n\n    ```bash\n    PROMETHEUS_RDS_EXPORTER_VERSION=0.3.0 # Replace with latest version\n    SERVICE_ACCOUNT_ANNOTATION=\"arn:aws:iam::${AWS_ACCOUNT_ID}:role/${IAM_ROLE_NAME}\"\n\n    helm upgrade \\\n    prometheus-rds-exporter \\\n    oci://public.ecr.aws/qonto/prometheus-rds-exporter-chart \\\n    --version ${PROMETHEUS_RDS_EXPORTER_VERSION} \\\n    --install \\\n    --namespace ${KUBERNETES_NAMESPACE} \\\n    --set serviceAccount.annotations.\"eks\\.amazonaws\\.com\\/role-arn\"=\"${SERVICE_ACCOUNT_ANNOTATION}\" \\\n    --set serviceAccount.name=\"${IAM_ROLE_NAME}\"\n    ```\n\n1. Option. Customize Prometheus exporter settings\n\n    Download Helm chart default values\n\n    ```bash\n    helm show values oci://public.ecr.aws/qonto/prometheus-rds-exporter-chart --version ${PROMETHEUS_RDS_EXPORTER_VERSION} \u003e values.yaml\n    ```\n\n    Customize settings\n\n    ```bash\n    vim values.yaml\n    ```\n\n    \u003cdetails\u003e\n    \u003csummary\u003eExample to enable debug via PROMETHEUS_RDS_EXPORTER_DEBUG environment variable\u003c/summary\u003e\n\n    ```bash\n    yq --inplace '.env += {\"PROMETHEUS_RDS_EXPORTER_DEBUG\": \"true\"}' values.yaml\n    ```\n\n    \u003c/details\u003e\n\n    Update Helm deployment:\n\n    ```bash\n    helm upgrade \\\n    prometheus-rds-exporter \\\n    oci://public.ecr.aws/qonto/prometheus-rds-exporter-chart \\\n    --version ${PROMETHEUS_RDS_EXPORTER_VERSION} \\\n    --install \\\n    --namespace ${KUBERNETES_NAMESPACE} \\\n    --set serviceAccount.annotations.\"eks\\.amazonaws\\.com\\/role-arn\"=\"${SERVICE_ACCOUNT_ANNOTATION}\" \\\n    --set serviceAccount.name=\"${IAM_ROLE_NAME}\" \\\n    --values values.yaml\n    ```\n\n### Debian/Ubuntu on AWS EC2\n\n1. Grant IAM permissions to the EC2 instance\n\n    \u003cdetails\u003e\n    \u003csummary\u003eSee steps\u003c/summary\u003e\n\n    1. Create IAM role\n\n        ```bash\n        IAM_ROLE_NAME=prometheus-rds-exporter\n\n        cat \u003e ec2-role-trust-policy.json \u003c\u003c EOF\n        {\n            \"Version\": \"2012-10-17\",\n            \"Statement\": [\n                {\n                    \"Effect\": \"Allow\",\n                    \"Principal\": { \"Service\": \"ec2.amazonaws.com\"},\n                    \"Action\": \"sts:AssumeRole\"\n                }\n            ]\n        }\n        EOF\n\n        aws iam create-role --role-name ${IAM_ROLE_NAME} --assume-role-policy-document file://ec2-role-trust-policy.json\n        ```\n\n    1. Create IAM policy\n\n        ```bash\n        IAM_POLICY_NAME=prometheus-rds-exporter\n\n        # Download Prometheus RDS exporter required IAM permissions\n        curl --fail --silent --write-out \"Reponse code: %{response_code}\\n\" https://raw.githubusercontent.com/qonto/prometheus-rds-exporter/main/configs/aws/policy.json -o prometheus-rds-exporter.policy.json\n\n        # Create IAM policy\n        aws iam create-policy --policy-name ${IAM_POLICY_NAME} --policy-document file://prometheus-rds-exporter.policy.json\n\n        # Attach IAM policy to IAM role\n        AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query \"Account\" --output text)\n        IAM_POLICY_ARN=arn:aws:iam::${AWS_ACCOUNT_ID}:policy/${IAM_POLICY_NAME}\n        aws iam attach-role-policy --role-name ${IAM_ROLE_NAME} --policy-arn ${IAM_POLICY_ARN}\n        ```\n\n    1. Create an IAM instance profile\n\n        ```bash\n        EC2_INSTANCE_PROFILE_NAME=\"prometheus-rds-exporter\"\n\n        # Create IAM instance profile\n        aws iam create-instance-profile --instance-profile-name ${EC2_INSTANCE_PROFILE_NAME}\n\n        # Attach IAM role to IAM instance profile\n        aws iam add-role-to-instance-profile  --instance-profile-name ${EC2_INSTANCE_PROFILE_NAME} --role-name ${IAM_ROLE_NAME}\n        ```\n\n    1. Attach the IAM instance profile to the EC2 instance\n\n        ```bash\n        EC2_INSTANCE_ID=\"i-1234567890abcdef0\" # Replace with your AWS instance ID\n\n        aws ec2 associate-iam-instance-profile \\\n        --instance-id ${EC2_INSTANCE_ID} \\\n        --iam-instance-profile Name=\"${EC2_INSTANCE_PROFILE_NAME}\"\n        ```\n\n    \u003c/details\u003e\n\n1. Download the Debian package\n\n    ```bash\n    PROMETHEUS_RDS_EXPORTER_VERSION=0.3.0 # Replace with latest version\n\n    PACKAGE_NAME=prometheus-rds-exporter_${PROMETHEUS_RDS_EXPORTER_VERSION}_$(uname -m).deb\n    wget https://github.com/qonto/prometheus-rds-exporter/releases/download/${PROMETHEUS_RDS_EXPORTER_VERSION}/${PACKAGE_NAME}\n    ```\n\n1. Install package\n\n    Prometheus RDS exporter will be automatically started as a service.\n\n    ```bash\n    dpkg -i ${PACKAGE_NAME}\n    ```\n\n1. Optional, customize configuration\n\n    ```bash\n    # Copy configuration template\n    cp /usr/share/prometheus-rds-exporter/prometheus-rds-exporter.yaml.sample /var/lib/prometheus-rds-exporter/prometheus-rds-exporter.yaml\n\n    # Edit configuration\n    vim /var/lib/prometheus-rds-exporter/prometheus-rds-exporter.yaml\n\n    # Restart service\n    systemctl restart prometheus-rds-exporter\n    ```\n\n### Binary\n\n1. Binary\n\n    ```bash\n    PROMETHEUS_RDS_EXPORTER_VERSION=0.3.0 # Replace with latest version\n    TARBALL_NAME=prometheus-rds-exporter_Linux_$(uname -m).tar.gz\n\n    wget https://github.com/qonto/prometheus-rds-exporter/releases/download/${PROMETHEUS_RDS_EXPORTER_VERSION}/${TARBALL_NAME}\n    tar xvzf ${TARBALL_NAME}\n    ```\n\n1. Optional, customize configuration\n\n    ```bash\n    vim prometheus-rds-exporter.yaml\n    ```\n\n1. Start the exporter\n\n    ```bash\n    ./prometheus-rds-exporter\n    ```\n\n### Locally with docker\n\n1. Connect on AWS with any method\n\n    ```bash\n    aws configure\n    ```\n\n1. Start application\n\n    ```bash\n    docker run -p 9043:9043 -e AWS_PROFILE=${AWS_PROFILE} -v $HOME/.aws:/app/.aws public.ecr.aws/qonto/prometheus-rds-exporter:latest\n    ```\n\n### Istio specific steps\n\nIf you use **Istio** and have **Prometheus within Istio-system**, you'll need to do the following modification before following the install instructions.\n\n1. Get your `values.yaml` for your currently deployed Prometheus system (ex: `helm get values RELEASE_NAME [flags]`)\n1. Edit the values, under `additionalScrapeConfigs` insert an additional `job_name`:\n\n    ```yaml\n        - job_name: prometheus-rds-exporter\n          kubernetes_sd_configs:\n            - namespaces:\n                names:\n                - monitoring\n              role: endpoints\n    ```\n\n1. Apply the edited values (ex: `helm upgrade prometheus prometheus-community/kube-prometheus-stack -n istio-system -f values.yaml --version 62.2.1` - _add the repo if you haven't on helm, and change the repo if you're using another version_).\n\n## Alternative\n\n[percona/rds_exporter](https://github.com/percona/rds_exporter) and [mtanda/rds_enhanced_monitoring_exporter](https://github.com/mtanda/rds_enhanced_monitoring_exporter) are great alternatives.\n\n[prometheus/cloudwatch_exporter](https://github.com/prometheus/cloudwatch_exporter) could be used to collect additional CloudWatch metrics.\n\n## Contribute\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\nTo report a security issue, please visit [SECURITY.md](SECURITY.md)\n\n## Development\n\n### Development environment\n\nYou can start a simple development environment using the Docker compose configuration in `/scripts/prometheus`.\n\nIt will start Grafana (with the dashboards), Prometheus, and the RDS exporter:\n\n1. Connect on AWS using the AWS CLI\n\n1. Launch development stack\n\n    ```bash\n    cd scripts/prometheus\n    docker compose up --build\n    ```\n\n1. Connect on the services\n\n    - Grafana: \u003chttp://localhost:3000\u003e (credential: admin/hackme)\n    - Prometheus: \u003chttp://localhost:9090\u003e\n    - Prometheus RDS exporter: \u003chttp://localhost:9043\u003e\n\n### Running the tests\n\nExecute Go tests:\n\n```bash\nmake test\n```\n\nExecute Helm chart tests:\n\n```bash\nmake helm-test # Helm unit test\nmake kubeconform # Kubernetes manifest validation\nmake checkcov # Check misconfigurations\n```\n\n### Tracing\n\nPrometheus RDS Exporter includes an OpenTelemetry trace exporter to facilitate troubleshooting.\n\nTraces can be forwarded to any OpenTelemetry server using gRPC protocol.\n\n1. Export the `OTEL_EXPORTER_OTLP_ENDPOINT` variable.\n\n    ```bash\n    export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317\n    ```\n\n    See [OTEL SDK configuration](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#general-sdk-configuration) and [OpenTelemetry environments variables](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/) for all options.\n\n1. Start exporter with OpenTelemetry enabled\n\n    ```bash\n    prometheus-rds-exporter --enable-otel-traces\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqonto%2Fprometheus-rds-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqonto%2Fprometheus-rds-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqonto%2Fprometheus-rds-exporter/lists"}