caddyprom

package module
v0.0.0-...-f2d7614 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 11 Imported by: 0

README

Prometheus metrics module for Caddy v2

This implements a Caddy v2 module that exposes metrics in the Prometheus format.

Usage

The simplest use could be in a Caddyfile like:

{
    order prometheus first
}

localhost

prometheus

Then, when using a Caddy server with this module enabled:

$ curl localhost/
$ curl localhost:9180/metrics
...
caddy_http_response_size_bytes_sum{code="418",method="get"} 42
...

License

The MIT License

Copyright (c) 2020 Dave Henderson

Documentation

Overview

Package caddyprom implements a metrics module for Caddy v2 that exports in the Prometheus text format.

The simplest use could be in a Caddyfile like:

{
    order prometheus first
}
localhost

prometheus

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	Addr string `json:"address,omitempty"`
	// contains filtered or unexported fields
}

Metrics -

func (Metrics) CaddyModule

func (Metrics) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Metrics) Provision

func (m *Metrics) Provision(ctx caddy.Context) error

Provision -

func (Metrics) ServeHTTP

func (m Metrics) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) (err error)

ServeHTTP - instrument the handler fulfils the caddyhttp.MiddlewareHandler interface

func (*Metrics) UnmarshalCaddyfile

func (m *Metrics) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile -

Jump to

Keyboard shortcuts

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