Documentation
¶
Overview ¶
Package config contains the configuration for the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ResourceTypeToMetricName = map[ResourceType]string{ Unknown: "unknown", Deployment: "deployment", StatefulSet: "statefulset", Pod: "pod", Node: "node", Namespace: "namespace", Job: "job", CronJob: "cronjob", DaemonSet: "daemonset", }
Functions ¶
This section is empty.
Types ¶
type Annotations ¶
type Annotations struct {
Enabled bool `yaml:"enabled" default:"false" env:"ANNOTATIONS_ENABLED" env-description:"enable annotations"`
Resources Resources `yaml:"resources"`
Patterns []string `yaml:"patterns" env:"ANNOTATIONS_FILTERS" env-description:"list of annotations regular expressions to filter"`
}
type Certificate ¶
type Database ¶
type Database struct {
Enabled bool `` /* 150-byte string literal not displayed */
StoragePath string `yaml:"storage_path" default:"/opt/insights" env:"DATABASE_STORAGE_PATH" env-description:"location where to write database"`
RetentionTime time.Duration `` /* 136-byte string literal not displayed */
CleanupInterval time.Duration `yaml:"cleanup_interval" default:"3h" env:"DATABASE_CLEANUP_INTERVAL" env-description:"how often to check for expired data"`
BatchUpdateSize int `` /* 134-byte string literal not displayed */
}
type Files ¶
type Files []string
Files is a custom flag type to handle multiple configuration files
type Filters ¶
type Filters struct {
Labels Labels `yaml:"labels"`
Annotations Annotations `yaml:"annotations"`
Policy bluemonday.Policy
}
type Logging ¶
type Logging struct {
Level string `yaml:"level" default:"info" env:"LOG_LEVEL" env-description:"logging level such as debug, info, error"`
}
type MetricLabelTags ¶
MetricLabelTags represents metric labels attached to a metric that represent annotations or labels; value must be prefixed with "label_"
type MetricLabels ¶
MetricLabels represents any metric label that can be added to a metric; "pod", "namespace", "label_foo" etc.
type RemoteWrite ¶
type RemoteWrite struct {
Host string
MaxBytesPerSend int `` /* 129-byte string literal not displayed */
SendInterval time.Duration `yaml:"send_interval" default:"60s" env:"SEND_INTERVAL" env-description:"interval in seconds to send data"`
SendTimeout time.Duration `yaml:"send_timeout" default:"30s" env:"SEND_TIMEOUT" env-description:"timeout in seconds to send data"`
MaxRetries int `yaml:"max_retries" default:"3" env:"MAX_RETRIES" env-description:"maximum number of retries"`
// contains filtered or unexported fields
}
type ResourceType ¶
type ResourceType int
const ( Unknown ResourceType = 0 Deployment ResourceType = 1 StatefulSet ResourceType = 2 Pod ResourceType = 3 Node ResourceType = 4 Namespace ResourceType = 5 Job ResourceType = 6 CronJob ResourceType = 7 DaemonSet ResourceType = 8 )
type Resources ¶
type Resources struct {
Pods bool `yaml:"pods" default:"true"`
Namespaces bool `yaml:"namespaces" default:"true"`
Deployments bool `yaml:"deployments" default:"false"`
Jobs bool `yaml:"jobs" default:"false"`
CronJobs bool `yaml:"cronjobs" default:"false"` //nolint:tagliatelle // compatibility
StatefulSets bool `yaml:"statefulsets" default:"false"` //nolint:tagliatelle // compatibility
DaemonSets bool `yaml:"daemonsets" default:"false"` //nolint:tagliatelle // compatibility
Nodes bool `yaml:"nodes" default:"false"`
}
type Server ¶
type Server struct {
Port string `yaml:"port" default:"8080" env:"PORT" env-description:"port to listen on"`
ReadTimeout time.Duration `yaml:"read_timeout" default:"15s" env:"READ_TIMEOUT" env-description:"server read timeout in seconds"`
WriteTimeout time.Duration `yaml:"write_timeout" default:"15s" env:"WRITE_TIMEOUT" env-description:"server write timeout in seconds"`
IdleTimeout time.Duration `yaml:"idle_timeout" default:"60s" env:"IDLE_TIMEOUT" env-description:"server idle timeout in seconds"`
}
type Settings ¶
type Settings struct {
CloudAccountID string `yaml:"cloud_account_id" env:"CLOUD_ACCOUNT_ID" env-description:"CSP account ID"`
Region string `yaml:"region" env:"CSP_REGION" env-description:"cloud service provider region"`
ClusterName string `yaml:"cluster_name" env:"CLUSTER_NAME" env-description:"name of the cluster to monitor"`
Destination string `` /* 143-byte string literal not displayed */
APIKeyPath string `yaml:"api_key_path" env:"API_KEY_PATH" env-description:"path to the API key file"`
Server Server `yaml:"server"`
Certificate Certificate `yaml:"certificate"`
Logging Logging `yaml:"logging"`
Database Database `yaml:"database"`
Filters Filters `yaml:"filters"`
RemoteWrite RemoteWrite `yaml:"remote_write"`
K8sClient K8sClient `yaml:"k8s_client"`
LabelMatches []regexp.Regexp
AnnotationMatches []regexp.Regexp
// contains filtered or unexported fields
}
Settings represents the configuration settings for the application.
func NewSettings ¶
Click to show internal directories.
Click to hide internal directories.