Screens Page¶
An operator works across several screens: the proxy's dashboard, each agent's dashboard, Prometheus, Grafana, and other
tools. The screens page holds them all in one browser tab, at /screens on the
proxy dashboard's port, for example http://proxy-host:8094/screens. This page is for whoever sets
the proxy up for a team: how to list the screens, link into the page, and show relayed agent dashboards, which come
through the agents' connections, when the agents are behind a firewall.
Listing Screens¶
List the screens in proxy.dashboard.screens. It's a list, so set it in a config file:
proxy.dashboard.screens = [
{ name = "agent-east", url = "http://agent-east.corp.example.com:8095/dashboard" }
{ name = "Prometheus", url = "http://prometheus.corp.example.com:9090", start = "/alerts", probe = "/-/healthy" }
{ name = "Grafana", url = ${?GRAFANA_URL}, start = "/d/overview?kiosk" }
]
Each screen has a name, which titles its tab, a url, its address, an optional start, the path it opens on,
appended to url, and an optional probe, the path the page checks it answers at, appended to url too
(below).
A proxy dashboard link into a listed tool opens in that tool's tab, beside the proxy's
dashboard in Split, rather than in a new browser tab. With Grafana listed as above, a Paths row's Grafana link opens
the row's dashboard in the Grafana tab. A link opens there when its url starts with the screen's url and continues
with a /, a ?, or nothing. Ctrl-click or Cmd-click still opens a new tab, as does a link into a tool the page doesn't
list.
The dashboard's top bar links to the page, and the port's root, http://proxy-host:8094/, leads to it. When no screens
are listed and relayed agent dashboards are off, the root leads to the proxy dashboard instead. The
root needs no login: it only redirects, and the page asks for one.
Tabs and Layouts¶
The proxy's dashboard always has the first tab, and each listed screen has a tab after it.
A tab's dot is green while its screen answers and red while it doesn't. The page checks every 5 seconds while it's
visible, with a HEAD of the screen's url, or of its probe when it has one (of /session for the proxy's tab).
The proxy's dashboard and a direct agent dashboard answer it with a 204 before any login, since it says only that
they're up. Any answer counts, but the browser logs one that isn't a success or a redirect as an error, each time: give
a tool that refuses a HEAD of its url a probe it answers, such as Prometheus's /-/healthy, since Prometheus
answers a HEAD of its pages with a 405. A pane whose screen isn't answering says so, then reloads by itself once it
answers again.
| Layout | Shows |
|---|---|
| One | the selected screen at full size |
| Split | two screens side by side, each laid out to fit its pane; shift-click a tab to put its screen on the right |
| All | every screen in a grid, each laid out at 1280×800 and scaled to its tile; click a tile's title to open it |
Switching tabs or layouts never reloads a screen, so a dashboard keeps the agent or path you selected. Each pane's Open in a tab opens its screen on its own. In All, the grid scrolls, and each screen loads once its tile comes within half a screen of the view, so the tiles around the one you scroll to are ready.
When the tabs don't fit one row, the row ends in More. It says how many screens it holds and how many of those aren't answering, such as More 28 · 2 down. It opens a list of every screen, each with its dot, and a search: type to narrow the list, Up and Down to move through it, and Enter to open a screen. Shift-click puts a screen in Split's right pane. The selected screen's tab, and in Split the right pane's, always stays in the row. A name too long for its tab shows in full in its tooltip.
Linking to a Screen¶
A link can say what the page shows, after its #:
| Link | Shows |
|---|---|
/screens#all |
Every screen in the grid |
/screens#agent-east |
One screen, as you left it, or where it starts the first time |
/screens#agent-east/connection |
One screen, at its url plus /connection, query string included, such as #proxy/activity?q=agent-rogue |
/screens#proxy/paths+grafana |
Two screens side by side, left then right |
A screen's id in a link is its name in lowercase, each run of other characters a -; the proxy's is proxy. A
relayed agent dashboard's tab answers to its agent's name the same way, so
/screens#coffee-shop-1-0 opens coffee-shop-1.0's, unless a listed screen has that id.
- A link with a path loads it, reloading a screen already open. A bare id only brings the screen up.
- A
+followed by a screen's id starts the second pane, so write a space in a query as%20, as the dashboards' search does in their address. - A link opened while the page is already open in another tab goes to that tab. The new tab closes itself, or, where the browser won't let it, says where the link went.
Framing and Logins¶
Every screen has to allow framing. The page can't tell a screen that refused it from a blank one, so such a screen looks empty; use Open in a tab for it.
| Screen | Allows framing |
|---|---|
| The proxy's dashboard | always from this page, even with proxy.dashboard.framingEnabled = false (see Exposure) |
| A direct agent dashboard | from 4.8.0, unless its agent.dashboard.framingEnabled is false |
| Prometheus | always |
| Grafana | only once allow_embedding is on, with GF_SECURITY_ALLOW_EMBEDDING=true in its environment |
The page is behind the dashboard's login, and signing in from a link into it returns to the
screen and view the link named. Signing in with no page to return to, as after Log out, opens the page too. Each
screen keeps its login, which it shows in its frame the first time. A login inside a frame works only when the screen
is on the same site as the page, a scheme and a registered domain, since the dashboards' session cookies and Grafana's
are SameSite=Lax. Otherwise, sign in with Open in a tab. For one login across every screen, put single sign-on in
front of them all, such as an authenticating reverse proxy on one domain.
The page is the proxy's, so while the proxy is down, a page already open keeps its frames but can't be reloaded.
Startup Checks¶
The proxy refuses to start with:
- a screen whose name is blank, has no letter or digit, or is longer than 64 characters;
- two names with the same id, or a name whose id is
proxyorall; - a
urlthat isn't an absolutehttporhttpsURL, or that carries a username or password, which the page would show anyone who can read the dashboard; - a
startor aprobethat doesn't begin with/or?; - more than 32 screens;
- a
proxy.dashboard.pathof/screens, the page's path, while the page is served.
A url read from an unset variable, as ${?GRAFANA_URL} is, is empty, and the proxy refuses it, naming the screen.
The dashboard's Settings view lists each screen with its url, its query values masked, and where it starts.
Relayed Agent Dashboards¶
Anyone who can read the screens page sees every agent
With proxy.dashboard.agentScreens on, every connected agent that allows it shows its name, host, target URLs,
recent scrapes, activity, and settings to anyone who can read /screens. Agents allow it by default:
agent.dashboard.showOnProxy is true unless set, whether or not agent.dashboard.enabled turns the agent's
direct dashboard on. A direct agent dashboard's password doesn't guard the relayed one, which is behind the proxy's
login.
Before you turn agentScreens on, set proxy.dashboard.password, or bind proxy.dashboard.host to a private
address. To keep one agent off every proxy, set its agent.dashboard.showOnProxy = false. The proxy logs a warning
at startup when agentScreens is on with no password.
With proxy.dashboard.agentScreens = true, the proxy shows each connected agent's dashboard in a separate tab,
through the agent's gRPC connection: a relayed agent dashboard. A direct agent dashboard needs a port the proxy's users
can reach, which an agent behind a firewall doesn't offer. For a relayed one, the agent opens no port, and its direct
dashboard need not be on. A direct agent dashboard still shows what a relayed one can't, as for an agent that can't
connect (Direct and Relayed Agent Dashboards).
proxy.dashboard {
enabled = true
agentScreens = true
host = "127.0.0.1"
password = ${?DASHBOARD_PASSWORD}
}
What You See¶
- A tab for each agent that allows it, after the listed screens, named for the agent. Its dot is green while the
agent is connected and its relay is up. The agent's
agent_dashboard_relay_upgauge has a series only while the agent is connected to a proxy that shows it here, and is 0 for the 5 seconds the relay waits, after a failure or after the proxy ended its streams, before it opens them again;agent_dashboard_relay_failures_totalcounts each failure (Agent Metrics). - A signal glyph before the name, which says the tab is a relayed agent dashboard. It tells the tab from a listed screen, a direct agent dashboard listed by its URL included. Its tooltip and a screen reader say "through the proxy", and each pane's picker lists such agents in a separate group.
- The agent's views, Paths, Connection, Activity, and Settings, in the same panes and layouts as any screen,
and its Scrape now while both the agent's and the proxy's
scrapeNowEnabledare on. Each agent's Scrape now runs up to four scrapes at once, apart from every other agent's and the proxy's own. - The agent's state, not a second view of it. The agent sends its state over the connection in batches when a page opens, and its changes after that.
The proxy serves each agent's page at /dashboard/agent-dashboard/<launch>/, under the dashboard's base path, behind
the dashboard's login.
Linking to an Agent's Tab¶
A link names an agent's tab by the agent's name, as it names a listed screen by the screen's name:
| Link | Opens |
|---|---|
/screens#agent-east |
agent-east's tab, whichever launch of it is connected |
/screens#agent-east/connection |
agent-east's Connection view |
/screens#agent.<launch> |
one launch's tab alone, by the launch ID the agent's Settings view shows |
- An agent that restarts is a new launch with the same name, so a link by name opens the launch that's connected. The page's address uses the name too, so a link copied from it still opens the agent after a restart.
- A listed screen of the same id comes first.
- An agent names itself. While two connected agents give the same name, a link to it opens the proxy's tab rather than either, so neither can stand in for the other.
- A link that names two screens, the first an agent that hasn't connected yet, opens that agent alone once it appears.
Which Agents Appear¶
- The proxy's dashboard must be on.
agentScreenshas no effect withproxy.dashboard.enabled = false. With it on, the proxy serves/screens, with its root redirect and framing, even with noproxy.dashboard.screenslisted. - The agent decides.
agent.dashboard.showOnProxy,trueby default, lets a proxy withagentScreenson show the agent, andfalsekeeps the agent's dashboard off every proxy. It doesn't depend onagent.dashboard.enabled: an agent with its direct dashboard off still shows on the proxy. An embedded agent, built in code, with the Ktor plugin, or with the Spring Boot starter, shows up the same way unless it opts out. - Only connected agents. A page opened after an agent left doesn't list it. An active/standby pair shows an agent's tab only on the proxy it's connected to, so the standby's page lists nothing until an agent fails over to it. An agent that can't connect never gets a tab. Its direct agent dashboard shows why (Agent Can't Connect to the Proxy).
- A page already open keeps a gone agent's tab for a while, shown down, with the last state it showed. A restarted agent is a new launch, which takes that tab over where it is, green again, its frame reloaded on the new launch's page. A second agent of the same name that connects while the first is still connected gets a separate tab, the two named with the start of their launch IDs while both are connected.
- A gone agent's tab goes once the proxy drops the agent's launch, 10 minutes after the agent left or after the last page showing it closed, whichever is later, or as soon as a connected agent of the same name has a tab of its own, so the page holds one tab per name. A tab that's on screen stays until you leave it: the tab shown alone, either pane in Split, or a tile in or near the view in All. A listed screen never goes.
What the Proxy Keeps¶
The agent sends its state only while a page of it is open. The proxy drops a connected agent's state as the last page
showing it closes. It keeps a gone agent's state only if a page showed its tab as the agent left. Only a tab that's
shown holds a WebSocket session, counted in proxy.dashboard.maxSessions: a hidden tab, and a tile in All more
than half a screen from the view, closes its socket and opens it again when it's shown.
The proxy bounds what it keeps, measured as its estimate of the memory each state takes:
| Limit | Value | When it's reached |
|---|---|---|
| One agent's state | 64 MiB; an agent at the defaults, 20,000 paths of 20 scrapes each, takes about 50 | The agent's page shows the part that fits, with the newest of its activity, and says it's larger than the proxy keeps |
| Every agent's state together, a gone agent's whose page is open included | proxy.dashboard.agentScreensMaxMBytes, 96 MiB by default |
The proxy lets go of gone agents' states, first those no page shows, then the rest, each the longest gone first; a page still open on one says so |
| The heap those states take | Under 1.6 times the estimate | |
| A gone agent's state | 10 minutes after the last page showing it closes | The proxy drops it |
The proxy never lets go of a connected agent's state that a page shows. Past the total, a growing state shows the part
that fits instead, and its page says the proxy's room for agents' states is full. When an agent sends its whole state
again, as when its relay reconnects, its page keeps showing the old state while the new one fits beside it within the
64 MiB. Once the new one doesn't fit, the page shows it in part, saying the agent is sending it again, until the agent
has sent all of it. The proxy's proxy_agent_screens_partial gauge counts the agents' pages shown in part, by
reason: too_large, total_full, or resending.
Lower agentScreensMaxMBytes for a small heap. Raise it, with the heap, for many large agents shown at once, as in
All. The proxy's proxy_agent_screens_bytes gauge reports what the states hold, as it estimates their memory, and
proxy_agent_screens_max_bytes the limit, which the proxy dashboard's Relayed Agent Dashboard Memory panel in
Grafana shows together: a total that stays at the limit means the proxy is letting go of gone agents'
states, or showing agents in part.