Introduce `Gitlab.service_name` provider that would give a stable identifier of the context that you run in
In our codebase, we have multiple places where we use
defined?(::Rails::Console) to identify the context we're running in.
We want to keep this logic in a single testable component instead of spreading the implementation details all over the code.
Gitlab.process_name with a very similar idea, but it does not cover all possible sources.
We should either update it or introduce something similar (
Gitlab.service_name) and enforce its usage over the whole codebase to have a single way calculating this (to replace described calls ^).
It also makes sense to distinguish between
worker processes of Puma and Unicorn as it is required for our monitoring: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/30474#note_192248187