Documentation
¶
Index ¶
- Constants
- func ApplyConfig(proposedConfig *agent.ProposedConfigResponse, clients *AWSClients, ...) error
- func DetectConfigFromEnv() bool
- func FetchAWSConfig(AWSAccessKey string, AWSSecretAccessKey string, AWSRegion string, ...) (aws.Config, error)
- func GetCPUUtilization(databaseIdentifier string, clients *AWSClients) (float64, error)
- func GetFreeableMemoryFromCW(databaseIdentifier string, clients *AWSClients) (uint64, error)
- func GetMemoryUsageFromPI(clients *AWSClients, resourceID string, logger *logrus.Logger) (uint64, error)
- func GetReadIOPS(databaseIdentifier string, clients *AWSClients) (float64, error)
- func GetWriteIOPS(databaseIdentifier string, clients *AWSClients) (float64, error)
- func RDSHardwareInfo(databaseIdentifier string, state *State, clients *AWSClients, ...) func(ctx context.Context, metric_state *agent.MetricsState) error
- type AWSClients
- type AuroraRDSAdapter
- type Config
- type DBInfo
- func (info *DBInfo) ParameterGroupStatus(name string) *rdsTypes.DBParameterGroupStatus
- func (info *DBInfo) PerformanceInsightsEnabled() bool
- func (info *DBInfo) ResourceID() (string, error)
- func (info *DBInfo) TotalMemoryBytes() (uint64, error)
- func (info *DBInfo) TryIntoFlatValuesSlice() ([]metrics.FlatValue, error)
- func (info *DBInfo) VCPUs() (uint32, error)
- type DetectedConfig
- type IOPSResult
- type RDSAdapter
- func (adapter *RDSAdapter) ApplyConfig(proposedConfig *agent.ProposedConfigResponse) error
- func (adapter *RDSAdapter) Collectors(aurora bool) []agent.MetricCollector
- func (adapter *RDSAdapter) GetActiveConfig() (agent.ConfigArraySchema, error)
- func (adapter *RDSAdapter) GetSystemInfo() ([]metrics.FlatValue, error)
- func (adapter *RDSAdapter) Guardrails() *guardrails.Signal
- type RDSDatapointConstraint
- type State
Constants ¶
View Source
const ( RDS_CONFIG_KEY = "rds" AURORA_CONFIG_KEY = "rds-aurora" )
Variables ¶
This section is empty.
Functions ¶
func ApplyConfig ¶
func ApplyConfig( proposedConfig *agent.ProposedConfigResponse, clients *AWSClients, parameterGroupName string, databaseIdentifier string, logger *logrus.Logger, ctx context.Context, ) error
func DetectConfigFromEnv ¶
func DetectConfigFromEnv() bool
func FetchAWSConfig ¶
func GetCPUUtilization ¶
func GetCPUUtilization( databaseIdentifier string, clients *AWSClients, ) (float64, error)
func GetFreeableMemoryFromCW ¶
func GetFreeableMemoryFromCW( databaseIdentifier string, clients *AWSClients, ) (uint64, error)
GetFreeableMemoryFromCW retrieves freeable memory (bytes) using CloudWatch
func GetMemoryUsageFromPI ¶
func GetMemoryUsageFromPI( clients *AWSClients, resourceID string, logger *logrus.Logger, ) (uint64, error)
GetMemoryUsageFromPI retrieves memory usage (bytes) using Performance Insights
func GetReadIOPS ¶
func GetReadIOPS( databaseIdentifier string, clients *AWSClients, ) (float64, error)
func GetWriteIOPS ¶
func GetWriteIOPS( databaseIdentifier string, clients *AWSClients, ) (float64, error)
func RDSHardwareInfo ¶
func RDSHardwareInfo( databaseIdentifier string, state *State, clients *AWSClients, logger *logrus.Logger, ) func(ctx context.Context, metric_state *agent.MetricsState) error
RDSHardwareInfo collects hardware metrics from RDS instance using the Performance Insights API or the CloudWatch API
Types ¶
type AWSClients ¶
type AWSClients struct {
EC2Client *ec2.Client
RDSClient *rdsclient.Client
PIClient *pi.Client
CloudwatchClient *cloudwatch.Client
}
func NewAWSClients ¶
func NewAWSClients(cfg aws.Config) AWSClients
type AuroraRDSAdapter ¶
type AuroraRDSAdapter struct {
RDSAdapter
}
NOTE: For now, Aurora doesn't deviate from RDS in any functional way via API or how we query things. If it were to change, we can expand upon this.
func CreateAuroraRDSAdapter ¶
func CreateAuroraRDSAdapter() (*AuroraRDSAdapter, error)
type Config ¶
type Config struct {
AWSAccessKey string `mapstructure:"AWS_ACCESS_KEY_ID"`
AWSSecretAccessKey string `mapstructure:"AWS_SECRET_ACCESS_KEY"`
AWSRegion string `mapstructure:"AWS_REGION" validate:"required"`
RDSDatabaseIdentifier string `mapstructure:"RDS_DATABASE_IDENTIFIER" validate:"required"`
RDSParameterGroupName string `mapstructure:"RDS_PARAMETER_GROUP_NAME" validate:"required"`
}
For now, this suffices for both RDS and AuroraRDS.
func ConfigFromViper ¶
type DBInfo ¶
type DBInfo struct {
DBInstance rdsTypes.DBInstance
EC2InstanceType ec2types.InstanceType
EC2InstanceTypeInfo ec2types.InstanceTypeInfo
}
func FetchDBInfo ¶
func (*DBInfo) ParameterGroupStatus ¶
func (info *DBInfo) ParameterGroupStatus(name string) *rdsTypes.DBParameterGroupStatus
func (*DBInfo) PerformanceInsightsEnabled ¶
func (*DBInfo) ResourceID ¶
func (*DBInfo) TotalMemoryBytes ¶
func (*DBInfo) TryIntoFlatValuesSlice ¶
type DetectedConfig ¶
type DetectedConfig string
const ( // Aurora was detected from the configuration. Aurora DetectedConfig = "aurora" // RDS was detected from the configuration. RDS DetectedConfig = "rds" // Neither was detected, it's something else. None DetectedConfig = "none" )
func DetectConfigFromConfigFile ¶
func DetectConfigFromConfigFile() DetectedConfig
type IOPSResult ¶
func GetIOPS ¶
func GetIOPS( databaseIdentifier string, clients *AWSClients, ) (IOPSResult, error)
type RDSAdapter ¶
type RDSAdapter struct {
agent.CommonAgent
Config Config
GuardrailSettings guardrails.Config
State State
AWSClients AWSClients
PGDriver *pgxpool.Pool
PGVersion string
// contains filtered or unexported fields
}
func CreateRDSAdapter ¶
func CreateRDSAdapter(configKey *string) (*RDSAdapter, error)
func CreateRDSAdapterWithoutCollectors ¶ added in v0.4.0
func CreateRDSAdapterWithoutCollectors(configKey *string) (*RDSAdapter, error)
func (*RDSAdapter) ApplyConfig ¶
func (adapter *RDSAdapter) ApplyConfig(proposedConfig *agent.ProposedConfigResponse) error
func (*RDSAdapter) Collectors ¶
func (adapter *RDSAdapter) Collectors(aurora bool) []agent.MetricCollector
func (*RDSAdapter) GetActiveConfig ¶
func (adapter *RDSAdapter) GetActiveConfig() (agent.ConfigArraySchema, error)
func (*RDSAdapter) GetSystemInfo ¶
func (adapter *RDSAdapter) GetSystemInfo() ([]metrics.FlatValue, error)
func (*RDSAdapter) Guardrails ¶
func (adapter *RDSAdapter) Guardrails() *guardrails.Signal
Guardrails checks memory utilization and returns Critical if thresholds are exceeded
type RDSDatapointConstraint ¶
RDSDatapointConstraint is a type constraint that allows either types.Datapoint or pi.DataPoint
Click to show internal directories.
Click to hide internal directories.