INNER CODE UNIT · Go
jobConfig
cri-o/cri-o · contrib/metrics-exporter/main.go:116
func jobConfig(name string) string {
return fmt.Sprintf(`- job_name: "cri-o-exporter-%s"
scrape_interval: 1s
metrics_path: /%s
static_configs:
- targets: ["%s.%s"]
labels:
instance: %q`, name, name, service, namespace, name)
}
type handler struct {
ip string
}
func (h *handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
metricsEndpoint := url.URL{
Scheme: "http",
Host: net.JoinHostPort(