Skip to content

Commit

Permalink
Merge branch 'main' into ci-build
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbauerinc committed Dec 16, 2024
2 parents 54668cc + a577d51 commit 71e5cf0
Show file tree
Hide file tree
Showing 11 changed files with 829 additions and 865 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM golang:1.16 as build
FROM golang:1.23 AS build

COPY . /usr/src/rds_exporter

RUN cd /usr/src/rds_exporter

FROM alpine:latest
FROM alpine:latest

COPY --from=build /usr/src/rds_exporter/rds_exporter /bin/
# COPY config.yml /etc/rds_exporter/config.yml
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BIN_DIR ?= $(shell pwd)
DOCKER_IMAGE_NAME ?= $(shell basename $(shell pwd))
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))

all: format build test
all: format release test

GO_BUILD_LDFLAGS = -X github.com/prometheus/common/version.Version=$(shell cat VERSION) -X github.com/prometheus/common/version.Revision=$(shell git rev-parse HEAD) -X github.com/prometheus/common/version.Branch=$(shell git describe --always --contains --all) -X github.com/prometheus/common/version.BuildUser= -X github.com/prometheus/common/version.BuildDate=$(shell date +%FT%T%z) -s -w

Expand Down Expand Up @@ -60,4 +60,4 @@ gocoverutil:
@$(GO) build -modfile=tools/go.mod -o bin/gocoverutil github.com/AlekSi/gocoverutil

release:
go build -ldflags="$(GO_BUILD_LDFLAGS)" -o $(PMM_RELEASE_PATH)/rds_exporter
@$(GO) build -ldflags="$(GO_BUILD_LDFLAGS)" -o $(PMM_RELEASE_PATH)/rds_exporter
1 change: 1 addition & 0 deletions basic/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Metric struct {
cwName string
prometheusName string
prometheusHelp string
statistics []string
}

type Collector struct {
Expand Down
92 changes: 46 additions & 46 deletions basic/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,117 +3,117 @@ package basic
var Metrics = []Metric{
{
cwName: "ActiveTransactions",
prometheusName: "aws_rds_active_transactions_average",
prometheusName: "aws_rds_active_transactions",
prometheusHelp: "ActiveTransactions",
},
{
cwName: "AuroraBinlogReplicaLag",
prometheusName: "aws_rds_aurora_binlog_replica_lag_average",
prometheusName: "aws_rds_aurora_binlog_replica_lag",
prometheusHelp: "AuroraBinlogReplicaLag",
},
{
cwName: "AuroraReplicaLag",
prometheusName: "aws_rds_aurora_replica_lag_average",
prometheusName: "aws_rds_aurora_replica_lag",
prometheusHelp: "AuroraReplicaLag",
},
{
cwName: "AuroraReplicaLagMaximum",
prometheusName: "aws_rds_aurora_replica_lag_maximum_average",
prometheusName: "aws_rds_aurora_replica_lag_maximum",
prometheusHelp: "AuroraReplicaLagMaximum",
},
{
cwName: "AuroraReplicaLagMinimum",
prometheusName: "aws_rds_aurora_replica_lag_minimum_average",
prometheusName: "aws_rds_aurora_replica_lag_minimum",
prometheusHelp: "AuroraReplicaLagMinimum",
},
{
cwName: "BinLogDiskUsage",
prometheusName: "aws_rds_bin_log_disk_usage_average",
prometheusName: "aws_rds_bin_log_disk_usage",
prometheusHelp: "The amount of disk space occupied by binary logs on the master. Applies to MySQL read replicas. Units: Bytes",
},
{
cwName: "BlockedTransactions",
prometheusName: "aws_rds_blocked_transactions_average",
prometheusName: "aws_rds_blocked_transactions",
prometheusHelp: "BlockedTransactions",
},
{
cwName: "BufferCacheHitRatio",
prometheusName: "aws_rds_buffer_cache_hit_ratio_average",
prometheusName: "aws_rds_buffer_cache_hit_ratio",
prometheusHelp: "BufferCacheHitRatio",
},
{
cwName: "BurstBalance",
prometheusName: "aws_rds_burst_balance_average",
prometheusName: "aws_rds_burst_balance",
prometheusHelp: "The percent of General Purpose SSD (gp2) burst-bucket I/O credits available. Units: Percent",
},
{
cwName: "CPUCreditBalance",
prometheusName: "aws_rds_cpu_credit_balance_average",
prometheusName: "aws_rds_cpu_credit_balance",
prometheusHelp: "[T2 instances] The number of CPU credits available for the instance to burst beyond its base CPU utilization. Credits are stored in the credit balance after they are earned and removed from the credit balance after they expire. Credits expire 24 hours after they are earned. CPU credit metrics are available only at a 5 minute frequency. Units: Count",
},
{
cwName: "CPUCreditUsage",
prometheusName: "aws_rds_cpu_credit_usage_average",
prometheusName: "aws_rds_cpu_credit_usage",
prometheusHelp: "[T2 instances] The number of CPU credits consumed by the instance. One CPU credit equals one vCPU running at 100% utilization for one minute or an equivalent combination of vCPUs, utilization, and time (for example, one vCPU running at 50% utilization for two minutes or two vCPUs running at 25% utilization for two minutes). CPU credit metrics are available only at a 5 minute frequency. If you specify a period greater than five minutes, use the Sum statistic instead of the Average statistic. Units: Count",
},
{
cwName: "CPUUtilization",
prometheusName: "node_cpu_average",
prometheusName: "node_cpu",
prometheusHelp: "The percentage of CPU utilization. Units: Percent",
},
{
cwName: "CommitLatency",
prometheusName: "aws_rds_commit_latency_average",
prometheusName: "aws_rds_commit_latency",
prometheusHelp: "CommitLatency",
},
{
cwName: "CommitThroughput",
prometheusName: "aws_rds_commit_throughput_average",
prometheusName: "aws_rds_commit_throughput",
prometheusHelp: "CommitThroughput",
},
{
cwName: "DDLLatency",
prometheusName: "aws_rds_ddl_latency_average",
prometheusName: "aws_rds_ddl_latency",
prometheusHelp: "DDLLatency",
},
{
cwName: "DDLThroughput",
prometheusName: "aws_rds_ddl_throughput_average",
prometheusName: "aws_rds_ddl_throughput",
prometheusHelp: "DDLThroughput",
},
{
cwName: "DMLLatency",
prometheusName: "aws_rds_dml_latency_average",
prometheusName: "aws_rds_dml_latency",
prometheusHelp: "DMLLatency",
},
{
cwName: "DMLThroughput",
prometheusName: "aws_rds_dml_throughput_average",
prometheusName: "aws_rds_dml_throughput",
prometheusHelp: "DMLThroughput",
},
{
cwName: "DatabaseConnections",
prometheusName: "aws_rds_database_connections_average",
prometheusName: "aws_rds_database_connections",
prometheusHelp: "The number of database connections in use. Units: Count",
},
{
cwName: "Deadlocks",
prometheusName: "aws_rds_deadlocks_average",
prometheusName: "aws_rds_deadlocks",
prometheusHelp: "Deadlocks",
},
{
cwName: "DeleteLatency",
prometheusName: "aws_rds_delete_latency_average",
prometheusName: "aws_rds_delete_latency",
prometheusHelp: "DeleteLatency",
},
{
cwName: "DeleteThroughput",
prometheusName: "aws_rds_delete_throughput_average",
prometheusName: "aws_rds_delete_throughput",
prometheusHelp: "DeleteThroughput",
},
{
cwName: "DiskQueueDepth",
prometheusName: "aws_rds_disk_queue_depth_average",
prometheusName: "aws_rds_disk_queue_depth",
prometheusHelp: "The number of outstanding IOs (read/write requests) waiting to access the disk. Units: Count",
},
{
Expand All @@ -123,7 +123,7 @@ var Metrics = []Metric{
},
{
cwName: "FreeLocalStorage",
prometheusName: "aws_rds_free_local_storage_average",
prometheusName: "aws_rds_free_local_storage",
prometheusHelp: "FreeLocalStorage",
},
{
Expand All @@ -138,112 +138,112 @@ var Metrics = []Metric{
},
{
cwName: "InsertLatency",
prometheusName: "aws_rds_insert_latency_average",
prometheusName: "aws_rds_insert_latency",
prometheusHelp: "InsertLatency",
},
{
cwName: "InsertThroughput",
prometheusName: "aws_rds_insert_throughput_average",
prometheusName: "aws_rds_insert_throughput",
prometheusHelp: "InsertThroughput",
},
{
cwName: "LoginFailures",
prometheusName: "aws_rds_login_failures_average",
prometheusName: "aws_rds_login_failures",
prometheusHelp: "LoginFailures",
},
{
cwName: "NetworkReceiveThroughput",
prometheusName: "aws_rds_network_receive_throughput_average",
prometheusName: "aws_rds_network_receive_throughput",
prometheusHelp: "The incoming (Receive) network traffic on the DB instance, including both customer database traffic and Amazon RDS traffic used for monitoring and replication. Units: Bytes/second",
},
{
cwName: "NetworkThroughput",
prometheusName: "aws_rds_network_throughput_average",
prometheusName: "aws_rds_network_throughput",
prometheusHelp: "NetworkThroughput",
},
{
cwName: "NetworkTransmitThroughput",
prometheusName: "aws_rds_network_transmit_throughput_average",
prometheusName: "aws_rds_network_transmit_throughput",
prometheusHelp: "The outgoing (Transmit) network traffic on the DB instance, including both customer database traffic and Amazon RDS traffic used for monitoring and replication. Units: Bytes/second",
},
{
cwName: "Queries",
prometheusName: "aws_rds_queries_average",
prometheusName: "aws_rds_queries",
prometheusHelp: "Queries",
},
{
cwName: "ReadIOPS",
prometheusName: "aws_rds_read_iops_average",
prometheusName: "aws_rds_read_iops",
prometheusHelp: "The average number of disk I/O operations per second. Units: Count/Second",
},
{
cwName: "ReadLatency",
prometheusName: "aws_rds_read_latency_average",
prometheusName: "aws_rds_read_latency",
prometheusHelp: "The average amount of time taken per disk I/O operation. Units: Seconds",
},
{
cwName: "ReadThroughput",
prometheusName: "aws_rds_read_throughput_average",
prometheusName: "aws_rds_read_throughput",
prometheusHelp: "The average number of bytes read from disk per second. Units: Bytes/Second",
},
{
cwName: "ResultSetCacheHitRatio",
prometheusName: "aws_rds_result_set_cache_hit_ratio_average",
prometheusName: "aws_rds_result_set_cache_hit_ratio",
prometheusHelp: "ResultSetCacheHitRatio",
},
{
cwName: "SelectLatency",
prometheusName: "aws_rds_select_latency_average",
prometheusName: "aws_rds_select_latency",
prometheusHelp: "SelectLatency",
},
{
cwName: "SelectThroughput",
prometheusName: "aws_rds_select_throughput_average",
prometheusName: "aws_rds_select_throughput",
prometheusHelp: "SelectThroughput",
},
{
cwName: "SwapUsage",
prometheusName: "aws_rds_swap_usage_average",
prometheusName: "aws_rds_swap_usage",
prometheusHelp: "The amount of swap space used on the DB instance. Units: Bytes",
},
{
cwName: "UpdateLatency",
prometheusName: "aws_rds_update_latency_average",
prometheusName: "aws_rds_update_latency",
prometheusHelp: "UpdateLatency",
},
{
cwName: "UpdateThroughput",
prometheusName: "aws_rds_update_throughput_average",
prometheusName: "aws_rds_update_throughput",
prometheusHelp: "UpdateThroughput",
},
{
cwName: "VolumeBytesUsed",
prometheusName: "aws_rds_volume_bytes_used_average",
prometheusName: "aws_rds_volume_bytes_used",
prometheusHelp: "VolumeBytesUsed",
},
{
cwName: "VolumeReadIOPs",
prometheusName: "aws_rds_volume_read_io_ps_average",
prometheusName: "aws_rds_volume_read_io_ps",
prometheusHelp: "VolumeReadIOPs",
},
{
cwName: "VolumeWriteIOPs",
prometheusName: "aws_rds_volume_write_io_ps_average",
prometheusName: "aws_rds_volume_write_io_ps",
prometheusHelp: "VolumeWriteIOPs",
},
{
cwName: "WriteIOPS",
prometheusName: "aws_rds_write_iops_average",
prometheusName: "aws_rds_write_iops",
prometheusHelp: "The average number of disk I/O operations per second. Units: Count/Second",
},
{
cwName: "WriteLatency",
prometheusName: "aws_rds_write_latency_average",
prometheusName: "aws_rds_write_latency",
prometheusHelp: "The average amount of time taken per disk I/O operation. Units: Seconds",
},
{
cwName: "WriteThroughput",
prometheusName: "aws_rds_write_throughput_average",
prometheusName: "aws_rds_write_throughput",
prometheusHelp: "The average number of bytes written to disk per second. Units: Bytes/Second",
},
{
Expand Down
Loading

0 comments on commit 71e5cf0

Please sign in to comment.