Skip to content

Commit

Permalink
Docs:telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
cheina97 authored and adamjensenbot committed Jul 31, 2023
1 parent 5abb8cd commit 2d11c65
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ serve: install html
docker run --rm -it -v $(PWD)/_build/html:/usr/share/nginx/html -p 8080:80 nginx

autoserve: install
@$(SPHINXAUTOBUILD) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXAUTOOPTS) $(O)
@$(SPHINXAUTOBUILD) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXAUTOOPTS) --port 8081 $(O)

lint:
markdownlint lint -c ../.markdownlint.yml **/*.md
22 changes: 15 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,23 @@ def __get_download_url(file: str) -> str:
return f"https://github.com/liqotech/liqo/releases/latest/download/{file}"
else:
return f"https://github.com/liqotech/liqo/releases/download/{html_context['current_version']}/{file}"

# generate_clone_example generates the clone and checkout code for the given example.
def generate_clone_example(example_name: str) -> str:
# generate_version generates the version string for the current page.
def generate_version() -> str:
version = html_context['github_version']
if 'current_version' in html_context and html_context['current_version'] == 'stable':
x = requests.get('https://api.github.com/repos/liqotech/liqo/releases/latest')
version = x.json()['tag_name']
return version

# generate_telemetry_link generates the link to the telemetry page for the current page.
def generate_telemetry_link(text: str) -> str:
version = generate_version()
return f"[{text}](https://github.com/liqotech/liqo/blob/{version}/pkg/telemetry/doc.go)"

# generate_clone_example generates the clone and checkout code for the given example.
def generate_clone_example(example_name: str) -> str:
version =generate_version()
return f"```bash\n\
git clone https://github.com/liqotech/liqo.git\n\
cd liqo\n\
Expand All @@ -122,10 +132,7 @@ def generate_clone_example(example_name: str) -> str:

# generate_clone_example_tf generates the clone and checkout code for the given example.
def generate_clone_example_tf(example_name: str) -> str:
version = html_context['github_version']
if 'current_version' in html_context and html_context['current_version'] == 'stable':
x = requests.get('https://api.github.com/repos/liqotech/liqo/releases/latest')
version = x.json()['tag_name']
version =generate_version()
return f"```bash\n\
git clone https://github.com/liqotech/liqo.git\n\
cd liqo\n\
Expand Down Expand Up @@ -172,6 +179,7 @@ def generate_liqoctl_version_warning() -> str:
'generate_clone_example_tf': generate_clone_example_tf,
'generate_liqoctl_install': generate_liqoctl_install,
'generate_liqoctl_version_warning': generate_liqoctl_version_warning,
'generate_telemetry_link': generate_telemetry_link,
'github_repo': 'liqo',
'github_version': 'master',
'display_github': True,
Expand Down
3 changes: 3 additions & 0 deletions docs/installation/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ The main global flags, besides those concerning the installation of [development
* `--timeout`: configures the timeout for the completion of the installation/upgrade process.
Once expired, the process is aborted and Liqo is rolled back to the previous version.
* `--verbose`: enables verbose logs, providing additional information concerning the installation/upgrade process (e.g., for troubleshooting).
* `--disable-telemetry`: disables the collection of telemetry data, which is enabled by default.
The telemetry is used to collect anonymous usage statistics, which are used to improve Liqo.
Additional details are provided {{ env.config.html_context.generate_telemetry_link('here') }}.

(InstallControlPlaneFlags)=

Expand Down
21 changes: 21 additions & 0 deletions pkg/telemetry/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,25 @@
// limitations under the License.

// Package telemetry builds and sends telemetry data to the Liqo telemetry server.
// The telemetry data contains information about the cluster and the Liqo installation.
// The telemetry server aggregates the collected data and provides it to the Liqo maintainers.
// All the transmitted data is anonymous and does not contain any sensitive information.
// In particular the following data is sent:
// - Cluster ID
// - Liqo version
// - Kubernetes version
// - Provider (e.g. GKE, EKS, AKS, ...)
// - Peering info
// -- RemoteClusterID
// -- PeeringType (OutOfBand/InBand)
// -- DiscoveryType (LAN/Manual/IncomingPeering)
// -- Latency
// -- Incoming (enabled, resources)
// -- Outgoing (enabled, resources)
// - Namespaces info
// -- UID
// -- MappingStrategy (EnforceSameName/DefaultName)
// -- OffloadingStrategy (Local/Remote/LocalAndRemote)
// -- HasClusterSelector (true/false)
// -- NumOffloadedPods (map of clusterID -> number of offloaded pods)
package telemetry

0 comments on commit 2d11c65

Please sign in to comment.