The metrics for Action API and REST API usage tracking should get a label that allows us to filter them by session type (auth type). The relevant information can be obtained from $session->getProvider() and $session->getProviderMetadata().
Description
Related Objects
- Mentioned In
- T418606: Include session type in x-analytics header
- Mentioned Here
- T418606: Include session type in x-analytics header
Event Timeline
I assume for the REST API this would use rest_api_modules_hit_total / rest_api_errors_total, and for the action API the mediawiki.api-request stream? It's a bit awkward because those are in core but the way to derive the session type is specific to what session providers are used. ($session->getProvider() doesn't have any human-readable identifier, just a class name, which is informative but not very user-friendly; $session->getProviderMetadata() returns an array with structure dependent on the provider, and you need to know the metadata format used by the OAuth extension to be able to tell things like OAuth version.)
So we might want to add a new SessionProvider method that returns a human-readable description of a given session's type.
(See the patch in T418606: Include session type in x-analytics header for how the session type can be derived.)