listener

package
v0.0.0-...-a152f19 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyNewTransformers

func ApplyNewTransformers(r *monkit.Registry) *monkit.Registry

ApplyNewTransformers adds the default set of monkit.CallbackTransformers. This needs to happen individually for each output type and endpoint.

func NewEthernetHandle

func NewEthernetHandle(iface string) (_ gopacket.PacketDataSource, supported bool, err error)

func ProcessPackages

func ProcessPackages(workers int, PCAPIface string, address string, metricsAddress string, handler Handler)

Types

type Handler

type Handler func(ctx context.Context, unparsed *Packet, packet *pb.Packet) error

type Packet

type Packet struct {
	Payload    []byte
	Source     *net.UDPAddr
	ReceivedAt time.Time
}

type PrometheusEndpoint

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

PrometheusEndpoint includes all the information to server Prometheus compatible HTTP pages.

func NewPrometheusEndpoint

func NewPrometheusEndpoint(registry *monkit.Registry) *PrometheusEndpoint

NewPrometheusEndpoint creates an initialized PrometheusEndpoint.

func (*PrometheusEndpoint) PrometheusMetrics

func (server *PrometheusEndpoint) PrometheusMetrics(w http.ResponseWriter, r *http.Request)

PrometheusMetrics writes monkit data in https://prometheus.io/docs/instrumenting/exposition_formats/.

Jump to

Keyboard shortcuts

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