Create framework to be able to categorize grape endpoints with `feature category`
In #386 (closed) we annotated rails controller-actions with a feature category. We need to do the same for the REST API.
Suggestion by Oswaldo fromt he original issue.
Grape API
All routes under Foo
API are responsibility of a single feature category:
module API
class Foo < Grape::API
feature_category :foo_management
...
end
end
When a few routes under Foo
API are responsibility of a single feature category we could probably make use of the pattern returned by bundle exec rake grape:path_helpers
(or something similar):
module API
class Foo < Grape::API
feature_category :foo_management, only: ['/api/:version/audit_events', '/api/:version/issues']
...
end
end
In order to enforce that all actions and routes should have a feature_category
definition, we should validate that each action and API endpoint has a feature category in specs.
Outcome
As an outcome, we'd be able to categorize underlying service calls (e.g. Gitaly, Redis) metrics per 'feature category' in web requests, allowing to budget properly. Additionally that's also required for any other step towards automating notifications to Slack channels (in the context of web requests).