MCPcopy Create free account
hub / github.com/efficientgo/e2e / SetConfigEncoded

Method SetConfigEncoded

monitoring/monitoring.go:93–107  ·  view source on GitHub ↗
(config []byte)

Source from the content-addressed store, hash-verified

91}
92
93func (p *Prometheus) SetConfigEncoded(config []byte) error {
94 if p.BuildErr() != nil {
95 return p.BuildErr()
96 }
97
98 if err := os.WriteFile(filepath.Join(p.Dir(), "prometheus.yml"), config, 0600); err != nil {
99 return errors.Wrap(err, "creating prom config failed")
100 }
101
102 if p.IsRunning() {
103 // Reload configuration.
104 return p.Exec(e2e.NewCommand("kill", "-SIGHUP", "1"))
105 }
106 return nil
107}
108
109func (p *Prometheus) SetConfig(config promconfig.Config) error {
110 b, err := yaml.Marshal(config)

Callers 2

TestExampleAppFunction · 0.95
SetConfigMethod · 0.95

Calls 5

NewCommandFunction · 0.92
BuildErrMethod · 0.65
DirMethod · 0.65
IsRunningMethod · 0.65
ExecMethod · 0.65

Tested by 1

TestExampleAppFunction · 0.76