cockroach: Index | Files | Directories

package debug

import ""


Package Files

logspy.go server.go


const Endpoint = "/debug/"

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


var DebugRemote = func() *settings.StringSetting {
    s := settings.RegisterValidatedStringSetting(
        "set to enable remote debugging, localhost-only or disable (any, local, off)",
        func(sv *settings.Values, s string) error {
            switch RemoteMode(strings.ToLower(s)) {
            case RemoteOff, RemoteLocal, RemoteAny:
                return nil
                return errors.Errorf("invalid mode: '%s'", s)
    return 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, hbaConfDebugFn http.HandlerFunc) *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.



Package debug imports 27 packages (graph) and is imported by 9 packages. Updated 2020-02-16. Refresh now. Tools for package owners.