Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FiberPrometheus ¶
type FiberPrometheus struct {
// contains filtered or unexported fields
}
FiberPrometheus ...
func New ¶
func New(servicename string) *FiberPrometheus
New creates a new instance of FiberPrometheus middleware servicename is available as a const label
func NewWith ¶
func NewWith(servicename, namespace, subsystem string) *FiberPrometheus
NewWith creates a new instance of FiberPrometheus middleware but with an ability to pass namespace and a custom subsystem Here servicename is created as a constant-label for the metrics Namespace, subsystem get prefixed to the metrics.
For e.g namespace = "my_app", subsyste = "http" then then metrics would be `my_app_http_requests_total{...,service= "servicename"}`
func NewWithLabels ¶
func NewWithLabels(labels map[string]string, namespace, subsystem string) *FiberPrometheus
NewWithLabels creates a new instance of FiberPrometheus middleware but with an ability to pass namespace and a custom subsystem Here labels are created as a constant-labels for the metrics Namespace, subsystem get prefixed to the metrics.
For e.g namespace = "my_app", subsystem = "http" and lables = map[string]string{"key1": "value1", "key2":"value2"} then then metrics would become `my_app_http_requests_total{...,key1= "value1", key2= "value2" }“
func (*FiberPrometheus) Middleware ¶
func (ps *FiberPrometheus) Middleware(ctx *fiber.Ctx) error
Middleware is the actual default middleware implementation
func (*FiberPrometheus) RegisterAt ¶
func (ps *FiberPrometheus) RegisterAt(app *fiber.App, url string)
RegisterAt will register the prometheus handler at a given URL