Skip to content

Conversation

@alexplatteeuw
Copy link
Contributor

Background

A recent change in this commit altered how the controller name is recorded.

Previously, metrics used params["controller"], which returns the full namespaced path:

controller = params["controller"]
# => "authentication/sessions"

After the commit, we switched to using controller_instance.controller_name, which only returns the base controller name, stripping namespaces:

controller = controller_instance.controller_name
# => "sessions"

Problem

This change breaks existing queries on our side that rely on the full path. For example:

http_requests_total{controller=~"authentication/.*"}

no longer matches because controller_name only provides "sessions" instead of "authentication/sessions".

Solution

Use controller_instance.controller_path, which preserves the previous behavior:

controller = controller_instance.controller_path
# => "authentication/sessions"

This restores compatibility with existing queries.

@alexplatteeuw alexplatteeuw changed the title fix: Preserve full controller path fix: preserve full controller path Aug 26, 2025
@n-rodriguez n-rodriguez requested a review from SamSaffron August 26, 2025 22:48
@n-rodriguez
Copy link
Collaborator

LGTM

@SamSaffron SamSaffron merged commit 4bd3817 into discourse:main Aug 27, 2025
12 checks passed
@flori
Copy link

flori commented Nov 10, 2025

Now you just have to release it with a new version, then our api/foobar metrics would reappear in our grafana after the had suddenly disappeared.

@SamSaffron
Copy link
Member

SamSaffron commented Nov 10, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants