Skip to content

Commit 9c9e00e

Browse files
ZPain8464wasaga
andauthored
Adds a metrics capabilities page for Pomerium Zero (#1635)
* moves metrics page location * rewrites front matter * first draft of zero metrics * removes enterprise images * runs prettier * migrates reports content * adds reports redirect * removes extra tabs block * runs prettier * fixes typo * fixes breaking links * Update content/docs/capabilities/metrics.md Co-authored-by: Denis Mishin <[email protected]> * adds requested feedback * updates header * runs prettier * Update content/docs/capabilities/metrics.md * adds configure metrics link --------- Co-authored-by: Denis Mishin <[email protected]>
1 parent 6d1e2a8 commit 9c9e00e

33 files changed

+210
-101
lines changed
Binary file not shown.
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

content/docs/capabilities/metrics.md

+203-47
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,235 @@
11
---
22
# cSpell:ignore XPOST tsdb
33

4-
title: Configure Metrics
4+
title: Metrics in Pomerium
55
sidebar_label: Metrics
6-
description: Use Prometheus as a metrics data store.
6+
description: Learn how Pomerium collects and displays metrics in Pomerium Zero and Pomerium Enterprise.
77
lang: en-US
8-
keywords: [pomerium, enterprise pomerium, telemetry, metrics, prometheus]
8+
keywords:
9+
[pomerium, pomerium enterprise, telemetry, metrics, prometheus, pomerium zero]
910
---
1011

11-
Pomerium Enterprise uses Prometheus as a metrics collection back-end. You can configure Pomerium and the Console to talk to an existing Prometheus server, or configure the embedded Prometheus backend. This guide assumes you're running both Pomerium and Pomerium Enterprise on localhost `127.0.0.1`.
12+
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
1213

13-
:::tip
14+
Metrics in Pomerium provide observability and monitoring data from your Pomerium deployment. Use metrics to review traffic and its effects on your system.
1415

15-
For production deployments, we suggest using a dedicated Prometheus instance.
16+
Pomerium exposes standard Prometheus metrics related to its operation. Open-source users must [configure](/docs/reference/metrics) metrics collection and visualization manually.
17+
18+
Pomerium Zero and Pomerium Enterprise provide simplified, built-in metrics collection and visualizations.
19+
20+
## Metrics definitions
21+
22+
- **Traffic**: requests proxied by Pomerium to routes defined in a Pomerium deployment.
23+
- **Route**: the location of an upstream service protected behind Pomerium. At a minimum, a route consists of a [From](/docs/reference/routes/from) URL and a [To](/docs/reference/routes/to) URL.
24+
25+
## How metrics work
26+
27+
Pomerium collects and aggregates traffic data from your Pomerium deployment. This data includes the:
28+
29+
- request size, duration, and rate
30+
- number of authorized and denied requests
31+
- response code distribution
32+
33+
You can view and filter this data in your traffic dashboard to gauge how much demand is placed on your server.
34+
35+
### Filter metrics
36+
37+
#### Time range and routes
38+
39+
Pomerium stores traffic metrics up to the last 30 days of usage. You can filter traffic by time range and routes.
40+
41+
The following time ranges are supported:
42+
43+
- Last 30 days
44+
- Last 2 weeks
45+
- Last 7 days
46+
- Last 24 hours
47+
- Last 12 hours
48+
- Last 3 hours
49+
- Last hour
50+
- Last 15 minutes (Enterprise only)
51+
52+
When filtering by route, select:
53+
54+
- **All Routes** to review aggregated traffic metrics across all routes defined in your Pomerium deployment.
55+
- an individual route to review aggregated traffic metrics for that route.
56+
57+
<Tabs>
58+
<TabItem label="Zero" value="zero">
59+
60+
![Filtering metrics by time range routes in Pomerium Zero](./img/metrics/zero-filter-traffic.gif)
61+
62+
</TabItem>
63+
<TabItem label="Enterprise" value="enterprise">
64+
65+
![Filtering metrics by time range routes in the Pomerium Enterprise console](./img/metrics/enterprise-filter-traffic.gif)
66+
67+
</TabItem>
68+
</Tabs>
69+
70+
## Traffic dashboard
71+
72+
<Tabs>
73+
<TabItem value="zero" label="Zero">
74+
75+
Pomerium Zero collects traffic metrics at the [cluster](/docs/concepts/clusters) level, which includes active replicas. To review the traffic dashboard in Pomerium Zero:
76+
77+
1. In the left-hand sidebar, select **Reports**.
78+
1. Select **Traffic**.
79+
80+
![Find traffic metrics in Pomerium Zero](./img/metrics/zero-find-metrics.gif)
81+
82+
</TabItem>
83+
<TabItem value="enterprise" label="Enterprise">
84+
85+
When you access the Enterprise Console, you'll land on the traffic dashboard. Pomerium Enterprise organizes traffic metrics in your deployment with [namespaces](/docs/capabilities/namespacing).
86+
87+
Namespaces follow a hierarchical system. You can view traffic metrics for all namespaces, or a specific namespace, using the namespace dropdown menu. You can filter by:
88+
89+
- Global namespace, which encompasses all namespaces in your deployment.
90+
- Parent namespace, which includes child namespaces (if any).
91+
- Child namespace, which displays metrics only for that namespace.
92+
93+
![Selecting a namespace to view its traffic in the Enterprise Console](./img/metrics/enterprise-metrics-namespaces.gif)
94+
95+
:::enterprise
96+
97+
In Pomerium Enterprise, you must configure metrics before you can view them. Metrics are not enabled by default, and are not required to run Pomerium Enterprise. See the [Configure Metrics](/docs/enterprise/configure-metrics) guide to enable metrics in your Enterprise deployment.
1698

1799
:::
18100

19-
## Prepare Pomerium
101+
</TabItem>
102+
</Tabs>
103+
104+
### Total and Authorized requests
105+
106+
<Tabs>
107+
<TabItem value="zero" label="Zero">
108+
109+
The **Total requests** chart shows the total number of proxied requests. The **Authorized requests** chart shows the total number of requests Pomerium authorized and forwarded to an upstream service.
110+
111+
Both charts display the difference in requests between the selected and previous time ranges. ![Displaying the total and authorized requests in Pomerium Zero](./img/metrics/zero-total-and-authorized-requests.png)
112+
113+
The **Authorized Requests** pie chart displays the total number of authorized and denied requests. ![A pie chart showing the number of authorized and denied requests in Pomerium Zero](./img/metrics/zero-authorized-and-denied-chart.png)
114+
115+
</TabItem>
116+
<TabItem value="enterprise" label="Enterprise">
117+
118+
The **Total requests** chart shows the total number of proxied requests. The **Authorized requests** chart shows the total number of requests Pomerium authorized and forwarded to an upstream service.
119+
120+
The **Healthy Endpoints** chart displays the number of healthy upstream endpoints, and roughly correlates with the number of routes defined in your deployment.
121+
122+
For example, if a route's **To** definition includes [multiple upstream resources](/docs/reference/routes/to#target-multiple-upstream-resources), Pomerium includes these resources in the total sum of healthy endpoints. Pomerium excludes unhealthy endpoints from this total. See Load Balancing - [Active Health Checks](/docs/capabilities/load-balancing#active-health-checks) and [Passive Health Checks](/docs/capabilities/load-balancing#passive-health-checks) for more information.
123+
124+
![Viewing the total and authorized request charts in the Enterprise Console](./img/metrics/enterprise-total-requests.png)
125+
126+
The **Authorized Requests** pie chart displays the total number of authorized and denied requests.
127+
128+
![A pie chart showing the number of authorized and denied requests in Pomerium Enterprise](./img/metrics/enterprise-authorized-requests.png)
129+
130+
The **Healthy Upstream Endpoints** graph shows you the number of healthy endpoints over time. A dip in the graph denotes unhealthy endpoints.
131+
132+
![A graph displaying the number of healthy upstream endpoints in Pomerium Enterprise](./img/metrics/enterprise-healthy-upstream-endpoints-graph.png)
133+
134+
</TabItem>
135+
</Tabs>
136+
137+
### Request durations
138+
139+
<Tabs>
140+
<TabItem value="zero" label="Zero">
141+
142+
Request duration measures the amount of time it takes Pomerium to proxy a request in milliseconds (ms). Pomerium Zero provides two request duration charts:
143+
144+
The first chart organizes requests by duration ranges defined along the x-axis. Pomerium sums the total value of requests within each range and calculates the amount as a percentage value.
145+
146+
![A chart displaying request duration in Pomerium Zero](./img/metrics/zero-request-duration.png)
147+
148+
The second chart organizes requests by percentile ranges, date, and time.
149+
150+
![A chart displaying request duration in Pomerium Zero](./img/metrics/zero-request-duration-second-chart.png)
151+
152+
</TabItem>
153+
<TabItem value="enterprise" label="Enterprise">
154+
155+
Request duration measures the amount of time it takes Pomerium to proxy a request in milliseconds (ms). Pomerium Enterprise provides two request duration charts:
156+
157+
The first chart organizes requests by duration ranges defined along the x-axis. Pomerium sums the total value of requests within each range and calculates the amount as a percentage value.
158+
159+
![A chart displaying request duration in Pomerium Enterprise](./img/metrics/enterprise-request-duration.png)
160+
161+
The second chart organizes requests by percentile ranges, date, and time. You can select a specific percentile range to view more granular data in that range:
162+
163+
![A chart displaying request duration with percentile ranges in Enterprise Console](./img/metrics/enterprise-percentile-ranges.gif)
164+
165+
</TabItem>
166+
</Tabs>
167+
168+
### Requests rate and response codes
169+
170+
<Tabs>
171+
<TabItem value="zero" label="Zero">
172+
173+
The **Requests per second** chart calculates the average amount of proxied requests per second over the span of an hour. Requests are organized by date and time, and categorized by the following response status codes:
174+
175+
- **200s** (200-299): successful responses
176+
- **300s** (300-399): redirection messages
177+
- **400s** (400-499): client error responses
178+
- **500s** (500-599): server error responses
179+
180+
![A chart displaying requests per second in Pomerium Zero](./img/metrics/zero-requests-per-second.png)
181+
182+
</TabItem>
183+
<TabItem value="enterprise" label="Enterprise">
184+
185+
The **Request Rate** chart calculates the average amount of proxied requests per second over the span of an hour.
20186

21-
1. In the Pomerium `pomerium-config.yaml`, define the [`metrics_address`](/docs/reference/metrics#metrics-address) key to a network interface and/or port. For example:
187+
![A chart displaying requests per second in Pomerium Enterprise](./img/metrics/enterprise-request-rate.png)
22188

23-
```yaml title="pomerium-config.yaml"
24-
metrics_address: 127.0.0.1:9091
25-
```
189+
The **Response Codes** chart organizes requests by date and time, and categorizes them with the following response status codes:
26190

27-
The example above has Pomerium providing metrics at port `9999` on an IP address reachable by the Pomerium Console service.
191+
- **HTTP 2xx** (200-299): successful responses
192+
- **HTTP 3xx** (300-399): redirection messages
193+
- **HTTP 4xx** (400-499): client error responses
194+
- **HTTP 5xx** (500-599): server error responses
28195

29-
If you're running Pomerium Enterprise in a distributed environment where the IP address is not known at the time of deployment, you can use the resolvable FQDN of the Pomerium host (`pomerium0.internal.example.com`, for example), or override this key with the environment variable `METRICS_ADDRESS`. We do not recommend exposing this endpoint to public traffic as it can contain potentially sensitive information.
196+
![A response codes chart in Pomerium Enterprise](./img/metrics/enterprise-response-status-codes.gif)
30197

31-
1. In the Pomerium Enterprise `pomerium-enterprise-config.yaml`, define the `metrics_addr` key to a network interface and/or port. For example:
198+
</TabItem>
199+
</Tabs>
32200

33-
```yaml title="config.yaml"
34-
metrics_addr: 127.0.0.1:9092
35-
```
201+
### Bytes sent and received, request size
36202

37-
## External Prometheus
203+
<Tabs>
204+
<TabItem value="zero" label="Zero">
38205

39-
1. Add the listener to your Prometheus configuration, usually via `prometheus.yml`:
206+
The **Bytes sent** and **Bytes received** charts display the average amount of bytes sent and received over the span of an hour.
40207

41-
```yaml
42-
- job_name: 'Pomerium'
43-
scrape_interval: 30s
44-
scrape_timeout: 5s
45-
static_configs:
46-
- targets: ['127.0.0.1:9901']
47-
- job_name: 'Pomerium Enterprise'
48-
scrape_interval: 30s
49-
scrape_timeout: 5s
50-
static_configs:
51-
- targets: ['127.0.0.1:9902']
208+
![A chart displaying bytes sent and received in Pomerium Zero](./img/metrics/zero-bytes-sent-received.png)
52209

53-
```
210+
</TabItem>
211+
<TabItem value="enterprise" label="Enterprise">
54212

55-
1. [Reload](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration) the Prometheus configuration:
213+
The **Request Size** chart organizes requests based on their request size measured in kilobytes (KB).
56214

57-
```bash
58-
curl -i -XPOST path.to.prometheus:port/-/reload
59-
```
215+
![A chart displaying response size in Pomerium Enterprise](./img/metrics/enterprise-request-size.png)
60216

61-
1. In the Pomerium Enterprise `config.yaml` file, define the `prometheus_url` key to point to your Prometheus instance(s):
217+
</TabItem>
218+
</Tabs>
62219

63-
```yaml
64-
prometheus_url: http://192.168.122.50:9090
65-
```
220+
## Runtime dashboard
66221

67-
1. Restart the Pomerium and Pomerium Enterprise services. You should now see route traffic and External Data Source monitoring data in the Enterprise Console:
222+
<Tabs>
223+
<TabItem value="zero" label="Zero">
68224

69-
![Traffic Data in Pomerium Enterprise](./img/metrics/console-route-traffic.png) ![External Data Source in Pomerium Enterprise](./img/metrics/console-ext-datasource-monitoring.png)
225+
Runtime metrics are not supported in Pomerium Zero.
70226

71-
## Embedded Prometheus
227+
</TabItem>
228+
<TabItem value="enterprise" label="Enterprise">
72229

73-
To take advantage of Prometheus embedded in Pomerium Enterprise, edit Pomerium Console's config file:
230+
In the **Runtime** dashboard, you can monitor how many system resources Pomerium is consuming. Filter by date range, service, and instance.
74231

75-
```yaml title="config.yaml"
76-
prometheus_data_dir: /var/lib/pomerium-console/tsdb
77-
```
232+
![The Runtime Info page in Pomerium Enterprise](./img/metrics/reports-runtime-fullpage.png)
78233

79-
The directory path can be any location that the `pomerium` system user can write to. The example above uses the default location created by the [OS packages](/docs/enterprise/quickstart).
234+
</TabItem>
235+
</Tabs>

content/docs/capabilities/reports.md

-37
This file was deleted.

content/docs/concepts/access-control.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ Pomerium populates users and groups from your IdP. This data is cached to preven
8585
You may encounter a situation where you may want to add users that are not directly associated with your corporate IdP service. For example, if you have a corporate Google Workspace account and want to add a contractor with a Gmail account, you would have two options:
8686

8787
- Create a group within your IdP directly with the non-domain users in it. This group can be found and added to Namespaces and Policies.
88-
- Manually add the user's unique ID. Identify the ID from a user's **Session Details** page, or the [Sessions](/docs/capabilities/reports#sessions) page in [Pomerium Enterprise](/docs/enterprise). A user can see their session ID by navigating to the special `/.pomerium` URL endpoint from any Pomerium-managed route. The unique ID is listed as **Sub** under User Details:
88+
- Manually add the user's unique ID. Identify the ID from a user's **Session Details** page, or the [Sessions](/docs/capabilities/metrics#sessions-enterprise) page in [Pomerium Enterprise](/docs/enterprise). A user can see their session ID by navigating to the special `/.pomerium` URL endpoint from any Pomerium-managed route. The unique ID is listed as **Sub** under User Details:
8989

9090
![The User Details page, showing the "sub" data](img/access-control/session-details.png)

content/docs/enterprise.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ In the **External Data** dashboard, you can import, view, and manage [external d
8181
| TCP Support | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
8282
| Enterprise Console | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
8383
| [Enterprise API](/docs/capabilities/enterprise-api) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
84-
| [Session Management](/docs/capabilities/reports#sessions) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
84+
| [Session Management](/docs/capabilities/metrics#sessions) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
8585
| [Namespaces](/docs/capabilities/namespacing) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
8686
| [Directory Sync](/docs/capabilities/directory-sync) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
8787
| [User Impersonation](/docs/capabilities/impersonation) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
88-
| [Deployment History](/docs/capabilities/reports#deployments) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
88+
| [Deployment History](/docs/capabilities/metrics#changesets-and-deployments) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
8989
| [Device Identity](/docs/capabilities/device-identity) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
9090
| [Custom Branding](/docs/capabilities/branding) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |
9191
| [Service Accounts](/docs/capabilities/service-accounts) | <ClearIcon /> | ![Pomerium checkmark](./enterprise/img/pomerium-checkmark.svg) |

content/docs/enterprise/changelog.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,6 @@ Added support for the Rego [**`print()`**](https://www.openpolicyagent.org/docs/
334334
[`signing key`]: /docs/reference/signing-key
335335
[google cloud serverless]: /docs/reference/routes/enable-google-cloud-serverless-authentication
336336
[policy language]: /docs/capabilities/ppl
337-
[runtime]: /docs/capabilities/reports.md#runtime
337+
[runtime]: /docs/capabilities/metrics.md#runtime
338338
[spdy]: /docs/reference/routes/timeouts#spdy
339-
[telemetry]: /docs/capabilities/reports.md#traffic
339+
[telemetry]: /docs/capabilities/metrics.md

sidebars.js

+1-12
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const sidebars = {
100100
},
101101
'docs/capabilities/hosted-authenticate-service',
102102
'docs/capabilities/self-hosted-authenticate-service',
103+
'docs/capabilities/metrics',
103104
'docs/capabilities/mtls-clients',
104105
'docs/capabilities/mtls-services',
105106
'docs/capabilities/getting-users-identity',
@@ -157,12 +158,6 @@ const sidebars = {
157158
type: 'doc',
158159
label: 'High Availability',
159160
},
160-
{
161-
id: 'docs/capabilities/metrics',
162-
className: 'enterprise',
163-
type: 'doc',
164-
label: 'Metrics',
165-
},
166161
{
167162
id: 'docs/capabilities/namespacing',
168163
className: 'enterprise',
@@ -175,12 +170,6 @@ const sidebars = {
175170
type: 'doc',
176171
label: 'Original User Context',
177172
},
178-
{
179-
id: 'docs/capabilities/reports',
180-
className: 'enterprise',
181-
type: 'doc',
182-
label: 'Reports',
183-
},
184173
{
185174
id: 'docs/capabilities/service-accounts',
186175
className: 'enterprise',

static/_redirects

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ https://0-20-0.docs.pomerium.com/category/guides https://0-20-0.docs.pomerium.co
164164
/docs/releases/enterprise /docs/releases/enterprise/about
165165
/docs/releases/enterprise/about /docs/enterprise
166166
/enterprise/reference/reports.html /docs/capabilities/reports
167+
/docs/capabilities/reports /docs/capabilities/metrics
167168

168169
/enterprise/install/helm.html /docs/releases/enterprise/install/helm
169170
/enterprise/* /docs/enterprise/:splat

0 commit comments

Comments
 (0)