pepe-http 0.54.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/completions/_pepe +4 -0
- package/completions/_pepe.ps1 +4 -0
- package/completions/pepe.bash +17 -1
- package/completions/pepe.fish +4 -0
- package/man/pepe-logs.1 +13 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,98 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
|
+
## [0.55.0](https://github.com/omarmhaimdat/pepe/compare/v0.54.0...v0.55.0) - 2026-10-23
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- *(logs)* --path, --status, --host and --until, .gz read as is, --metrics, and a logs MCP tool ([#227](https://github.com/omarmhaimdat/pepe/pull/227))
|
|
14
|
+
|
|
15
|
+
Third of three PRs making `pepe logs` more powerful (after #223's
|
|
16
|
+
per-path traffic and #225's findings and alerts).
|
|
17
|
+
|
|
18
|
+
## What changes
|
|
19
|
+
|
|
20
|
+
**Filters.** `--path '/api/*'`, `--status 5xx` (or `404`, `4xx,503`),
|
|
21
|
+
`--host .example.com` (or an exact host) and `--until 1h` keep only
|
|
22
|
+
those lines.
|
|
23
|
+
- The filters apply everywhere: every view, the findings, `--fail-if`
|
|
24
|
+
and the report.
|
|
25
|
+
- The title shows what was kept (`access.log · /api/* · 5xx`), and the
|
|
26
|
+
report counts what was left out (`logs.lines_filtered_out`).
|
|
27
|
+
- Error-log lines are kept by their `request:` and `host:` (added to the
|
|
28
|
+
error-log parser). A status filter never drops them.
|
|
29
|
+
- With `--status`, 5xx/4xx share findings are skipped, since they'd read
|
|
30
|
+
"5xx 100% now, 100% usually".
|
|
31
|
+
- `--since 2h --until 1h` reads a stretch in the past, and such a log
|
|
32
|
+
isn't followed. Bad input exits 2 with the reason.
|
|
33
|
+
|
|
34
|
+
**`.gz` read as is.** Rotated `access.log.2.gz` files are recognised by
|
|
35
|
+
their first two bytes, including multi-member gzip.
|
|
36
|
+
- Unpacking runs on a thread of its own, passing chunks to the reader
|
|
37
|
+
through a bounded channel.
|
|
38
|
+
- A `.gz` is never followed, not checked for "being written", and never
|
|
39
|
+
split across cores. Read progress counts its size on disk.
|
|
40
|
+
- The docs no longer suggest `zcat ... | pepe logs -`.
|
|
41
|
+
- New dependency: `flate2` with its pure-Rust backend (`miniz_oxide`),
|
|
42
|
+
no C to build.
|
|
43
|
+
|
|
44
|
+
**`--metrics` while following.** The Prometheus page is re-rendered
|
|
45
|
+
every second:
|
|
46
|
+
- `pepe_logs_requests_total{class}`, `_bytes_total`,
|
|
47
|
+
`_error_log_lines_total{level}`, `_unread_lines_total`
|
|
48
|
+
- last window: `_requests_per_second`, `_5xx_ratio`, `_4xx_ratio`,
|
|
49
|
+
`_live`
|
|
50
|
+
- histograms: `_request_duration_seconds`, `_upstream_duration_seconds`
|
|
51
|
+
- `pepe_logs_findings{level}` and `pepe_logs_fail_if_crossed{condition}`
|
|
52
|
+
|
|
53
|
+
**MCP `logs` tool.** It takes `files` (nginx's own if none are named),
|
|
54
|
+
`since`, `until`, `window`, `path`, `status`, `host`, `fail_if`,
|
|
55
|
+
`format`, `exact_paths` and `rows`, and is marked read-only with no
|
|
56
|
+
outside effects. Exit 4 comes back as an answer, not an error. The
|
|
57
|
+
server instructions, AGENTS.md, docs/agents.md, llms.txt and the skill
|
|
58
|
+
list it.
|
|
59
|
+
|
|
60
|
+
## Checked
|
|
61
|
+
- 425 tests pass; clippy 1.98 is clean. New tests cover glob, status and
|
|
62
|
+
host matching, the filter on requests and error-log lines, `--until`, a
|
|
63
|
+
two-member `.gz` giving the same report as the plain file (and not
|
|
64
|
+
"being written"), and the MCP argument mapping.
|
|
65
|
+
- By hand:
|
|
66
|
+
- `pepe mcp` answered a `logs` call over stdio with the verdict and
|
|
67
|
+
`fail_if`.
|
|
68
|
+
- `--metrics` was scraped from a live screen driven in a pty, and the
|
|
69
|
+
session quit cleanly.
|
|
70
|
+
- The filters, and bad `--status` / `--until` values, were run on the
|
|
71
|
+
generated log.
|
|
72
|
+
|
|
73
|
+
## Cost (bench/README.md)
|
|
74
|
+
| | before | after |
|
|
75
|
+
| --- | ---: | ---: |
|
|
76
|
+
| 862 MB log, every core, no filter (against v0.54) | 0.35 s, 3.1 s CPU,
|
|
77
|
+
~140 MB | same |
|
|
78
|
+
| 189 MB log as `.gz`: `zcat \| pepe logs -` → `pepe logs file.gz` |
|
|
79
|
+
0.52 s | 0.51 s, 28 MB |
|
|
80
|
+
|
|
81
|
+
Unpacking on the reading thread took 0.71 s, which is why it gets a
|
|
82
|
+
thread of its own. A first version checked the filter on every line and
|
|
83
|
+
cost about 4% CPU; it is now checked once per chunk.
|
|
84
|
+
|
|
85
|
+
## Caveats
|
|
86
|
+
- The MCP `logs` tool reads any file the server's user can read, like
|
|
87
|
+
`replay` and `compare` do. The report can quote a line it couldn't parse
|
|
88
|
+
(`first_unread_line`) and error-log examples. Whoever starts `pepe mcp`
|
|
89
|
+
decides what it runs as.
|
|
90
|
+
- `--host` needs `$host` in the log format; the default `combined`
|
|
91
|
+
format has none.
|
|
92
|
+
|
|
93
|
+
## 1.0
|
|
94
|
+
This adds `pepe logs` flags (`--path`, `--status`, `--host`, `--until`),
|
|
95
|
+
a report field (`lines_filtered_out`) and an MCP tool, so it restarts
|
|
96
|
+
the month without a flag or schema change.
|
|
97
|
+
|
|
98
|
+
Please squash-merge with this title so release-plz picks it up.
|
|
99
|
+
|
|
100
|
+
|
|
9
101
|
## [0.54.0](https://github.com/omarmhaimdat/pepe/compare/v0.53.0...v0.54.0) - 2026-10-23
|
|
10
102
|
|
|
11
103
|
### Added
|
package/completions/_pepe
CHANGED
|
@@ -574,6 +574,10 @@ _arguments "${_arguments_options[@]}" : \
|
|
|
574
574
|
'--window=[What "now" is measured over, e.g. 10s, 1m, 5m]:TIME:_default' \
|
|
575
575
|
'--since=[How far back to start, e.g. 90m, 24h, 7d. At a terminal a log that is being written is shown live, from five minutes back, without it]:TIME:_default' \
|
|
576
576
|
'--rows=[Rows in each table of the report]:N:_default' \
|
|
577
|
+
'*--path=[Count only the requests to these paths, with * for any run of characters\: /api/*, /login; repeat for more. An error log line counts when its request does]:PATH:_default' \
|
|
578
|
+
'*--status=[Count only the requests that answered these\: 404, 5xx, 4xx,503; repeat for more. Error log lines are still counted]:CODES:_default' \
|
|
579
|
+
'*--host=[Count only the requests to these hosts (the log'\''s \$host)\: shop.test exactly, .example.com for it and every host under it; repeat for more]:HOST:_default' \
|
|
580
|
+
'--until=[Leave out what is newer than this, e.g. 1h for up to an hour ago; with --since, a stretch in the past. A log read up to a time in the past isn'\''t followed]:TIME:_default' \
|
|
577
581
|
'-n+[Number of requests to perform]:NUMBER:_default' \
|
|
578
582
|
'--number=[Number of requests to perform]:NUMBER:_default' \
|
|
579
583
|
'-z+[Duration of the test, e.g. 10s, 3m, 2h (mutually exclusive with -n)]:DURATION:_default' \
|
package/completions/_pepe.ps1
CHANGED
|
@@ -568,6 +568,10 @@ Register-ArgumentCompleter -Native -CommandName 'pepe' -ScriptBlock {
|
|
|
568
568
|
[CompletionResult]::new('--window', '--window', [CompletionResultType]::ParameterName, 'What "now" is measured over, e.g. 10s, 1m, 5m')
|
|
569
569
|
[CompletionResult]::new('--since', '--since', [CompletionResultType]::ParameterName, 'How far back to start, e.g. 90m, 24h, 7d. At a terminal a log that is being written is shown live, from five minutes back, without it')
|
|
570
570
|
[CompletionResult]::new('--rows', '--rows', [CompletionResultType]::ParameterName, 'Rows in each table of the report')
|
|
571
|
+
[CompletionResult]::new('--path', '--path', [CompletionResultType]::ParameterName, 'Count only the requests to these paths, with * for any run of characters: /api/*, /login; repeat for more. An error log line counts when its request does')
|
|
572
|
+
[CompletionResult]::new('--status', '--status', [CompletionResultType]::ParameterName, 'Count only the requests that answered these: 404, 5xx, 4xx,503; repeat for more. Error log lines are still counted')
|
|
573
|
+
[CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'Count only the requests to these hosts (the log''s $host): shop.test exactly, .example.com for it and every host under it; repeat for more')
|
|
574
|
+
[CompletionResult]::new('--until', '--until', [CompletionResultType]::ParameterName, 'Leave out what is newer than this, e.g. 1h for up to an hour ago; with --since, a stretch in the past. A log read up to a time in the past isn''t followed')
|
|
571
575
|
[CompletionResult]::new('-n', '-n', [CompletionResultType]::ParameterName, 'Number of requests to perform')
|
|
572
576
|
[CompletionResult]::new('--number', '--number', [CompletionResultType]::ParameterName, 'Number of requests to perform')
|
|
573
577
|
[CompletionResult]::new('-z', '-z', [CompletionResultType]::ParameterName, 'Duration of the test, e.g. 10s, 3m, 2h (mutually exclusive with -n)')
|
package/completions/pepe.bash
CHANGED
|
@@ -1730,7 +1730,7 @@ _pepe() {
|
|
|
1730
1730
|
return 0
|
|
1731
1731
|
;;
|
|
1732
1732
|
pepe__subcmd__logs)
|
|
1733
|
-
opts="-h -n -z -m -H -t -d -p -k -i -c -u --format --window --since --all --exact-paths --rows --help --number --duration --method --headers --timeout --warmup --threads --rate --body --proxy --insecure --disable-compression --disable-keepalive --disable-redirects --json --trace-header --vars --webhook --webhook-on --slack --export --snapshot --allow-host --max-requests --max-rate --max-concurrency --dry-run --fail-if --metrics --setup --config --write-config --load --keep --record --concurrency --user-agent"
|
|
1733
|
+
opts="-h -n -z -m -H -t -d -p -k -i -c -u --format --window --since --all --exact-paths --rows --path --status --host --until --help --number --duration --method --headers --timeout --warmup --threads --rate --body --proxy --insecure --disable-compression --disable-keepalive --disable-redirects --json --trace-header --vars --webhook --webhook-on --slack --export --snapshot --allow-host --max-requests --max-rate --max-concurrency --dry-run --fail-if --metrics --setup --config --write-config --load --keep --record --concurrency --user-agent"
|
|
1734
1734
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
1735
1735
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
1736
1736
|
return 0
|
|
@@ -1752,6 +1752,22 @@ _pepe() {
|
|
|
1752
1752
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
1753
1753
|
return 0
|
|
1754
1754
|
;;
|
|
1755
|
+
--path)
|
|
1756
|
+
COMPREPLY=($(compgen -f "${cur}"))
|
|
1757
|
+
return 0
|
|
1758
|
+
;;
|
|
1759
|
+
--status)
|
|
1760
|
+
COMPREPLY=($(compgen -f "${cur}"))
|
|
1761
|
+
return 0
|
|
1762
|
+
;;
|
|
1763
|
+
--host)
|
|
1764
|
+
COMPREPLY=($(compgen -f "${cur}"))
|
|
1765
|
+
return 0
|
|
1766
|
+
;;
|
|
1767
|
+
--until)
|
|
1768
|
+
COMPREPLY=($(compgen -f "${cur}"))
|
|
1769
|
+
return 0
|
|
1770
|
+
;;
|
|
1755
1771
|
--number)
|
|
1756
1772
|
COMPREPLY=($(compgen -f "${cur}"))
|
|
1757
1773
|
return 0
|
package/completions/pepe.fish
CHANGED
|
@@ -435,6 +435,10 @@ complete -c pepe -n "__fish_pepe_using_subcommand logs" -l format -d 'The access
|
|
|
435
435
|
complete -c pepe -n "__fish_pepe_using_subcommand logs" -l window -d 'What "now" is measured over, e.g. 10s, 1m, 5m' -r
|
|
436
436
|
complete -c pepe -n "__fish_pepe_using_subcommand logs" -l since -d 'How far back to start, e.g. 90m, 24h, 7d. At a terminal a log that is being written is shown live, from five minutes back, without it' -r
|
|
437
437
|
complete -c pepe -n "__fish_pepe_using_subcommand logs" -l rows -d 'Rows in each table of the report' -r
|
|
438
|
+
complete -c pepe -n "__fish_pepe_using_subcommand logs" -l path -d 'Count only the requests to these paths, with * for any run of characters: /api/*, /login; repeat for more. An error log line counts when its request does' -r
|
|
439
|
+
complete -c pepe -n "__fish_pepe_using_subcommand logs" -l status -d 'Count only the requests that answered these: 404, 5xx, 4xx,503; repeat for more. Error log lines are still counted' -r
|
|
440
|
+
complete -c pepe -n "__fish_pepe_using_subcommand logs" -l host -d 'Count only the requests to these hosts (the log\'s $host): shop.test exactly, .example.com for it and every host under it; repeat for more' -r
|
|
441
|
+
complete -c pepe -n "__fish_pepe_using_subcommand logs" -l until -d 'Leave out what is newer than this, e.g. 1h for up to an hour ago; with --since, a stretch in the past. A log read up to a time in the past isn\'t followed' -r
|
|
438
442
|
complete -c pepe -n "__fish_pepe_using_subcommand logs" -s n -l number -d 'Number of requests to perform' -r
|
|
439
443
|
complete -c pepe -n "__fish_pepe_using_subcommand logs" -s z -l duration -d 'Duration of the test, e.g. 10s, 3m, 2h (mutually exclusive with -n)' -r
|
|
440
444
|
complete -c pepe -n "__fish_pepe_using_subcommand logs" -s m -l method -d 'HTTP method, e.g. GET, POST, PUT, DELETE' -r
|
package/man/pepe-logs.1
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
.SH NAME
|
|
5
5
|
pepe\-logs \- Read nginx logs: requests per second now, against each minute, hour and day
|
|
6
6
|
.SH SYNOPSIS
|
|
7
|
-
\fBpepe logs\fR [\fB\-\-format\fR] [\fB\-\-window\fR] [\fB\-\-since\fR] [\fB\-\-all\fR] [\fB\-\-exact\-paths\fR] [\fB\-\-rows\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fIFILES\fR]
|
|
7
|
+
\fBpepe logs\fR [\fB\-\-format\fR] [\fB\-\-window\fR] [\fB\-\-since\fR] [\fB\-\-all\fR] [\fB\-\-exact\-paths\fR] [\fB\-\-rows\fR] [\fB\-\-path\fR] [\fB\-\-status\fR] [\fB\-\-host\fR] [\fB\-\-until\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fIFILES\fR]
|
|
8
8
|
.SH DESCRIPTION
|
|
9
9
|
Read nginx logs: requests per second now, against each minute, hour and day
|
|
10
10
|
.SH OPTIONS
|
|
@@ -27,6 +27,18 @@ Count /items/1 and /items/2 apart. Without it the numbers and ids in a path coun
|
|
|
27
27
|
\fB\-\-rows\fR \fI<N>\fR [default: 10]
|
|
28
28
|
Rows in each table of the report
|
|
29
29
|
.TP
|
|
30
|
+
\fB\-\-path\fR \fI<PATH>\fR
|
|
31
|
+
Count only the requests to these paths, with * for any run of characters: /api/*, /login; repeat for more. An error log line counts when its request does
|
|
32
|
+
.TP
|
|
33
|
+
\fB\-\-status\fR \fI<CODES>\fR
|
|
34
|
+
Count only the requests that answered these: 404, 5xx, 4xx,503; repeat for more. Error log lines are still counted
|
|
35
|
+
.TP
|
|
36
|
+
\fB\-\-host\fR \fI<HOST>\fR
|
|
37
|
+
Count only the requests to these hosts (the log\*(Aqs $host): shop.test exactly, .example.com for it and every host under it; repeat for more
|
|
38
|
+
.TP
|
|
39
|
+
\fB\-\-until\fR \fI<TIME>\fR
|
|
40
|
+
Leave out what is newer than this, e.g. 1h for up to an hour ago; with \-\-since, a stretch in the past. A log read up to a time in the past isn\*(Aqt followed
|
|
41
|
+
.TP
|
|
30
42
|
\fB\-h\fR, \fB\-\-help\fR
|
|
31
43
|
Print help
|
|
32
44
|
.TP
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"hasInstallScript": true,
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"name": "pepe-http",
|
|
22
|
-
"version": "0.
|
|
22
|
+
"version": "0.55.0"
|
|
23
23
|
},
|
|
24
24
|
"node_modules/detect-libc": {
|
|
25
25
|
"engines": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"requires": true,
|
|
51
|
-
"version": "0.
|
|
51
|
+
"version": "0.55.0"
|
|
52
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"artifactDownloadUrls": [
|
|
3
|
-
"https://github.com/omarmhaimdat/pepe/releases/download/v0.
|
|
3
|
+
"https://github.com/omarmhaimdat/pepe/releases/download/v0.55.0"
|
|
4
4
|
],
|
|
5
5
|
"author": "Omar MHAIMDAT",
|
|
6
6
|
"bin": {
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"zipExt": ".tar.xz"
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
|
-
"version": "0.
|
|
122
|
+
"version": "0.55.0",
|
|
123
123
|
"volta": {
|
|
124
124
|
"node": "18.14.1",
|
|
125
125
|
"npm": "9.5.0"
|