prom

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendError

func SendError(w http.ResponseWriter, r *http.Request, msg string, code int, notPromHandler NotPromHandlerFunc)

SendError sends a Prometheus compatible error message and logs

Types

type Error

type Error struct {
	Status    string                 `json:"status"`
	Data      map[string]interface{} `json:"datay"`
	ErrorType string                 `json:"error_type"`
	Error     string                 `json:"error"`
	Warnings  []string               `json:"warnings"`
}

Error Struct for a Prometheus error

type NotPromHandlerFunc

type NotPromHandlerFunc func(w http.ResponseWriter, r *http.Request, msg string, code int)

NotPromHandlerFunc is a function that is called if the error message is not displayed in Prometheus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL