cockroach: github.com/cockroachdb/cockroach/pkg/server/debug Index | Files | Directories

package debug

import "github.com/cockroachdb/cockroach/pkg/server/debug"

Index

Package Files

logspy.go server.go

Constants

const Endpoint = "/debug/"

Endpoint is the entry point under which the debug tools are housed.

Variables

var DebugRemote = settings.RegisterValidatedStringSetting(
    "server.remote_debugging.mode",
    "set to enable remote debugging, localhost-only or disable (any, local, off)",
    "local",
    func(sv *settings.Values, s string) error {
        switch RemoteMode(strings.ToLower(s)) {
        case RemoteOff, RemoteLocal, RemoteAny:
            return nil
        default:
            return errors.Errorf("invalid mode: '%s'", s)
        }
    },
)

DebugRemote controls which clients are allowed to access certain confidential debug pages, such as those served under the /debug/ prefix.

func GatewayRemoteAllowed Uses

func GatewayRemoteAllowed(ctx context.Context, st *cluster.Settings) bool

GatewayRemoteAllowed returns whether a request that has been passed through the grpc gateway should be allowed accessed to privileged debugging information. Because this function assumes the presence of a context field populated by the grpc gateway, it's not applicable for other uses.

type RemoteMode Uses

type RemoteMode string

RemoteMode controls who can access /debug/requests.

const (
    // RemoteOff disallows access to /debug/requests.
    RemoteOff RemoteMode = "off"
    // RemoteLocal allows only host-local access to /debug/requests.
    RemoteLocal RemoteMode = "local"
    // RemoteAny allows all access to /debug/requests.
    RemoteAny RemoteMode = "any"
)

type Server Uses

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

Server serves the /debug/* family of tools.

func NewServer Uses

func NewServer(st *cluster.Settings) *Server

NewServer sets up a debug server.

func (*Server) ServeHTTP Uses

func (ds *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves various tools under the /debug endpoint. It restricts access according to the `server.remote_debugging.mode` cluster variable.

Directories

PathSynopsis
goroutineui
pprofui

Package debug imports 27 packages (graph) and is imported by 2 packages. Updated 2019-07-15. Refresh now. Tools for package owners.