Back to Consul

Debug/Engineering Utilities

ui/packages/consul-ui/docs/bookmarklets.mdx

1.22.76.1 KB
Original Source

Debug/Engineering Utilities

The Consul UI has a set of debug/engineering utility functions that only exist in non-production environments (they are noop'ed from production builds using Ember's runInDebug). You can call these either straight from Web Inspectors console, or by using javascript: URLs i.e. javascript:Routes().

Below is a list of the most commonly used functions as bookmarklets followed by more detailed documentation on these utilities. The bookmarklets can be added to your browser by dragging the bookmarklet link into your browsers Bookmarks Bar. Please add any new commonly used environment variables as bookmarklets here for other engineers to use.

Link/BookmarkletDescription
Print Routing DSLPrint out Ember's Route DSL for the application
Save Current ScenarioOpens a tab with links to allow you to create a bookmarklet or share a URL of your current scenario (your Consul UI related development/debug cookies)
Toggle Color SchemeToggle Color Scheme from light to dark or vice versa
Enable ACLsEnable ACLs
Enable AgentlessEnable synthetic nodes (agentless) in the mock data
Enable TProxyEnable TProxy
Enable NspacesEnable Namespace Support
Enable PeersEnable Peering Support
Enable PartitionsEnable Admin Partition Support
Enable SSOEnable SSO Support
Enable MetricsEnable all configuration required for viewing the full Metrics Visualization
Enable Intl DebugRender intl interpolation variable names instead of interpolating them
Intl Lorem IpsumRender all intl copy as lorem ipsum
Intl DashesRender all intl copy as -
Toggle QUnit DisplayToggle the QUnit display on or off during browser testing
FunctionArgumentsDescription
Routes(url)url: The url to pass the DSL to, if left undefined just use a blank tabProvides a way to easily print out Embers Route DSL for the application or to pass it straight to any third party utility such as ember-diagonal
Scenario(str)str: 'Cookie formatted' string, if left undefined open a new tab with a link/bookmarklet to the current ScenarioProvides a way to easily save and reload scenarios of configurations via URLs or bookmarklets

You can also configure these manually or example using Web Inspector to set a cookie as follows:

bash
CONSUL_ACLS_ENABLE=1

This will enable the ACLs login page, to which you can login with any ACL token/secret.

VariableDefault ValueDescription
CONSUL_ACLS_ENABLEfalseEnable/disable ACLs support.
CONSUL_ACLS_LEGACYfalseEnable/disable legacy ACLs support.
CONSUL_AGENTLESS_ENABLEfalseEnable/disable synthetic nodes (agentless) in the mock data.
CONSUL_TPROXY_ENABLEfalseEnable/disable TProxy support globally (if not a service may have this applied randomly).
CONSUL_NSPACES_ENABLEfalseEnable/disable Namespace support.
CONSUL_SSO_ENABLEfalseEnable/disable SSO support.
CONSUL_OIDC_PROVIDER_URLundefinedProvide a OIDC provider URL for SSO.
CONSUL_LATENCY0Add a latency to network requests (milliseconds)
CONSUL_METRICS_POLL_INTERVAL10000Change the interval between requests to the metrics provider (milliseconds)
CONSUL_METRICS_PROXY_ENABLEfalseEnable/disable the metrics proxy
CONSUL_METRICS_PROVIDERSet the metrics provider to use for the Topology Tab
CONSUL_SERVICE_DASHBOARD_URLSet the template URL to use for Service Dashboard links
CONSUL_UI_CONFIGSet the entire ui_config for the UI as JSON if you don't want to use the above singular variables
CONSUL_SERVICE_COUNT(random)Configure the number of services that the API returns.
CONSUL_NODE_COUNT(random)Configure the number of nodes that the API returns.
CONSUL_KV_COUNT(random)Configure the number of KV entires that the API returns.
CONSUL_INTENTION_COUNT(random)Configure the number of intentions that the API returns.
CONSUL_POLICY_COUNT(random)Configure the number of policies that the API returns.
CONSUL_ROLE_COUNT(random)Configure the number of roles that the API returns.
CONSUL_NSPACE_COUNT(random)Configure the number of namespaces that the API returns.
CONSUL_UPSTREAM_COUNT(random)Configure the number of upstreams that the API returns.
CONSUL_EXPOSED_COUNT(random)Configure the number of exposed paths that the API returns.
CONSUL_CHECK_COUNT(random)Configure the number of health checks that the API returns.
CONSUL_OIDC_PROVIDER_COUNT(random)Configure the number of OIDC providers that the API returns.
CONSUL_RESOURCE_<singular-resource-name>_<access-type>trueConfigure permissions e.g CONSUL_RESOURCE_INTENTION_WRITE=false.
DEBUG_ROUTES_ENDPOINTundefinedWhen using the window.Routes() debug utility (see utility functions), use a URL to pass the route DSL to. %s in the URL will be replaced with the route DSL - http://url.com?routes=%s

See ./mock-api for more details.