pepe-http 0.54.0 → 0.55.1

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 CHANGED
@@ -6,6 +6,104 @@ 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.1](https://github.com/omarmhaimdat/pepe/compare/v0.55.0...v0.55.1) - 2026-10-24
10
+
11
+ ### Fixed
12
+
13
+ - *(plugin)* the plugin manifests carry the release's version ([#229](https://github.com/omarmhaimdat/pepe/pull/229))
14
+
15
+ ## [0.55.0](https://github.com/omarmhaimdat/pepe/compare/v0.54.0...v0.55.0) - 2026-10-23
16
+
17
+ ### Added
18
+
19
+ - *(logs)* --path, --status, --host and --until, .gz read as is, --metrics, and a logs MCP tool ([#227](https://github.com/omarmhaimdat/pepe/pull/227))
20
+
21
+ Third of three PRs making `pepe logs` more powerful (after #223's
22
+ per-path traffic and #225's findings and alerts).
23
+
24
+ ## What changes
25
+
26
+ **Filters.** `--path '/api/*'`, `--status 5xx` (or `404`, `4xx,503`),
27
+ `--host .example.com` (or an exact host) and `--until 1h` keep only
28
+ those lines.
29
+ - The filters apply everywhere: every view, the findings, `--fail-if`
30
+ and the report.
31
+ - The title shows what was kept (`access.log · /api/* · 5xx`), and the
32
+ report counts what was left out (`logs.lines_filtered_out`).
33
+ - Error-log lines are kept by their `request:` and `host:` (added to the
34
+ error-log parser). A status filter never drops them.
35
+ - With `--status`, 5xx/4xx share findings are skipped, since they'd read
36
+ "5xx 100% now, 100% usually".
37
+ - `--since 2h --until 1h` reads a stretch in the past, and such a log
38
+ isn't followed. Bad input exits 2 with the reason.
39
+
40
+ **`.gz` read as is.** Rotated `access.log.2.gz` files are recognised by
41
+ their first two bytes, including multi-member gzip.
42
+ - Unpacking runs on a thread of its own, passing chunks to the reader
43
+ through a bounded channel.
44
+ - A `.gz` is never followed, not checked for "being written", and never
45
+ split across cores. Read progress counts its size on disk.
46
+ - The docs no longer suggest `zcat ... | pepe logs -`.
47
+ - New dependency: `flate2` with its pure-Rust backend (`miniz_oxide`),
48
+ no C to build.
49
+
50
+ **`--metrics` while following.** The Prometheus page is re-rendered
51
+ every second:
52
+ - `pepe_logs_requests_total{class}`, `_bytes_total`,
53
+ `_error_log_lines_total{level}`, `_unread_lines_total`
54
+ - last window: `_requests_per_second`, `_5xx_ratio`, `_4xx_ratio`,
55
+ `_live`
56
+ - histograms: `_request_duration_seconds`, `_upstream_duration_seconds`
57
+ - `pepe_logs_findings{level}` and `pepe_logs_fail_if_crossed{condition}`
58
+
59
+ **MCP `logs` tool.** It takes `files` (nginx's own if none are named),
60
+ `since`, `until`, `window`, `path`, `status`, `host`, `fail_if`,
61
+ `format`, `exact_paths` and `rows`, and is marked read-only with no
62
+ outside effects. Exit 4 comes back as an answer, not an error. The
63
+ server instructions, AGENTS.md, docs/agents.md, llms.txt and the skill
64
+ list it.
65
+
66
+ ## Checked
67
+ - 425 tests pass; clippy 1.98 is clean. New tests cover glob, status and
68
+ host matching, the filter on requests and error-log lines, `--until`, a
69
+ two-member `.gz` giving the same report as the plain file (and not
70
+ "being written"), and the MCP argument mapping.
71
+ - By hand:
72
+ - `pepe mcp` answered a `logs` call over stdio with the verdict and
73
+ `fail_if`.
74
+ - `--metrics` was scraped from a live screen driven in a pty, and the
75
+ session quit cleanly.
76
+ - The filters, and bad `--status` / `--until` values, were run on the
77
+ generated log.
78
+
79
+ ## Cost (bench/README.md)
80
+ | | before | after |
81
+ | --- | ---: | ---: |
82
+ | 862 MB log, every core, no filter (against v0.54) | 0.35 s, 3.1 s CPU,
83
+ ~140 MB | same |
84
+ | 189 MB log as `.gz`: `zcat \| pepe logs -` → `pepe logs file.gz` |
85
+ 0.52 s | 0.51 s, 28 MB |
86
+
87
+ Unpacking on the reading thread took 0.71 s, which is why it gets a
88
+ thread of its own. A first version checked the filter on every line and
89
+ cost about 4% CPU; it is now checked once per chunk.
90
+
91
+ ## Caveats
92
+ - The MCP `logs` tool reads any file the server's user can read, like
93
+ `replay` and `compare` do. The report can quote a line it couldn't parse
94
+ (`first_unread_line`) and error-log examples. Whoever starts `pepe mcp`
95
+ decides what it runs as.
96
+ - `--host` needs `$host` in the log format; the default `combined`
97
+ format has none.
98
+
99
+ ## 1.0
100
+ This adds `pepe logs` flags (`--path`, `--status`, `--host`, `--until`),
101
+ a report field (`lines_filtered_out`) and an MCP tool, so it restarts
102
+ the month without a flag or schema change.
103
+
104
+ Please squash-merge with this title so release-plz picks it up.
105
+
106
+
9
107
  ## [0.54.0](https://github.com/omarmhaimdat/pepe/compare/v0.53.0...v0.54.0) - 2026-10-23
10
108
 
11
109
  ### 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' \
@@ -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)')
@@ -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
@@ -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
@@ -19,7 +19,7 @@
19
19
  "hasInstallScript": true,
20
20
  "license": "MIT",
21
21
  "name": "pepe-http",
22
- "version": "0.54.0"
22
+ "version": "0.55.1"
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.54.0"
51
+ "version": "0.55.1"
52
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "artifactDownloadUrls": [
3
- "https://github.com/omarmhaimdat/pepe/releases/download/v0.54.0"
3
+ "https://github.com/omarmhaimdat/pepe/releases/download/v0.55.1"
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.54.0",
122
+ "version": "0.55.1",
123
123
  "volta": {
124
124
  "node": "18.14.1",
125
125
  "npm": "9.5.0"