Documentation ¶
Index ¶
- Variables
- func CheckEnvs(envs []string) error
- func GenerateConfigHandler(w http.ResponseWriter, r *http.Request)
- func StartContainer(s *Service) error
- func StartRoute(w http.ResponseWriter, r *http.Request)
- func StopContainer(containerName string)
- func StopRoute(w http.ResponseWriter, r *http.Request)
- type BasicAuth
- type Config
- type Jobs
- type JsonData
- type PrometheusConfig
- type ScrapeConfigs
- type Service
- type StaticConfigs
Constants ¶
This section is empty.
Variables ¶
View Source
var DestConfigPath = "/etc/prometheus/prometheus.yml"
Functions ¶
func GenerateConfigHandler ¶
func GenerateConfigHandler(w http.ResponseWriter, r *http.Request)
func StartContainer ¶
func StartRoute ¶
func StartRoute(w http.ResponseWriter, r *http.Request)
func StopContainer ¶
func StopContainer(containerName string)
Types ¶
type Config ¶
type Config struct {
Services []Service `yaml:"services"`
}
func (*Config) LoadConfig ¶
func (*Config) SearchByName ¶
type Jobs ¶
type Jobs struct { Jobs []JsonData `json:"jobs"` Password string `json:"password"` Target string `json:"target"` Interval string `json:"interval"` Timeout string `json:"timeout"` }
func (*Jobs) ConvertToYml ¶
type PrometheusConfig ¶
type PrometheusConfig struct { Global struct { ScrapeInterval string `yaml:"scrape_interval"` ScrapeTimeout string `yaml:"scrape_timeout"` EvaluationInterval string `yaml:"evaluation_interval"` } `yaml:"global"` ScrapeConfigs []ScrapeConfigs `yaml:"scrape_configs"` }
func (*PrometheusConfig) GenerateConfig ¶
func (p *PrometheusConfig) GenerateConfig(filepath string) error
type ScrapeConfigs ¶
type ScrapeConfigs struct { JobName string `yaml:"job_name"` MetricsPath string `yaml:"metrics_path,omitempty"` ScrapeInterval string `yaml:"scrape_interval,omitempty"` ScrapeTimeout string `yaml:"scrape_timeout,omitempty"` StaticConfigs []StaticConfigs `yaml:"static_configs"` BasicAuth BasicAuth `yaml:"basic_auth,omitempty"` }
type StaticConfigs ¶
type StaticConfigs struct {
Targets []string `yaml:"targets"`
}
Click to show internal directories.
Click to hide internal directories.