mirror of
https://github.com/juanfont/headscale.git
synced 2026-03-21 13:39:03 +09:00
Deployed 18e13f6f to development with MkDocs 1.6.1 and mike 2.1.3
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
</span><span id=__span-1-5><a id=__codelineno-1-5 name=__codelineno-1-5 href=#__codelineno-1-5></a><span class=nt>log</span><span class=p>:</span>
|
||||
</span><span id=__span-1-6><a id=__codelineno-1-6 name=__codelineno-1-6 href=#__codelineno-1-6></a><span class=w> </span><span class=c1># Valid log levels: panic, fatal, error, warn, info, debug, trace</span>
|
||||
</span><span id=__span-1-7><a id=__codelineno-1-7 name=__codelineno-1-7 href=#__codelineno-1-7></a><span class=hll><span class=w> </span><span class=nt>level</span><span class=p>:</span><span class=w> </span><span class="l l-Scalar l-Scalar-Plain">debug</span>
|
||||
</span></span></code></pre></div> <h3 id=metrics-and-debug-endpoint>Metrics and debug endpoint<a class=headerlink href=#metrics-and-debug-endpoint title="Permanent link">¶</a></h3> <p>Headscale provides a metrics and debug endpoint. It allows to introspect different aspects such as:</p> <ul> <li>Information about the Go runtime, memory usage and statistics</li> <li>Connected nodes and pending registrations</li> <li>Active ACLs, filters and SSH policy</li> <li>Current DERPMap</li> <li>Prometheus metrics</li> </ul> <div class="admonition warning"> <p class=admonition-title>Keep the metrics and debug endpoint private</p> <p>The listen address and port can be configured with the <code>metrics_listen_addr</code> variable in the <a href=../configuration/ >configuration file</a>. By default it listens on localhost, port 9090.</p> <p>Keep the metrics and debug endpoint private to your internal network and don't expose it to the Internet.</p> </div> <p>Query metrics via <a href=http://localhost:9090/metrics>http://localhost:9090/metrics</a> and get an overview of available debug information via <a href=http://localhost:9090/debug/ >http://localhost:9090/debug/</a>. Metrics may be queried from outside localhost but the debug interface is subject to additional protection despite listening on all interfaces.</p> <div class="tabbed-set tabbed-alternate" data-tabs=1:4><input checked=checked id=__tabbed_1_1 name=__tabbed_1 type=radio><input id=__tabbed_1_2 name=__tabbed_1 type=radio><input id=__tabbed_1_3 name=__tabbed_1 type=radio><input id=__tabbed_1_4 name=__tabbed_1 type=radio><div class=tabbed-labels><label for=__tabbed_1_1>Direct access</label><label for=__tabbed_1_2>SSH port forwarding</label><label for=__tabbed_1_3>Via debug key</label><label for=__tabbed_1_4>Via debug IP address</label></div> <div class=tabbed-content> <div class=tabbed-block> <p>Access the debug interface directly on the server where Headscale is installed.</p> <div class="language-console highlight"><pre><span></span><code><span id=__span-2-1><a id=__codelineno-2-1 name=__codelineno-2-1 href=#__codelineno-2-1></a><span class=go>curl http://localhost:9090/debug/</span>
|
||||
</span></span></code></pre></div> <h3 id=metrics-and-debug-endpoint>Metrics and debug endpoint<a class=headerlink href=#metrics-and-debug-endpoint title="Permanent link">¶</a></h3> <p>Headscale provides a metrics and debug endpoint. It allows to introspect different aspects such as:</p> <ul> <li>Information about the Go runtime, memory usage and statistics</li> <li>Connected nodes and pending registrations</li> <li>Active ACLs, filters and SSH policy</li> <li>Current DERPMap</li> <li>Prometheus metrics</li> </ul> <div class="admonition warning"> <p class=admonition-title>Keep the metrics and debug endpoint private</p> <p>The listen address and port can be configured with the <code>metrics_listen_addr</code> variable in the <a href=../configuration/ >configuration file</a>. By default it listens on localhost, port 9090.</p> <p>Keep the metrics and debug endpoint private to your internal network and don't expose it to the Internet.</p> <p>The metrics and debug interface can be disabled completely by setting <code>metrics_listen_addr: null</code> in the <a href=../configuration/ >configuration file</a>.</p> </div> <p>Query metrics via <a href=http://localhost:9090/metrics>http://localhost:9090/metrics</a> and get an overview of available debug information via <a href=http://localhost:9090/debug/ >http://localhost:9090/debug/</a>. Metrics may be queried from outside localhost but the debug interface is subject to additional protection despite listening on all interfaces.</p> <div class="tabbed-set tabbed-alternate" data-tabs=1:4><input checked=checked id=__tabbed_1_1 name=__tabbed_1 type=radio><input id=__tabbed_1_2 name=__tabbed_1 type=radio><input id=__tabbed_1_3 name=__tabbed_1 type=radio><input id=__tabbed_1_4 name=__tabbed_1 type=radio><div class=tabbed-labels><label for=__tabbed_1_1>Direct access</label><label for=__tabbed_1_2>SSH port forwarding</label><label for=__tabbed_1_3>Via debug key</label><label for=__tabbed_1_4>Via debug IP address</label></div> <div class=tabbed-content> <div class=tabbed-block> <p>Access the debug interface directly on the server where Headscale is installed.</p> <div class="language-console highlight"><pre><span></span><code><span id=__span-2-1><a id=__codelineno-2-1 name=__codelineno-2-1 href=#__codelineno-2-1></a><span class=go>curl http://localhost:9090/debug/</span>
|
||||
</span></code></pre></div> </div> <div class=tabbed-block> <p>Use SSH port forwarding to forward Headscale's metrics and debug port to your device.</p> <div class="language-console highlight"><pre><span></span><code><span id=__span-3-1><a id=__codelineno-3-1 name=__codelineno-3-1 href=#__codelineno-3-1></a><span class=go>ssh <HEADSCALE_SERVER> -L 9090:localhost:9090</span>
|
||||
</span></code></pre></div> <p>Access the debug interface on your device by opening <a href=http://localhost:9090/debug/ >http://localhost:9090/debug/</a> in your web browser.</p> </div> <div class=tabbed-block> <p>The access control of the debug interface supports the use of a debug key. Traffic is accepted if the path to a debug key is set via the environment variable <code>TS_DEBUG_KEY_PATH</code> and the debug key sent as value for <code>debugkey</code> parameter with each request.</p> <div class="language-console highlight"><pre><span></span><code><span id=__span-4-1><a id=__codelineno-4-1 name=__codelineno-4-1 href=#__codelineno-4-1></a><span class=go>openssl rand -hex 32 | tee debugkey.txt</span>
|
||||
</span><span id=__span-4-2><a id=__codelineno-4-2 name=__codelineno-4-2 href=#__codelineno-4-2></a><span class=go>export TS_DEBUG_KEY_PATH=debugkey.txt</span>
|
||||
|
||||
Reference in New Issue
Block a user