Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit bc3508d

Browse files
committed
Adds metrics task doc
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
1 parent 1381a39 commit bc3508d

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ users:
130130
- [No Impersonation](./docs/tasks/no-impersonation.md)
131131
- [Extra Impersonations Headers](./docs/tasks/extra-impersonation-headers.md)
132132
- [Auditing](./docs/tasks/auditing.md)
133+
- [Metrics](./docs/tasks/metrics.md)
133134

134135
## Development
135136
*NOTE*: building kube-oidc-proxy requires Go version 1.12 or higher.

docs/tasks/metrics.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Metrics
2+
3+
kube-oidc-proxy exposes a number of Prometheus metrics to give some insights
4+
into how the proxy is performing. These metrics are designed to be used to
5+
better inform how the proxy is behaving, and the general usage from clients,
6+
*_not_* to alert, or otherwise give other security insights. If you are
7+
interested in auditing and access review functionality, please refer to
8+
[auditing](../auditing.md).
9+
10+
The proxy exposes the following metrics:
11+
12+
### kube_oidc_proxy_http_client_requests
13+
counter - {http status code, path, remote address}
14+
The number of requests for incoming requests.
15+
16+
### kube_oidc_proxy_http_client_duration_seconds
17+
histogram - {remote address}
18+
The duration in seconds for incoming client requests to be responded to.
19+
20+
### kube_oidc_proxy_http_server_requests
21+
counter - {http status code, path, remote address}
22+
The requests for outgoing server requests.
23+
24+
### kube_oidc_proxy_http_server_duration_seconds
25+
histogram - {remote address}
26+
The duration in seconds for outgoing server requests to be responded to.
27+
28+
### kube_oidc_proxy_token_review_duration_seconds
29+
histogram - {authenticated, http status code, remote address, user}
30+
The duration in seconds for a token review lookup. Authenticated requests are 1, else 0.
31+
32+
### kube_oidc_proxy_oidc_authentication_count
33+
counter - {authenticated, remote address, user}
34+
The count for OIDC authentication. Authenticated requests are 1, else 0.
35+
36+
## Metrics Address
37+
38+
By default, metrics are exposed on `0.0.0.0:80/metrics`. The flag
39+
`--metrics-serving-address` can be used to change the address, however the
40+
`/metrics` path will remain the same. The metrics address must _not_ conflict
41+
with the proxy and probe addresses. Setting `--metrics-serving-address=""` will
42+
disable the metrics server.

pkg/metrics/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func New() *Metrics {
4444
prometheus.CounterOpts{
4545
Namespace: promNamespace,
4646
Name: "http_client_requests",
47-
Help: "The number of requests for incomming requests.",
47+
Help: "The number of requests for incoming requests.",
4848
},
4949
[]string{"code", "path", "remote_address"},
5050
)

0 commit comments

Comments
 (0)