Skip to content
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

docs: update telemetry overview and Woopra plug-in docs to be devworkspace-specific #2268

Merged
merged 5 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 1 addition & 12 deletions modules/administration-guide/pages/che-theia-workspaces.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,15 @@ This documentation includes a guide describing how to make your own telemetry cl

* Duration of a workspace utilization
* User-driven actions such as file editing, committing, and pushing to remote repositories.
* The list of plug-ins enabled in a workspace
* Programming languages and devfiles used in workspaces.

== How it works
[id="how-it-works_{context}"]

When a {prod-short} workspace starts, the `che-theia` container starts the telemetry plug-in, which is responsible for sending telemetry events to a backend. If the `$CHE_WORKSPACE_TELEMETRY_BACKEND_PORT` environment variable was set in the workspace Pod, the telemetry plug-in will send events to a backend listening at that port.

If the {prod-short} workspace has a telemetry back-end container running, and it is listening on `$CHE_WORKSPACE_TELEMETRY_BACKEND_PORT`, it takes the events sent from the telemetry plug-in, turns them into the backend-specific representation of events, and sends them to the configured analytics backend (for example, Segment or Woopra).
When a {devworkspace} starts, the `che-theia` container starts the telemetry plug-in which is responsible for sending telemetry events to a backend. If the `$DEVWORKSPACE_TELEMETRY_BACKEND_PORT` environment variable is set in the {devworkspace} Pod, the telemetry plug-in sends events to a backend listening at that port. The backend turns received events into a backend-specific representation of the events and sends them to the configured analytics backend (for example, Segment or Woopra).

image::telemetry/telemetry_diagram.png[]

=== {devworkspace} telemetry

Telemetry for {devworkspace}s works similarly to telemetry for {prod-short} workspaces, with the main differences being:

. A {devworkspace} telemetry plug-in listens for events on `$DEVWORKSPACE_TELEMETRY_BACKEND_PORT` instead of `$CHE_WORKSPACE_TELEMETRY_BACKEND_PORT`.

. The {devworkspace} telemetry plug-in requires version 0.0.34 or later of the link:https://github.com/che-incubator/che-workspace-telemetry-client/tree/master/backend-base[telemetry plug-in dependency].

== Events sent to the backend by the Che-Theia telemetry plug-in

[cols="2,5", options="header"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,29 @@

= The Woopra telemetry plug-in

The link:https://github.com/che-incubator/che-workspace-telemetry-woopra-plugin[Woopra Telemetry Plugin] is a plug-in built to send telemetry from a {prod} installation to Segment and Woopra.
The link:https://github.com/che-incubator/devworkspace-telemetry-woopra-plugin[Woopra Telemetry Plugin] is a plug-in built to send telemetry from a {prod} installation to Segment and Woopra.
This plug-in is used by link:https://workspaces.openshift.com[Eclipse Che hosted by Red Hat], but any {prod} deployment can take advantage of this plug-in.
There are no dependencies other than a valid Woopra domain and Segment Write key.
The link:https://raw.githubusercontent.com/che-incubator/che-workspace-telemetry-woopra-plugin/master/meta.yaml[plug-in's meta.yaml] file has 5 environment variables that can be passed to the plug-in:
The devfile v2 for the plug-in, link:https://raw.githubusercontent.com/che-incubator/devworkspace-telemetry-woopra-plugin/main/plugin.yaml[plugin.yaml], has four environment variables that can be passed to the plug-in:

- `WOOPRA_DOMAIN` - The Woopra domain to send events to.
- `SEGMENT_WRITE_KEY` - The write key to send events to Segment and Woopra.
- `WOOPRA_DOMAIN_ENDPOINT` - If you prefer not to pass in the Woopra domain directly, the plug-in will get it from a supplied HTTP endpoint that returns the Woopra Domain.
- `SEGMENT_WRITE_KEY_ENDPOINT` - If you prefer not to pass in the Segment write key directly, the plug-in will get it from a supplied HTTP endpoint that returns the Segment write key.

To enable the Woopra plug-in on the {prod} installation, deploy the `meta.yaml` file to an HTTP server with the environment variables set correctly. Then, edit the `CheCluster` Custom Resource, and set the `spec.server.customCheProperties.CHE_WORKSPACE_DEVFILE_DEFAULT__EDITOR_PLUGINS` field:
To enable the Woopra plug-in on the {prod} installation, deploy the `plugin.yaml` devfile v2 file to an HTTP server with the environment variables set correctly. Then, set the `spec.server.workspaceDefaultPlugins` field of your `CheCluster` custom resource:

[source,yaml]
----
spec:
...
server:
customCheProperties:
CHE_WORKSPACE_DEVFILE_DEFAULT__EDITOR_PLUGINS: 'eclipse/che-machine-exec-plugin/7.20.0,https://your-web-server/meta.yaml'
...
workspacesDefaultPlugins:
- editor: eclipse/che-theia/next <1>
plugins: <2>
- 'https://your-web-server/plugin.yaml'
----

<1> The `editorId` to set the telemetry plug-in for.
<2> The URL to the telemetry plug-in's devfile v2 definition.