Commit 0761f59
Include SCRIPT_NAME when determining path in Collector
When determining the path for a request, `Rack::Request` prefixes the
`SCRIPT_NAME`, [as seen here][1].
This is a problem with our current code when using mountable engines,
where the engine part of the path gets lost.
This patch fixes that to include `SCRIPT_NAME` as part of the path.
NOTE: This is not backwards compatible. Labels will change in existing
metrics. We will cut a new major version once we ship this.
[1]: https://github.com/rack/rack/blob/294fd239a71aab805877790f0a92ee3c72e67d79/lib/rack/request.rb#L512
Co-authored-by: Ian Ker-Seymer <[email protected]>
Co-authored-by: Ruslan Kornev <[email protected]>
Signed-off-by: Daniel Magliola <[email protected]>1 parent 726536c commit 0761f59
File tree
2 files changed
+16
-2
lines changed- lib/prometheus/middleware
- spec/prometheus/middleware
2 files changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
73 | | - | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | | - | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
| |||
0 commit comments