INNER CODE UNIT · Go

func

cri-o/cri-o · contrib/metrics-exporter/main.go:130

func (h *handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
	metricsEndpoint := url.URL{
		Scheme: "http",
		Host: net.JoinHostPort(
			h.ip, env.Default("CRIO_METRICS_PORT", "9090"),
		),
		Path: "/metrics",
	}

	metricsReq, err := http.NewRequestWithContext(
		req.Context(),
		http.MethodGet,
		metricsEndpoint.String(),
		http.NoBody,
	)
	if err != nil {
		logrus.Errorf(
			"Unable to create metrics request %s: %v",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…