Giter Club home page Giter Club logo

aws-rds-engine-version-prometheus-exporter's Introduction

aws-rds-engine-version-prometheus-exporter

Prometheus Exporter for AWS RDS Engine Version

image.png

How to run

Local

$ go run main.go

Binary

Get the binary file from Releases and run it.

Docker

$ docker run chaspy/aws-rds-engine-version-prometheus-exporter:v0.1.0

Metrics

$ curl -s localhost:8080/metrics | grep aws_custom_rds_cluster_count
# HELP aws_custom_rds_cluster_count Number of RDS
# TYPE aws_custom_rds_cluster_count gauge
aws_custom_rds_cluster_count{cluster_identifier="api-postgres-develop-a",engine="aurora-postgresql",engine_version="10.7",eol_status="ok"} 1
aws_custom_rds_cluster_count{cluster_identifier="api-postgres-production-a",engine="aurora-postgresql",engine_version="10.7",eol_status="ok"} 1
aws_custom_rds_cluster_count{cluster_identifier="video-production-a",engine="aurora-postgresql",engine_version="9.6.17",eol_status="ok"} 1
aws_custom_rds_cluster_count{cluster_identifier="video-staging-a",engine="aurora-postgresql",engine_version="9.6.17",eol_status="ok"} 1
metric description tags note
aws_custom_rds_eol_status_ok Number of instances whose EOL status is ok "cluster_identifier", "engine", "engine_version"
aws_custom_rds_eol_status_alert Number of instances whose EOL status is alert "cluster_identifier", "engine", "engine_version"
aws_custom_rds_eol_status_warning Number of instances whose EOL status is warning "cluster_identifier", "engine", "engine_version"
aws_custom_rds_eol_status_expired Number of instances whose EOL status is expired "cluster_identifier", "engine", "engine_version"
aws_custom_rds_cluster_count Number of RDS "cluster_identifier", "engine", "engine_version", "eol_status" DEPRECATED

IAM Role

The following policy must be attached to the AWS role to be executed.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "rds:DescribeDBInstances",
                "rds:DescribeDBClusters"
            ],
            "Resource": "*"
        }
    ]
}

Environment Variable

name required default description
ALERT_HOURS no 2160 Time to determine "alert" status for EOL dates
WARNING_HOURS no 4320 Time to determine "warning" status for EOL dates
AWS_API_INTERVAL no 300 Interval between calls to the AWS API

Datadog Autodiscovery

If you use Datadog, you can use Kubernetes Integration Autodiscovery feature.

aws-rds-engine-version-prometheus-exporter's People

Contributors

artursantostdx avatar chaspy avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar

Watchers

 avatar

aws-rds-engine-version-prometheus-exporter's Issues

AWS Regions with more than ~100 RDS instances do not return all the metrics

Hi,
I'm testing this exporter and works fine but, for regions with a lot of RDS instances (more than ~100), the exporter fo not return metrics to all of the instances.

I concluded that this can happen for one of two reasons:

  1. Exporter code needs to be tuned to wait that all the info returned by the API request is stored on the var(maybe need a sleep time or something similar)
  2. Rate limit by AWS on API requests. I can’t find on AWS SDK RDS the docs what is the limit for these requests. Using the AWS CLI I can get the data for all the RDS.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • golang 1.22.4
  • alpine 3.20.1
github-actions
.github/workflows/docker.yml
  • actions/checkout v3
  • docker/setup-buildx-action v2
  • docker/login-action v2
  • docker/build-push-action v4
.github/workflows/go.yml
  • actions/checkout v3
  • actions/setup-go v4
  • golangci/golangci-lint-action v3
.github/workflows/release.yml
  • actions/checkout v3
  • actions/setup-go v4
  • goreleaser/goreleaser-action v4
gomod
go.mod
  • go 1.19
  • github.com/aws/aws-sdk-go v1.54.11
  • github.com/hashicorp/go-version v1.7.0
  • github.com/jszwec/csvutil v1.10.0
  • github.com/prometheus/client_golang v1.18.0

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

MissingRegion: could not find region configuration log error

Hi πŸ‘‹
I got this error when trying the exporter:
2022/05/31 15:49:14 failed to read RDS Cluster infos: failed to describe DB clusters: MissingRegion: could not find region configuration

On the README there is no reference to the region var.

Export EOL information as tag

I've received the following e-mail.

Hello,

*NOTE*: This notice does not apply to Amazon Aurora clusters.

Amazon RDS is starting the end of life (EOL) process for PostgreSQL major version 9.6. We are doing this because the PostgreSQL community is planning to discontinue support for PostgreSQL 9.6 on November 11, 2021 [1].

You are receiving this message because you have one or more PostgreSQL version 9.6 instances in the ap-northeast-1 Region.

Impacted PostgreSQL Databases:
(snip)

To avoid availability impact during a time of the year when many customers' databases tend to experience their peak workload, Amazon RDS for PostgreSQL 9.6 will reach EOL on January 18, 2022 00:00:01 AM UTC. While you will be able to run your RDS for PostgreSQL 9.6 databases between community PostgreSQL 9.6 EOL (November 11, 2021) and RDS for PostgreSQL 9.6 EOL (January 18, 2022), the databases will not receive any security patches during this extended availability period. We strongly recommend that you proactively upgrade your RDS for PostgreSQL 9.6 databases to major version 12 or greater before community EOL. PostgreSQL 12 contains major innovations including JSON path queries per SQL/JSON specifications and pluggable table storage interface [2]. PostgreSQL 13 will introduce parallel processing of indexes with the VACUUM command and improved duplicate data handling by B-tree indexes [3]. Both versions contain numerous fixes to various software bugs in earlier versions of the database.

If you do not upgrade your databases before January 18, 2022, RDS will upgrade your PostgreSQL 9.6 databases to 12 during a scheduled maintenance window between January 18, 2022 00:00:01 UTC and February 22, 2022 00:00:01 UTC. On February 22, 2022 00:00:01 AM UTC, any PostgreSQL 9.6 databases that remain will be upgraded to version 12 regardless of whether the instances are in a maintenance window or not.

We recommend that you first upgrade to minor version 9.6.20 or greater and then upgrade directly to PostgreSQL 12 or greater so that you can skip intermediate major versions. You can initiate an upgrade of your database instance either immediately or during your next maintenance window, to a newer version of PostgreSQL using the AWS Management Console or the AWS Command Line Interface. The upgrade process will shut down the database instance, perform the upgrade, and restart the database instance. The database instance may be restarted multiple times during the upgrade process. While major version upgrades typically complete within the standard maintenance window, the duration of the upgrade depends on the number of objects within the database. To avoid any unplanned unavailability outside your maintenance window, we recommend that you first take a snapshot of your database and test the upgrade to get an estimate of the upgrade duration. To learn more about upgrading PostgreSQL major versions in RDS, review the Upgrading Database Versions page [4].

We want to make you aware of the following additional milestones associated with upgrading databases that are reaching EOL.
β€’       Now through January 18, 2022 00:00:01 AM UTC - You can initiate upgrades of Amazon RDS for PostgreSQL 9.6 instances to PostgreSQL 12 or greater at any time.
β€’       August 3, 2021 00:00:01 AM UTC - After this date and time, you cannot create new RDS instances with PostgreSQL major version 9.6 from either the AWS Console or the CLI.
β€’       January 18, 2022 00:00:01 AM UTC - Amazon RDS will automatically upgrade PostgreSQL 9.6 instances to version 12 within the earliest scheduled maintenance window that follows. After this date and time, restoration of Amazon RDS for PostgreSQL 9.6 database snapshots will result in an automatic upgrade of the restored database to a still supported version at the time.
β€’       February 22 2022 00:00:01 AM UTC – Amazon RDS will automatically upgrade any remaining PostgreSQL 9.6 instances to version 12 whether or not they are in a maintenance window.

If you have any questions or concerns, the AWS Support Team is available on the community forums and via Premium Support [5].

[1] https://www.postgresql.org/support/versioning/
[2] https://aws.amazon.com/about-aws/whats-new/2019/11/postgresql-12-0-now-available-in-amazon-rds-database-preview-environment/
[3] https://aws.amazon.com/about-aws/whats-new/2020/06/postgresql-13-beta-1-now-available-in-amazon-rds-database-preview-environment/
[4] https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Upgrading.html#USER_UpgradeDBInstance.Upgrading.Manual
[5] https://aws.amazon.com/support

Prepare the csv as follows

engine,engine_version,due_date
postrgres,9.6,2022-02-22

According to the due date, give the following three types of tags

  • eol_status:
    • expired If it has expired
    • alert: If it expires in a month
    • warning: IF it expires in 3 months

Alert and warning deadline thresholds should be configurable via environment variables.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.