Collecting MAU for GitLab IntelliJ Plugin
Problem to solve
When we publish the GitLab IntelliJ Plugin, we will need the ability to track how many people are using it.
Proposal
Replicate what we did for the GitLab VS Code Extension and process the User-Agent
header for GitLab API requests.
The new IntelliJ Plugin is going to submit User-Agent
header like gitlab-jetbrains-plugin/0.0.1 intellij-idea/2021.2.4 java/11.0.13 mac-os-x/aarch64/12.1
for each API request.
Header breakdown
The header is inspired by the VS Code Extension User-Agent header (vs-code-gitlab-workflow/3.11.1 VSCode/1.52.1 Node.js/12.14.1 (darwin; x64)
)
It consists of four parts separated by space
-
gitlab-jetbrains-plugin/0.0.1
- plugin name and version - we can use the plugin name to identify requests coming from the plugin, the version helps us with queries like:- How quickly do plugin users update to the latest version?
- How many users on
gitlab.com
are using a version that contains a bug? - What version of the plugin is making problematic requests to the API?
-
intellij-idea/2021.2.4
the Jetbrains editor and its version. In the POC I only tested IntelliJ Idea, but I assume that theintellij-idea
would be replaced with strings likerubymine
,pycharm
, orwebstorm
- We get this information fromcom.intellij.openapi.application.ApplicationInfo
(versionName
/fullVersion
).- This is important to know when we want to take advantage of some new Jetbrains editor features. We have to assess how many users haven't yet upgraded to the desired editor version.
-
java/11.0.13
- Which Java version (System.getProperty("java.version")
) is used to run the Jetbrains Editor (and hence the plugin). -
mac-os-x/aarch64/12.1
- What platform is the plugin running on (System.getProperty("os.name")
/System.getProperty("os.arch")
/System.getProperty("os.version")
). This showed to be useful to know for the VS Code Extension. For example, we can see how many users are affected by a bug that only happens on Windows.
References
Edited by Tomas Vik