Documentation ¶
Index ¶
- Constants
- Variables
- func GetConfigfileLocation(filename string) string
- func GetConfiguredCipherSuiteIds() []uint16
- func GetDefaultGaugeListFilename() string
- func GetExecutorsConfigFile(filename string) string
- func GetExporterBaseFolder() string
- func GetFullHost() string
- func GetPromMockResultsFile(filename string) string
- func GetSecret(secretConfig string) ([]byte, error)
- func GetValueFromBase64(b64Value string) ([]byte, error)
- func GetValueFromBase64EnvVar(envVar string) ([]byte, error)
- func GetWatchersConfigFile(filename string) string
- func GetWatchersMockResultsFile(filename string) string
- func HandleSignals()
- func InitConfigurations(config_filename string)
- func LoadCACert(certConfig string) (*x509.CertPool, error)
- func LoadServerCertAndKey(certConfig, keyConfig, keyPassConfig string) ([]tls.Certificate, error)
- func LoadServerOrClientCertificates() (*x509.CertPool, []tls.Certificate)
- func ParseStats(s, sep string) map[string]string
- func SanitizeUTF8(lv string) string
- func TryConvert(s string) (float64, error)
- func ValidateBasicAuth(r *http.Request, username string, password string) bool
- type ContextType
- type MetricType
Constants ¶
const ( METRIC_LABEL_CLUSTER_NAME = "cluster_name" METRIC_LABEL_SERVICE = "service" METRIC_LABEL_NS = "ns" METRIC_LABEL_SET = "set" METRIC_LABEL_LE = "le" METRIC_LABEL_DC_NAME = "dc" METRIC_LABEL_INDEX = "index" METRIC_LABEL_SINDEX = "sindex" METRIC_LABEL_STORAGE_ENGINE = "storage_engine" METRIC_LABEL_USER = "user" )
below constant represent the labels we send along with metrics to Prometheus or something
const ( STORAGE_ENGINE = "storage-engine" INDEX_TYPE = "index-type" SINDEX_TYPE = "sindex-type" )
constants used to identify type of metrics
const ( METRIC_LABEL_DEVICE = "device" METRIC_LABEL_MAJOR = "major_version" METRIC_LABEL_MINOR = "minor_version" METRIC_LABEL_SERIAL = "serial" METRIC_LABEL_MOUNT_POINT = "mountpoint" METRIC_LABEL_FSTYPE = "fstype" METRIC_LABEL_CPU = "cpu" METRIC_LABEL_CPU_MODE = "mode" )
const ( TESTS_DEFAULT_CONFIG_FILE = "tests_data/default_ape.toml" TESTS_USERS_CONFIG_FILE = "tests_data/users_ape.toml" TESTS_MOCK_CONFIG_FILE = "tests_data/mock_ape.toml" TESTS_DEFAULT_GAUGE_LIST_FILE = "configs/gauge_stats_list.toml" )
Variables ¶
var ( PROC_PATH = procfs.DefaultMountPoint SYS_PATH = "/sys" ROOTFS_PATH = "/" UDEV_DATA_PATH = "/run/udev/data" NET_STAT_PATH = "net/netstat" NET_DEV_STAT_PATH = "/proc/net/dev" )
var ProcessExit chan bool
OS Signal handling logic
Functions ¶
func GetConfigfileLocation ¶
func GetConfiguredCipherSuiteIds ¶ added in v1.18.0
func GetConfiguredCipherSuiteIds() []uint16
Utility method fetch the support Cipher in the Golang/OS combination
from configures ciphers in ape.toml, filters the matched and valid-ciphers Ciphers are configurable only upto TLS 1.2 version
func GetDefaultGaugeListFilename ¶
func GetDefaultGaugeListFilename() string
func GetExecutorsConfigFile ¶
func GetExporterBaseFolder ¶
func GetExporterBaseFolder() string
func GetFullHost ¶
func GetFullHost() string
func GetPromMockResultsFile ¶
func GetSecret ¶
Get secret secretConfig can be one of the following, 1. "<secret>" (secret directly) 2. "file:<file-that-contains-secret>" (file containing secret) 3. "env:<environment-variable-that-contains-secret>" (environment variable containing secret) 4. "env-b64:<environment-variable-that-contains-base64-encoded-secret>" (environment variable containing base64 encoded secret) 5. "b64:<base64-encoded-secret>" (base64 encoded secret)
func GetValueFromBase64 ¶
Get decoded base64 value
func GetValueFromBase64EnvVar ¶
Get decoded base64 value from environment variable
func GetWatchersConfigFile ¶
func HandleSignals ¶
func HandleSignals()
func InitConfigurations ¶
func InitConfigurations(config_filename string)
func LoadCACert ¶
loadCACert returns CA set of certificates (cert pool) reads CA certificate based on the certConfig and adds it to the pool
func LoadServerCertAndKey ¶
func LoadServerCertAndKey(certConfig, keyConfig, keyPassConfig string) ([]tls.Certificate, error)
loadServerCertAndKey reads server certificate and associated key file based on certConfig and keyConfig returns parsed server certificate if the private key is encrypted, it will be decrypted using key file passphrase
func LoadServerOrClientCertificates ¶
func LoadServerOrClientCertificates() (*x509.CertPool, []tls.Certificate)
func SanitizeUTF8 ¶
func TryConvert ¶
Types ¶
type ContextType ¶
type ContextType string
used to define context of stat types (like namespace, set, xdr etc.,)
const ( CTX_USERS ContextType = "users" CTX_NAMESPACE ContextType = "namespace" CTX_NODE_STATS ContextType = "node_stats" CTX_SETS ContextType = "sets" CTX_SINDEX ContextType = "sindex" CTX_XDR ContextType = "xdr" CTX_LATENCIES ContextType = "latencies" )
const ( CTX_SYSINFO_MEMORY_STATS ContextType = "sysinfo_memory_stats" CTX_SYSINFO_DISK_STATS ContextType = "sysinfo_disk_stats" CTX_SYSINFO_FILESYSTEM_STATS ContextType = "sysinfo_filesystem_stats" CTX_SYSINFO_CPU_STATS ContextType = "sysinfo_cpu" CTX_SYSINFO_NET_STATS ContextType = "sysinfo_netstat" CTX_SYSINFO_NET_DEV_STATS ContextType = "sysinfo_net_dev" CTX_SYSINFO_NETWORK_STATS ContextType = "sysinfo_network" CTX_SYSINFO_FILEFD_STATS ContextType = "sysinfo_filefd" CTX_SYSINFO_VM_STATS ContextType = "sysinfo_vmstat" )
type MetricType ¶
type MetricType byte
const ( MetricTypeGauge MetricType = 'G' MetricTypeCounter MetricType = 'C' )