debug

package
v0.0.0-...-0123b22 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 29 Imported by: 5

Documentation

Overview

Deprecated: Use storj.io/common/debug instead.

Package debug implements debug server for satellite, storage node, and edge services.

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("debug")

Error is default error class for debug package.

Top is a specific registry exposed over the /top endpoint. can be used to publish any high-cardinality event on local HTTP.

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 ServeTop

func ServeTop(w http.ResponseWriter, r *http.Request)

ServeTop returns all the counters from memory since the last (global) request.

Types

type Button

type Button struct {
	Slug string
	Name string
	Call func(progress io.Writer) error
}

Button defines a clickable button.

type ButtonGroup

type ButtonGroup struct {
	Slug    string
	Name    string
	Buttons []*Button
}

ButtonGroup contains description of a collection of buttons.

func Cycle

func Cycle(name string, cycle *sync2.Cycle) *ButtonGroup

Cycle returns button group for a cycle.

type Config

type Config struct {
	Addr string `help:"address to listen on for debug endpoints" default:"127.0.0.1:0"`

	ControlTitle string `hidden:"true"`
	Control      bool   `releaseDefault:"false" devDefault:"true" hidden:"true"`

	Crawlspace bool `help:"if true, enable crawlspace on debug port" default:"false" hidden:"true"`
}

Config defines configuration for debug server.

type Panel

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

Panel implements a serving of customized callbacks.

func NewPanel

func NewPanel(log *zap.Logger, url, name string) *Panel

NewPanel creates a new panel.

func (*Panel) Add

func (panel *Panel) Add(cats ...*ButtonGroup)

Add adds a button group to the panel.

func (*Panel) ServeHTTP

func (panel *Panel) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves buttons on the prefix and on other endpoints calls the specified call.

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/.

type Server

type Server struct {
	Panel *Panel

	PrometheusEndpoint *PrometheusEndpoint
	// contains filtered or unexported fields
}

Server provides endpoints for debugging.

func NewServer

func NewServer(log *zap.Logger, listener net.Listener, registry *monkit.Registry, config Config) *Server

NewServer returns a new debug.Server.

func NewServerWithAtomicLevel

func NewServerWithAtomicLevel(log *zap.Logger, listener net.Listener, registry *monkit.Registry, config Config, atomicLevel *zap.AtomicLevel) *Server

NewServerWithAtomicLevel returns a new debug.Server with logging endpoint enabled.

func (*Server) Close

func (server *Server) Close() error

Close closes server and underlying listener.

func (*Server) Run

func (server *Server) Run(ctx context.Context) error

Run starts the debug endpoint.

Jump to

Keyboard shortcuts

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