Skip to content

Commit 6602be3

Browse files
committed
Prometheus Metrics documentation
1 parent 091ba36 commit 6602be3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
- [Run Dashboard](#run-dashboard)
107107
- [Inspect Traffic](#inspect-traffic)
108108
- [Chrome DevTools Protocol](#chrome-devtools-protocol)
109+
- [Prometheus Metrics](#prometheus-metrics)
109110
- [Frequently Asked Questions](#frequently-asked-questions)
110111
- [Deploying proxy.py in production](#deploying-proxypy-in-production)
111112
- [What not to do?](#what-not-to-do)
@@ -2016,6 +2017,13 @@ start `proxy.py` as:
20162017

20172018
Now point your CDT instance to `ws://localhost:8899/devtools`.
20182019

2020+
# Prometheus Metrics
2021+
2022+
1) Start `proxy.py` with `--enable-metrics` flag to internal metrics via a prometheus endpoint
2023+
2) Configure your `prometheus.yaml` to scrape from `/metrics` endpoint e.g. [http://localhost:8899/metrics](http://localhost:8899/metrics)
2024+
3) Customize metrics path by using `--metrics-path` flag
2025+
4) NOTE that `--enable-metrics` internally also `--enable-events` and the web server plugin
2026+
20192027
# Frequently Asked Questions
20202028

20212029
## Deploying proxy.py in production
@@ -2548,15 +2556,16 @@ usage: -m [-h] [--tunnel-hostname TUNNEL_HOSTNAME] [--tunnel-port TUNNEL_PORT]
25482556
[--proxy-pool PROXY_POOL] [--enable-web-server]
25492557
[--enable-static-server] [--static-server-dir STATIC_SERVER_DIR]
25502558
[--min-compression-length MIN_COMPRESSION_LENGTH]
2551-
[--enable-reverse-proxy] [--pac-file PAC_FILE]
2559+
[--enable-reverse-proxy] [--enable-metrics]
2560+
[--metrics-path METRICS_PATH] [--pac-file PAC_FILE]
25522561
[--pac-file-url-path PAC_FILE_URL_PATH]
25532562
[--cloudflare-dns-mode CLOUDFLARE_DNS_MODE]
25542563
[--filtered-upstream-hosts FILTERED_UPSTREAM_HOSTS]
25552564
[--filtered-client-ips-mode FILTERED_CLIENT_IPS_MODE]
25562565
[--filtered-client-ips FILTERED_CLIENT_IPS]
25572566
[--filtered-url-regex-config FILTERED_URL_REGEX_CONFIG]
25582567

2559-
proxy.py v2.4.5
2568+
proxy.py v2.4.6.dev27+g975b6b68.d20240811
25602569

25612570
options:
25622571
-h, --help show this help message and exit
@@ -2725,6 +2734,10 @@ options:
27252734
response that will be compressed (gzipped).
27262735
--enable-reverse-proxy
27272736
Default: False. Whether to enable reverse proxy core.
2737+
--enable-metrics Default: False. Enables metrics.
2738+
--metrics-path METRICS_PATH
2739+
Default: /metrics. Web server path to serve proxy.py
2740+
metrics.
27282741
--pac-file PAC_FILE A file (Proxy Auto Configuration) or string to serve
27292742
when the server receives a direct file request. Using
27302743
this option enables proxy.HttpWebServerPlugin.

0 commit comments

Comments
 (0)