Skip to content

Add endpoint_id label to web transaction metrics - 2nd try

Sylvester Chin requested to merge sc1-add-endpoint-id-to-web-txn-2 into master

What does this MR do and why?

This MR attempts !132095 (merged) a second time. It closes #425852 (closed).

The problem with the first attempt is that the class method endpoint_id_for_action is only present in classes that extends the ApplicationController. As a result, we will encounter failures (as seen in #425841 (closed)) when controllers like Gitlab::RequestForgeryProtection::Controller are called.

The first commit is a revert of the revert while the second commit fixes the issue by inlining the endpoint_id_for_action.

Original MR description

This MR adds endpoint_id label to metrics that use Gitlab::Metrics::WebTransaction's labels. Our Rails SLI metrics uses endpoint_id. Adding endpoint_id across other relevant metrics will allow us to use endpoint_id to filter for metrics instead of using controller+action.

Note: there should be no increase in cardinality increase as endpoint_id is fundamentally controller + action.

See discussion in gitlab-com/runbooks#139 (comment 1562918668) and gitlab-com/runbooks!6273 (comment 1552663903)


Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports