metrics

package
v0.0.0-...-6fa2f19 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActiveHttpRequests = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Name: "gandalf_http_requests_active",
		Help: "Number of active http requests.",
	}, []string{})
View Source
var HttpRequestsHeaderFilter = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "gandalf_http_requests_header_filter",
		Help: "Number of total vulnerable http requests.",
	}, []string{"app", "scheme", "code"})
View Source
var HttpRequestsIpBlacklist = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "gandalf_http_requests_ip_blacklist",
		Help: "Number of total vulnerable http requests.",
	}, []string{"app", "scheme", "code"})
View Source
var HttpRequestsIpWhitelist = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "gandalf_http_requests_ip_whitelist",
		Help: "Number of total vulnerable http requests.",
	}, []string{"app", "scheme", "code"})
View Source
var HttpRequestsPathFiler = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "gandalf_http_requests_path_filter",
		Help: "Number of total vulnerable http requests.",
	}, []string{"app", "scheme", "code"})
View Source
var HttpRequestsSQLInjectionVulnerable = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "gandalf_http_requests_sqlinjection_vulnerable",
		Help: "Number of total vulnerable http requests.",
	}, []string{"app", "scheme", "code"})
View Source
var HttpRequestsTotal = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "gandalf_http_requests_total",
		Help: "Number of total http requests.",
	}, []string{"app", "scheme", "code"})
View Source
var HttpRequestsTotalVulnerable = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "gandalf_http_requests_total_vulnerable",
		Help: "Number of total vulnerable http requests.",
	}, []string{"app", "scheme", "code"})
View Source
var HttpRequestsXSSVulnerable = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "gandalf_http_requests_xss_vulnerable",
		Help: "Number of total vulnerable http requests.",
	}, []string{"app", "scheme", "code"})

Functions

func FastHttpHandle

func FastHttpHandle() fasthttp.RequestHandler

func Init

func Init()

func NetHttpHandle

func NetHttpHandle()

Types

type ConnectionWatcher

type ConnectionWatcher struct {
	// contains filtered or unexported fields
}

func (*ConnectionWatcher) Count

func (cw *ConnectionWatcher) Count() int

Count returns the number of connections at the time the call.

func (*ConnectionWatcher) OnStateChangeForFastHttp

func (cw *ConnectionWatcher) OnStateChangeForFastHttp(conn net.Conn, state fasthttp.ConnState)

OnStateChange records open connections in response to connection state changes. Set net/http Server.ConnState to this method as value.

func (*ConnectionWatcher) OnStateChangeForNetHttp

func (cw *ConnectionWatcher) OnStateChangeForNetHttp(conn net.Conn, state http.ConnState)

Jump to

Keyboard shortcuts

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