Go API Documentation

github.com/caddyserver/caddy/v2/modules/metrics

No package summary is available.

Package

Files: 2. Third party imports: 3. Imports from organisation: 0. Tests: 0. Benchmarks: 0.

Vars

Types

AdminMetrics

AdminMetrics is a module that serves a metrics endpoint so that any gathered metrics can be exposed for scraping. This module is not configurable, and is permanently mounted to the admin API endpoint at "/metrics". See the Metrics module for a configurable endpoint that is usable if the Admin API is disabled.

Field name Field type Comment
registry

*prometheus.Registry

No comment on field.
metricsHandler

http.Handler

No comment on field.

Metrics

Metrics is a module that serves a /metrics endpoint so that any gathered metrics can be exposed for scraping. This module is configurable by end-users unlike AdminMetrics.

Field name Field type Comment
metricsHandler

http.Handler

No comment on field.
DisableOpenMetrics

bool

Disable OpenMetrics negotiation, enabled by default. May be necessary if the produced metrics cannot be parsed by the service scraping metrics.

zapLogger

This type doesn't have documentation.

Field name Field type Comment
zl

*zap.Logger

No comment on field.

Functions

func (*AdminMetrics) Provision

Provision -

Uses: errors.New.

func (*AdminMetrics) Routes

Routes returns a route for the /metrics endpoint.

func (*Metrics) Provision

Provision sets up m.

Uses: errors.New.

func (*Metrics) UnmarshalCaddyfile

UnmarshalCaddyfile sets up the handler from Caddyfile tokens. Syntax:

metrics [<matcher>] {
    disable_openmetrics
}

func (*zapLogger) Println

func (AdminMetrics) CaddyModule

CaddyModule returns the Caddy module information.

func (Metrics) CaddyModule

CaddyModule returns the Caddy module information.

func (Metrics) ServeHTTP

Private functions

func createMetricsHandler

References: promhttp.HandlerFor, promhttp.HandlerOpts, promhttp.InstrumentMetricHandler.

func init

func parseCaddyfile

func serveHTTP


Tests

Files: 1. Third party imports: 0. Imports from organisation: 0. Tests: 1. Benchmarks: 0.

Test functions

TestMetricsUnmarshalCaddyfile

References: caddyfile.NewTestDispenser.