If you set external_url 'http://gitlab.example.com/gitlab' and then curl the local NGINX status location for Rails metrics, you get 404. The rest of the instance is fine. Prometheus, after a related fix, was already scraping the prefixed path. The NGINX stub was still proxying to a path Workhorse would not forward.
This is the story of omnibus-gitlab!10081, a one-variable template change, and a helper that already knew the right path.
The issue: a prefix the scrape job had, and the stub did not
The issue was omnibus-gitlab#10221, opened by Jason Plum. When external_url includes a path, Workhorse only serves /-/metrics under that prefix. The NGINX location /rails-metrics template proxied to http://gitlab-workhorse/-/metrics with no relative URL, so Workhorse did not send the request on to Puma, and NGINX returned 404.
omnibus-gitlab!9929 had already fixed the Prometheus scrape job, by introducing Prometheus.rails_metrics_path. The scrape job and the NGINX stub had drifted apart. The stub was the one still wrong.
The fix: pass the path the scrape job already uses
The recipe now passes that helper into the template, and the template uses it:
location /rails-metrics { proxy_cache off; proxy_http_version 1.0; proxy_pass http://gitlab-workhorse<%= @rails_metrics_path %>; Prometheus.rails_metrics_path takes gitlab_relative_url and returns /-/metrics when there is no prefix, or /gitlab/-/metrics when the relative URL is /gitlab. The default path does not change. A relative URL gets the same prefix the scrape job already uses, so the two stop disagreeing.
The ChefSpec covers both sides. On a default external_url, the rendered file still contains proxy_pass http://gitlab-workhorse/-/metrics;. When external_url is http://gitlab.example.com/gitlab, it contains proxy_pass http://gitlab-workhorse/gitlab/-/metrics;.
You can check it on a node after reconfigure:
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8060/rails-metrics That should return 200 when the prefix is in the rendered extra_metrics_conf file.
Why this stayed hidden
The application can be completely healthy while this stub is wrong. Users browse under /gitlab. CI runs. The scrape job, after !9929, was already using the prefixed path, so Prometheus could be scraping the real endpoint even as curl to the NGINX /rails-metrics location returned 404. That location is a convenience alias on the status port, not the path browsers hit, which is why the bug survived until someone looked at the stub itself.
Reusing Prometheus.rails_metrics_path is also a small insurance policy. If the helper's idea of a relative URL ever changes, the stub and the scrape job change together. A second handwritten "#{relative}/-/metrics" in the ERB would have fixed today's 404 and invited the next drift.
What I took away
1. A relative URL is a prefix, not only an external_url string. Workhorse will not forward paths that sit outside that prefix. A hardcoded /-/metrics is correct only for the default install.
2. If a helper already exists for the other caller, use it. Prometheus.rails_metrics_path was added for the scrape job. Reusing it is how the stub and the scrape job stay on the same path the next time the helper changes.
3. Spec both the default and the prefixed install. A single example for /gitlab would not have caught a typo that broke the common case. A single example for the default would have missed the entire bug.
4. 404 on a status endpoint is easy to miss. The application can look healthy while the metrics stub is pointed at a path Workhorse will never serve.
The MR merged on 23 November 2026.
Links
- Issue: omnibus-gitlab#10221
- Merge request: omnibus-gitlab!10081
- Related scrape-job fix: omnibus-gitlab!9929
Thanks to Jason Plum for the issue, and to João Alexandre Cunha for the review.
If you've been thinking about contributing to GitLab, the community issues are a great place to start: contributors.gitlab.com.



