Skip to content

fix(agent): add tracking for JetBrains Gateway and Fleet #10491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from

Conversation

matifali
Copy link
Member

@matifali matifali commented Nov 2, 2023

Context

This PR is more of a workaround than a fix. It fixes an issue where a session's MagicType was not correctly identified when connecting to a workspace via JetBrains Gateway or Fleet. As a result, the session was not being tracked in the agent's stats. To identify them correctly, this PR adds a check for the TERMINAL_EMULATOR and TERM_PROGRAM environment variables. The current approach does not segregate between Fleet and Gateway usage and consolidates both under MagicSessionTypeJetBrains.

Fixes #9673.

Testing

I am trying to test it via a PR deployment.

Future work

For the future, we can separate tracking Gleet and Gateway usage.

@matifali matifali changed the title fix(agent): tracking of JetBrains Gateway and Fleet fix(agent): track JetBrains Gateway and Fleet Nov 2, 2023
@matifali matifali requested a review from Emyrk November 2, 2023 11:27
Copy link

github-actions bot commented Nov 2, 2023


✔️ PR 10491 Updated successfully.
🚀 Access the credentials here.

cc: @matifali

@matifali matifali changed the title fix(agent): track JetBrains Gateway and Fleet fix(agent): add tracking for JetBrains Gateway and Fleet Nov 2, 2023
Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work around 👍. Future proof when SetEnv is corrected as well

@@ -1,6 +1,5 @@
[default.extend-identifiers]
alog = "alog"
Jetbrains = "JetBrains"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct?

Copy link
Member Author

@matifali matifali Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove this to fix the lint check. Otherwise, typos CLI complains about
https://github.com/coder/coder/pull/10491/files#diff-e2fb60d4b313fc2ad42c37ce065c0c880e04615b339a843e14892338d0bb4396R268

There is no way to skip checking a single line.
The best we can do is skip the whole file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. And this is a github linter, no golang-ci lint. That you could skip one line.

@Emyrk Emyrk self-requested a review November 6, 2023 13:49
@matifali
Copy link
Member Author

matifali commented Nov 7, 2023

This does not work. We only check for env variables when the initial connection is est blished, ut the variables I am looking for are being injected later when we select the IDE and connect via it and possibly when we open the integrated terminal. I am closing it for now.
cc: @code-asher

@matifali matifali closed this Nov 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2023
@github-actions github-actions bot deleted the jetbrains-tracking branch May 5, 2024 00:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: /api/v2/deployment/stats does not return count for JetBrains Gateway sessions
2 participants