|
106 | 106 | - [Run Dashboard](#run-dashboard)
|
107 | 107 | - [Inspect Traffic](#inspect-traffic)
|
108 | 108 | - [Chrome DevTools Protocol](#chrome-devtools-protocol)
|
| 109 | +- [Prometheus Metrics](#prometheus-metrics) |
109 | 110 | - [Frequently Asked Questions](#frequently-asked-questions)
|
110 | 111 | - [Deploying proxy.py in production](#deploying-proxypy-in-production)
|
111 | 112 | - [What not to do?](#what-not-to-do)
|
@@ -2016,6 +2017,13 @@ start `proxy.py` as:
|
2016 | 2017 |
|
2017 | 2018 | Now point your CDT instance to `ws://localhost:8899/devtools`.
|
2018 | 2019 |
|
| 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 | + |
2019 | 2027 | # Frequently Asked Questions
|
2020 | 2028 |
|
2021 | 2029 | ## Deploying proxy.py in production
|
@@ -2548,15 +2556,16 @@ usage: -m [-h] [--tunnel-hostname TUNNEL_HOSTNAME] [--tunnel-port TUNNEL_PORT]
|
2548 | 2556 | [--proxy-pool PROXY_POOL] [--enable-web-server]
|
2549 | 2557 | [--enable-static-server] [--static-server-dir STATIC_SERVER_DIR]
|
2550 | 2558 | [--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] |
2552 | 2561 | [--pac-file-url-path PAC_FILE_URL_PATH]
|
2553 | 2562 | [--cloudflare-dns-mode CLOUDFLARE_DNS_MODE]
|
2554 | 2563 | [--filtered-upstream-hosts FILTERED_UPSTREAM_HOSTS]
|
2555 | 2564 | [--filtered-client-ips-mode FILTERED_CLIENT_IPS_MODE]
|
2556 | 2565 | [--filtered-client-ips FILTERED_CLIENT_IPS]
|
2557 | 2566 | [--filtered-url-regex-config FILTERED_URL_REGEX_CONFIG]
|
2558 | 2567 |
|
2559 |
| -proxy.py v2.4.5 |
| 2568 | +proxy.py v2.4.6.dev27+g975b6b68.d20240811 |
2560 | 2569 |
|
2561 | 2570 | options:
|
2562 | 2571 | -h, --help show this help message and exit
|
@@ -2725,6 +2734,10 @@ options:
|
2725 | 2734 | response that will be compressed (gzipped).
|
2726 | 2735 | --enable-reverse-proxy
|
2727 | 2736 | 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. |
2728 | 2741 | --pac-file PAC_FILE A file (Proxy Auto Configuration) or string to serve
|
2729 | 2742 | when the server receives a direct file request. Using
|
2730 | 2743 | this option enables proxy.HttpWebServerPlugin.
|
|
0 commit comments