echo

package module
v0.0.0-...-241e586 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Namespace: "echo",
	Subsystem: "http",
	Buckets: []float64{
		0.0005,
		0.001,
		0.002,
		0.005,
		0.01,
		0.02,
		0.05,
		0.1,
		0.2,
		0.5,
		1.0,
		2.0,
		5.0,
		10.0,
		15.0,
		20.0,
		30.0,
	},
	NormalizeHTTPStatus: true,
	Domain:              "unk",
	Scope:               "http",
	Version:             "0.0.0.0",
}

DefaultConfig has the default instrumentation config

Functions

func MetricsMiddleware

func MetricsMiddleware() echo.MiddlewareFunc

MetricsMiddleware returns an echo middleware with default config for instrumentation.

func MetricsMiddlewareWithConfig

func MetricsMiddlewareWithConfig(config Config) echo.MiddlewareFunc

MetricsMiddlewareWithConfig returns an echo middleware for instrumentation.

Types

type Config

type Config struct {
	Namespace           string
	Buckets             []float64
	Subsystem           string
	NormalizeHTTPStatus bool
	Version             string
	Scope               string
	Domain              string
}

Config responsible to configure middleware

func NewConfig

func NewConfig() Config

NewConfig returns a new config with default values

Jump to

Keyboard shortcuts

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