This is an AWS CDK project that deploys a collector that gathers metrics from databases and publishes them to CloudWatch and Prometheus.
- TypeScript
- Go
- AWS CDK
- Node.js
The main logic of the collector is written in Go and is located in the collector
directory. The AWS infrastructure is defined using AWS CDK in TypeScript, and the main file is lib/database-collector.ts
.
- Install the dependencies:
pnpm npm install
- Compile the TypeScript code:
pnpm run build
- Deploy the stack:
cdk deploy -c vpcId="" -c subnetIds="" -c securityGroupIds="" -c prometheusUrl="" -c exporterType=""
The collector can be configured using context variables in the AWS CDK app. Here are the available options:
vpcId
: The ID of the VPC where the collector will be deployed.subnetIds
: A comma-separated list of subnet IDs where the collector will be deployed.securityGroupIds
: A comma-separated list of security group IDs to attach to the collector.exporterType
: The type of exporter to use. Currently, only "prometheus" is supported.prometheusUrl
: The URL of the Prometheus server where the metrics will be published.